Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dynamic Select

Status
Not open for further replies.

sqlserverbest

Programmer
Jan 16, 2003
8
0
0
US
I tried this sql query and it said I need to declare @rowcount variable when it is already declare. What is the problem here.

DECLARE @sql varchar(1000), @rowccount int
SET @sql = 'Select @rc=count(*) From ttg_position_stg'
EXECUTE sp_executesql @sql, N'@rc int output', @rc=@rowcount output


Help is appreciated
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top