вторник, 8 июня 2010 г.

хранимки в ms sql

упрощённый общий вид.



DROP PROCEDURE get_info


CREATE PROC get_info
@arg_A nvarchar(max),
@arg_B nvarchar(max)
AS
select field_D, field_E
from Table_A inner join Table_B
on Table_B.id = Table_A.id_fkey
where Table_A.field_A = @arg_A
and Table_A.field_B = @arg_B





EXEC get_info @arg_A ='67890', @arg_B ='12345'