Groups | Blog | Home
all groups > sql server replication > july 2005 >

sql server replication : Where condition using variable ?


Boomessh
7/7/2005 10:22:02 PM
Hai all,

I need to do the following...

declare @strwhere varchar(100)
set @strwhere = ' and col2 = 6' -- where columnname is an integer datatype.
select * from <tablename> where col1 = 'B' + @strwhere

but the above query is not working when @strwhere takes a where condition
for an integer datatype. How can i do this..i don't want to use
sp_executesql..

Is there any other way to do this?

Thanks,
Boomessh
7/7/2005 11:50:02 PM
Hai all,

I am sorry as i have posted it in a wrong Group.

Boomessh

[quoted text, click to view]
AddThis Social Bookmark Button