Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 string to numeric conversion - In Operator

Author  Topic 

rajsequel
Starting Member

8 Posts

Posted - 2003-10-03 : 07:11:20
Hi,

i want to send either 1 Deptno or a bunch of Deptno in the query, so i have to separate it with comma (delimeter), and hence i have declared it as varchar. But the below is not working. Can anybody help.

Declare @mDno Varchar(100)
Set @mDno = '100,200,300'
Print @mDno
Select * From Emp1 Where Convert(Varchar(30),Dno) In (@mDno)


rajesh

robvolk
Most Valuable Yak

15732 Posts

Posted - 2003-10-03 : 07:43:36
Search SQL Team for "dynamic SQL", or even better, read the SQL Team FAQ.
Go to Top of Page
   

- Advertisement -