Thứ Tư, 31 tháng 1, 2018

get the text of a stored procedure into a variable in SQL Server

Đưa tất cả text trong procedure vào biến chuỗi SQL:

declare @source_code varchar(max)
declare @objectid int
select @objectid=object_id('dbo.my_stored_procedure_name')
select @source_code = object_definition(@objectid )

Không có nhận xét nào:

Đăng nhận xét