Hi,
I was in need to create the query in string variable and execute the same.I found the solution which fits in my situation.
The below mentioned way gives you idea where i need that.As i have the list of values and i want only those records to be retrive from the Database.
EXECUTE(@STRQRY)
ALTER procedure [dbo].[spGetData]
@strDataIDs varchar(max)
as
begin
DECLARE @STRQRY NVARCHAR(MAX)
SET @STRQRY= 'select * from DataMaster where accnum not in (' +@strDataIDs+ ')'
EXECUTE(@STRQRY)
end
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment