Exec Function() with count row,

Posted by Prafullshrivastava under Sql Server on 6/13/2011 | Points: 10 | Views : 1558 | Status : [Member] | Replies : 3
Hi ,
How to find no of rows if i use exec() for executing the query..........

Pshrivastava


Responses

Posted by: PandianS on: 6/13/2011 [Member] [MVP] Silver | Points: 25

Up
0
Down
EXEC('select * from Tb_Table1; Select @@Rowcount [Rows]')

(or)
Sp_ExecuteSQL N'select * from Tb_Table1; Select @@Rowcount [Rows]'
EXEC('select * from Tb_Table1')

Select @@Rowcount [Rows]
Go
(or)
Sp_ExecuteSQL N'select * from Tb_Table1'
Select @@Rowcount [Rows]
Go

Cheers
www.sqlserverbuddy.blogspot.com

Cheers
www.SQLServerbuddy.blogspot.com
iLink Multitech Solutions

Prafullshrivastava, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sksingh on: 6/14/2011 [Member] Starter | Points: 25

Up
0
Down
Hi Pshrivastava ,

Check below link for exec function


http://msdn.microsoft.com/en-us/library/ms188001.aspx

Regards,
Sunil

Prafullshrivastava, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Susanthampy on: 6/15/2011 [Member] [MVP] Bronze | Points: 25

Login to post response