November 17, 2011 at 10:53 am
Hi,
Can anyone correct this code..
I have an input parameter supervisorId as INTEGER;here i have to change to varchar(20) because in the report its there as principal
with name so that is a string,string in the text field where clause is not a good practice so we kept that as integer in procedure
now for this parameter i have to select multi selection list so that i have changed in the report from single to multi select
here is the code for deleting single selected list
IF(@supervisorId IS NOT NULL) AND (@supervisorId <> 0)
BEGIN
DELETE FROM #Rpt22036WorkTable
WHERE ISNULL(supervisorId,0) <> @supervisorId
END
can anyone tell me how to delete multiple lists instead of this single....the above code is for handling ALL we cant select ALL
with another list right?...
November 21, 2011 at 9:58 am
Hi
Not sure about you whole query and requirement but if its finally have to be deleted based on id passed then you can go with this dynamic query.
Can change query as per your need
declare @s-2 varchar(10)
select @s-2='37,42'
declare @query varchar(500)
set @query='select * from #Rpt22036WorkTable
where EmployeeID in ('+@s+')'
exec( @query)
Thanks & Regards
Syed Sami Ur Rehman
SQL-Server (Developer)
Hyderabad
Email-sami.sqldba@gmail.com
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply