كيف ادخل أكثر من متغير الى Stored Procedure
بيحث استطيع أن استعمل العبارة
Select * From Table where Id_No in (a,b,c,...(
كيف ادخل أكثر من متغير الى Stored Procedure
بيحث استطيع أن استعمل العبارة
Select * From Table where Id_No in (a,b,c,...(
تم تعديل هذه المشاركة بواسطة walcom في 10 مارس 2005 في 12:36
Use sp_execute_sql to evaluate the sql query and pass the list of ids
as a string.this list will get evaluated inside the query
CREATE PROCEDURE test
@list varchar(500)
as
DECLARE @query NVARCHAR(500)
Set @query = N'Select*From table Where Id in (' + @list + ')'
EXEC sp_executesql @querycalling :
exec test "1,2,3"
will get you all the records which id is in the list
Madani
تم تعديل هذه المشاركة بواسطة walcom في 19 ديسمبر 2004 في 12:27
شكراً جزيلاً أخ مدني و ماقصرت
هذا الموضوع مغلق.