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
 General SQL Server Forums
 New to SQL Server Programming
 Segmenting statements

Author  Topic 

JaybeeSQL
Posting Yak Master

112 Posts

Posted - 2012-07-06 : 13:10:18
Hi all,

Not sure if "segmenting" is the right word, and maybe this should be in the Admin forum, but I'm running some defragmentation and I'm trying to encapsulate statements so that SQL explicitly runs one, after the other, as so...

Use BIRrr
Go
dbcc indexdefrag(BIRrr,tblImage, IX_tblImage_Series)
go
dbcc indexdefrag(BIRHEAR_RR1_ARCH,tblImage, IX_tblImage)
go

Is this the right way to ensure SQL ONLY starts one defragmentation after the previous one is finished? I have a feeling there's more to it than just inserting the word "go"....

Cheers,

JB

robvolk
Most Valuable Yak

15732 Posts

Posted - 2012-07-06 : 13:25:52
You don't need the GO, they'll run in sequence after each completes.
Go to Top of Page
   

- Advertisement -