is it possible to use a variable in a query with the IN
clause (a,b,c..z), without getting quotes or conversion
errors?

Answers were Sorted based on User's Feedback



is it possible to use a variable in a query with the IN clause (a,b,c..z), without getting quotes ..

Answer / guest

You can use a variable as your IN clause, but this requires
that you use the EXEC function to run the statement.

Is This Answer Correct ?    2 Yes 1 No

is it possible to use a variable in a query with the IN clause (a,b,c..z), without getting quotes ..

Answer / kishor kumar

It is possible by using Dynamic SQL.

Is This Answer Correct ?    1 Yes 0 No

Post New Answer

More SQL Server Interview Questions

one table has four field id,name,design,salary. i have to find maximum salary .

6 Answers  


How to find the date and time of last updated table?

3 Answers  


Explain how dts is used to extract, transform and consolidate data?

0 Answers  


What is the difference between ROW_NUMBER and Ranking function in SQL SERVER?

0 Answers  


What are the High-Availability solutions in SQL Server and differentiate them briefly?

0 Answers  


what is the difference between writing data to mirrored drives versus raid5 drives. : Sql server administration

0 Answers  


What different steps will a sql server developer take to secure sql server?

0 Answers  


Join 3 tables (table1, table2 & table3) in a single query. Inner join should be applied for table1 & table 2 and left outer join for table1 & table3 where table2.dept is ABC

2 Answers  


what do you understand by change data capture?

0 Answers  


What is use of attribute hierarchy optimized state? : sql server analysis services, ssas

0 Answers  


how can do you the system monitoring?

1 Answers  


What are three ways you can use an identity value inside a trigger? Why would you prefer one way over another?

0 Answers  


Categories