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

List the different index configurations possible for a table?

0 Answers  


Is null vs coalesce?

0 Answers  


How do you persist objects, permissions in tempdb

1 Answers  


How to generate create function script on an existing function?

0 Answers  


We need to perform what steps in the following order to work with a cursor?

0 Answers  






find 2nd highest salary of person using cursor concept?

6 Answers   HCL,


What is a result set object returned by odbc_exec()?

0 Answers  


What the different types of Replication and why are they used?

0 Answers  


List out the differences between global and local temp tables in sql server?

0 Answers  


Can you explain the types of Joins that we can have with Sql Server?

2 Answers  


Can we use pragma autonomous_transaction in trigger?

0 Answers  


What are constraints in microsoft sql server?

0 Answers  


Categories