Click here to monitor SSC
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
Ten Centuries
Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)

Group: General Forum Members
Points: 1281 Visits: 1357
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
Ten Centuries
Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)

Group: General Forum Members
Points: 1385 Visits: 816
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
SSCommitted
SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)

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

Mark D Powell
JStiney
JStiney
SSC Journeyman
SSC Journeyman (93 reputation)SSC Journeyman (93 reputation)SSC Journeyman (93 reputation)SSC Journeyman (93 reputation)SSC Journeyman (93 reputation)SSC Journeyman (93 reputation)SSC Journeyman (93 reputation)SSC Journeyman (93 reputation)

Group: General Forum Members
Points: 93 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
SSCommitted
SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)

Group: General Forum Members
Points: 1779 Visits: 462
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
One Orange Chip
One Orange Chip (27K reputation)One Orange Chip (27K reputation)One Orange Chip (27K reputation)One Orange Chip (27K reputation)One Orange Chip (27K reputation)One Orange Chip (27K reputation)One Orange Chip (27K reputation)One Orange Chip (27K reputation)

Group: General Forum Members
Points: 27330 Visits: 18343
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

SQLRNNR
SQLRNNR
One Orange Chip
One Orange Chip (27K reputation)One Orange Chip (27K reputation)One Orange Chip (27K reputation)One Orange Chip (27K reputation)One Orange Chip (27K reputation)One Orange Chip (27K reputation)One Orange Chip (27K reputation)One Orange Chip (27K reputation)

Group: General Forum Members
Points: 27330 Visits: 18343
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

SQLRNNR
SQLRNNR
One Orange Chip
One Orange Chip (27K reputation)One Orange Chip (27K reputation)One Orange Chip (27K reputation)One Orange Chip (27K reputation)One Orange Chip (27K reputation)One Orange Chip (27K reputation)One Orange Chip (27K reputation)One Orange Chip (27K reputation)

Group: General Forum Members
Points: 27330 Visits: 18343
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

Wilfred van Dijk
Wilfred van Dijk
Ten Centuries
Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)

Group: General Forum Members
Points: 1281 Visits: 1357
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
SSC Journeyman
SSC Journeyman (97 reputation)SSC Journeyman (97 reputation)SSC Journeyman (97 reputation)SSC Journeyman (97 reputation)SSC Journeyman (97 reputation)SSC Journeyman (97 reputation)SSC Journeyman (97 reputation)SSC Journeyman (97 reputation)

Group: General Forum Members
Points: 97 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