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.
| Author |
Topic |
|
pareshmotiwala
Constraint Violating Yak Guru
323 Posts |
Posted - 2008-01-02 : 16:55:29
|
| can i use a dbcc command in a cursor.I am currently trying to run dbcc help command for all the dbcc command available by using:DECLARE dbcc_commands insensitive CURSORREAD_ONLYFOR dbcc help ('?')--FOR READ_ONLYDECLARE @name varchar(1024)OPEN dbcc_commandswhere am I screwing up?RegardsParesh MotiwalaBoston, USA |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2008-01-02 : 16:56:37
|
| Where is your select statement that defines what records to cursor over? Have you looked at the cursor examples in BOL?Tara KizerMicrosoft MVP for Windows Server System - SQL Serverhttp://weblogs.sqlteam.com/tarad/ |
 |
|
|
pareshmotiwala
Constraint Violating Yak Guru
323 Posts |
Posted - 2008-01-02 : 17:12:35
|
| Hi Tarahappy new year.dbcc help('?') returns names of dbcc commands.I just want to be able to run dbcc help for each of these values returned.ThanksRegardsParesh MotiwalaBoston, USA |
 |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2008-01-02 : 17:17:34
|
| Put the commands into a temp table. Then use a loop to go through each database and run each command from the temp table. So you'll end up with two loops.Tara KizerMicrosoft MVP for Windows Server System - SQL Serverhttp://weblogs.sqlteam.com/tarad/ |
 |
|
|
pareshmotiwala
Constraint Violating Yak Guru
323 Posts |
Posted - 2008-01-03 : 09:30:57
|
| okie dokie. Just read it, had to leave yesterday to catch a train.RegardsParesh MotiwalaBoston, USA |
 |
|
|
|
|
|