TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Azaad Abbas
NA
221
41.6k
data type converting in database
Feb 19 2015 12:20 AM
Hello All,
I need to pass any data type value from browser to below parameter so how ? need to apply condition to '@value'?then how?
Create PROCEDURE sp_Get_CustInfoInRecPay
(@ColumnName VARCHAR(50)=null,
@Value VARCHAR(50)=null)
AS
BEGIN
DECLARE @cmd AS NVARCHAR(max)
SET @Value = ''''+@Value+ ''''
SET @cmd = N'SELECT
C_Register.UserId, C_Register.Name, C_Register.UserName, C_Register.MobNo,
Area.AreaName, C_Register.Address, C_Register.CreatedDate, C_Register.Status
FROM C_Register join Area on C_Register.AreaId = Area.AreaId WHERE ' + @ColumnName + ' = ' + @Value
EXEC(@cmd)
END
Reply
Answers (
10
)
What is meant by a "dirty state of an object"?
Chase Payment Gateway