HI I have the following code below. I am trying to display the countrows variable in the CSV file but it is not displaying, only the first query is displaying. How can I get both to display? ThanksALTER PROCEDURE [dbo].[PROCEDURE] AS BEGIN select field1,field2 from table declare @sql varchar(8000) select @@rowcount select @sql = 'bcp "exec PROCEDURE" queryout C:cppro.txt -c -t, -T -S'+ @@servername exec xp_cmdshell @sql END
I just need to show the amount of rows returned from the query in the CSV file, if that answers your question?!
[quote user="Guestuser31"] I just need to show the amount of rows returned from the query in the CSV file, if that answers your question?! [/quote]ALTER PROCEDURE [dbo].[PROCEDURE] AS BEGIN select field1,field2 from table declare @sql varchar(8000) select @sql = 'bcp "exec PROCEDURE" queryout C:cppro.txt -c -t, -T -S'+ @@servername exec xp_cmdshell @sql select @@rowcount