interviews.dotnetthread.com

↑ Grab this Headline Animator

Wednesday, October 19, 2011

How to use Variable in SQL IN Clause

DECLARE @EmpID VARCHAR(8000)
SET @EmpID = '''Emp1'',''Emp2'''

Select * from emp
where empid in(@empid) - This doesnt work...

For solution check the below URL.
http://www.dotnetthread.com/tips/25-Using-variable-in-SQL-IN-statement.aspx

Submit this story to DotNetKicks

2 comments:

Post a Comment

Post your comments/questions/feedback for this Article.

 

Latest Articles