SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Check status of HEAP tables


Check status of HEAP tables

Author
Message
Wilfred van Dijk
Wilfred van Dijk
SSCertifiable
SSCertifiable (7.3K reputation)SSCertifiable (7.3K reputation)SSCertifiable (7.3K reputation)SSCertifiable (7.3K reputation)SSCertifiable (7.3K reputation)SSCertifiable (7.3K reputation)SSCertifiable (7.3K reputation)SSCertifiable (7.3K reputation)

Group: General Forum Members
Points: 7272 Visits: 1372
Comments posted to this topic are about the item Check status of HEAP tables

Wilfred
The best things in life are the simple things
gserdijn
gserdijn
SSCrazy
SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)

Group: General Forum Members
Points: 2502 Visits: 820
Thanks, it helped me to spot a potential problem that I was yet unaware of.



Dutch Anti-RBAR League
Mark D Powell
Mark D Powell
Hall of Fame
Hall of Fame (3.7K reputation)Hall of Fame (3.7K reputation)Hall of Fame (3.7K reputation)Hall of Fame (3.7K reputation)Hall of Fame (3.7K reputation)Hall of Fame (3.7K reputation)Hall of Fame (3.7K reputation)Hall of Fame (3.7K reputation)

Group: General Forum Members
Points: 3652 Visits: 501
I have not read all the code yet but doesn't #db03632 need to be defined somewhere?

Mark D Powell
JStiney
JStiney
SSC-Addicted
SSC-Addicted (471 reputation)SSC-Addicted (471 reputation)SSC-Addicted (471 reputation)SSC-Addicted (471 reputation)SSC-Addicted (471 reputation)SSC-Addicted (471 reputation)SSC-Addicted (471 reputation)SSC-Addicted (471 reputation)

Group: General Forum Members
Points: 471 Visits: 446
I would like to run your script, but I get invalid characters in blank spaces when I copied it out of the window and ran it in Management Studio.
What is the easiest way to fix for this?



Mark D Powell
Mark D Powell
Hall of Fame
Hall of Fame (3.7K reputation)Hall of Fame (3.7K reputation)Hall of Fame (3.7K reputation)Hall of Fame (3.7K reputation)Hall of Fame (3.7K reputation)Hall of Fame (3.7K reputation)Hall of Fame (3.7K reputation)Hall of Fame (3.7K reputation)

Group: General Forum Members
Points: 3652 Visits: 501
I copied it into notepad and used the edit/replace option to replace a copy/paste of the stupid little squate box to space. That seemed to work but I got an error when I tried to exectue the script complaigning #db03632 does not exist.

I will have took look into the temp table definition later.

HTH -- Mark D Powell --
SQLRNNR
SQLRNNR
SSC Guru
SSC Guru (229K reputation)SSC Guru (229K reputation)SSC Guru (229K reputation)SSC Guru (229K reputation)SSC Guru (229K reputation)SSC Guru (229K reputation)SSC Guru (229K reputation)SSC Guru (229K reputation)

Group: General Forum Members
Points: 229347 Visits: 18677
Mark D Powell (3/18/2010)
I copied it into notepad and used the edit/replace option to replace a copy/paste of the stupid little squate box to space. That seemed to work but I got an error when I tried to exectue the script complaigning #db03632 does not exist.

I will have took look into the temp table definition later.

HTH -- Mark D Powell --



It looks like the temp table is either an insert into or select into based on the if condition. This should probably be changed so that the an existence check for the temp table is performed prior to that if condition.

Jason...AKA CirqueDeSQLeil
_______________________________________________
I have given a name to my pain...MCM SQL Server, MVP
SQL RNNR
Posting Performance Based Questions - Gail Shaw
Learn Extended Events

SQLRNNR
SQLRNNR
SSC Guru
SSC Guru (229K reputation)SSC Guru (229K reputation)SSC Guru (229K reputation)SSC Guru (229K reputation)SSC Guru (229K reputation)SSC Guru (229K reputation)SSC Guru (229K reputation)SSC Guru (229K reputation)

Group: General Forum Members
Points: 229347 Visits: 18677
JStiney (3/18/2010)
I would like to run your script, but I get invalid characters in blank spaces when I copied it out of the window and ran it in Management Studio.
What is the easiest way to fix for this?



Use something like notepad++ to remove the unprinted characters.

Jason...AKA CirqueDeSQLeil
_______________________________________________
I have given a name to my pain...MCM SQL Server, MVP
SQL RNNR
Posting Performance Based Questions - Gail Shaw
Learn Extended Events

SQLRNNR
SQLRNNR
SSC Guru
SSC Guru (229K reputation)SSC Guru (229K reputation)SSC Guru (229K reputation)SSC Guru (229K reputation)SSC Guru (229K reputation)SSC Guru (229K reputation)SSC Guru (229K reputation)SSC Guru (229K reputation)

Group: General Forum Members
Points: 229347 Visits: 18677
Last comment for the moment. I like the principle of this script. Nice idea and it looks like it could be very helpful.

Thanks.

Jason...AKA CirqueDeSQLeil
_______________________________________________
I have given a name to my pain...MCM SQL Server, MVP
SQL RNNR
Posting Performance Based Questions - Gail Shaw
Learn Extended Events

Wilfred van Dijk
Wilfred van Dijk
SSCertifiable
SSCertifiable (7.3K reputation)SSCertifiable (7.3K reputation)SSCertifiable (7.3K reputation)SSCertifiable (7.3K reputation)SSCertifiable (7.3K reputation)SSCertifiable (7.3K reputation)SSCertifiable (7.3K reputation)SSCertifiable (7.3K reputation)

Group: General Forum Members
Points: 7272 Visits: 1372
Regarding the temptable: I use the @toggle flag to determine if the temptable is already created or not.
In the first loop, @toggle=0 and a "select into" is used to create the table. @toggle is also set to 1
In the next loops, @toggle=1, resulting in an "insert into"

If you want to be sure this table doesn't exist, add this code before the cursor declaration:

begin try
drop table #db03632
end try
begin catch
-- dummy
end catch



Regarding the "Strange characters": that's a result of different charactersets Crazy . As suggested, copy code into an editor and remove the goofy characters

Wilfred
The best things in life are the simple things
Federico Iori
Federico Iori
Ten Centuries
Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)

Group: General Forum Members
Points: 1141 Visits: 300
Is possible to rebuild an heap simply by using :
alter table tt rebuild partition=all(x) ,
avalaible in Sqlserver 2008, online operation.

In SqlServer2005 is possible to use my script , published on sqlservercentral, rebuild_partition .
It should work for a nonpartitioned table giving there partition_number=1

Another method is to create a clustered index on the table, then dropping the index

Federico Iori
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum








































































































































































SQLServerCentral


Search