Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 How to suppress resultsets in SQL 2000?

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2004-06-02 : 07:21:32
Shweta writes "Hello,

I am running my select queries (inside a stored procedure)using EXEC keyword. The query works fine, but it displays the record in the query analyzer when I run the stored procedure thro' Query Analyzer. I want to suppress this resultsets. I know we can do this in Oracle.
I tried a lot with SQL Server 2000, but in vain.
Please help me on the same.

Query Ex:
DECLARE @TBName SYSNAME
SET @TBName = 'xyz'+ CAST(@@SPID AS VARCHAR)
EXEC ('SELECT * FROM '+ @TBName)

Thank you,
Shweta"

gpl
Posting Yak Master

195 Posts

Posted - 2004-06-02 : 09:03:22
A select query is supposed to return data
If you want to stop the 'xx row(s) affected' coming out as well, put this at the start of your procedure

Set NoCount On

Graham
Go to Top of Page
   

- Advertisement -