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)
 Stored Procedure

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2002-06-18 : 09:03:01
Bhasker writes "I am executing a stored procedure to run
DBCC CHECK TABLE command on a table containing listoftables.
After the command is executed everytime the result of command to
be stored in a file.

How to write the result of query in stored procedure to a file?"

YellowBug
Aged Yak Warrior

616 Posts

Posted - 2002-06-18 : 10:37:09
DBCC CHECKTABLE does not return a recordset.
It only returns messages.

You could use osql to run a script and direct the output to a file.
osql /U /P /i dbcc.qry /o dbcc.res

Go to Top of Page

bm1000
Starting Member

37 Posts

Posted - 2002-06-18 : 11:32:18
While this isn't exactly what you want, have a look at xp_sqlmaint. I don't think it will do a checktable, but you can use it to do a checkdb, and it will write the output to a file.

Go to Top of Page
   

- Advertisement -