Painting Blue Code
Simple, self-explanatory code snippets.
2013-12-30
TSQL - Dynamic SQL execution results into variable
declare
@RecordCount
as
int
;
set
@RecordCount
=
0
;
declare
@SQL
as
varchar
(
2000
);
set
@SQL
=
'select @x=FIELD_NAME from TABLE1;'
;
exec
sp_executesql
@SQL
,
N'@x int out'
,
@RecordCount
out
;
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment