Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


How to find (or create) the stats_stream, rowcount, and pagecount used in Update Statistics


How to find (or create) the stats_stream, rowcount, and pagecount used in Update Statistics

Author
Message
hmbmeister
hmbmeister
Grasshopper
Grasshopper (11 reputation)Grasshopper (11 reputation)Grasshopper (11 reputation)Grasshopper (11 reputation)Grasshopper (11 reputation)Grasshopper (11 reputation)Grasshopper (11 reputation)Grasshopper (11 reputation)

Group: General Forum Members
Points: 11 Visits: 32
I have been asked to script out the creation of specific tables in the database including primary key, nonclustered indexes, all constraints, and statistics. I am almost done with it except for the update statistics.

I can't find any information on how to find (or create) the hex stats_stream on a specific statistic. Anyone know how that is created?

I need the stats_stream, rowcount, and pagecount.

Example below:
UPDATE STATISTICS [dbo].[StgVendItem]([XIE1StgVendItem]) WITH STATS_STREAM = 0x01000000040000000000000000000000B98268400000000088000000000000000000000000000000380100003800000004000A00000000000000000000000000A7020000A70000000C0000000000000008D0003400000000A7020000A70000001E0000000000000008D0003400000000380100003800000004000A00000000000000000000000000, ROWCOUNT = 0, PAGECOUNT = 0
Vedran Kesegic
Vedran Kesegic
Old Hand
Old Hand (382 reputation)Old Hand (382 reputation)Old Hand (382 reputation)Old Hand (382 reputation)Old Hand (382 reputation)Old Hand (382 reputation)Old Hand (382 reputation)Old Hand (382 reputation)

Group: General Forum Members
Points: 382 Visits: 1255
From BOL: "Not supported. Future compatibility is not guaranteed."
http://msdn.microsoft.com/en-us/library/ms187348.aspx
Why don't you just create and/or refresh statistics to get realistic data ?
You could update system tables using dedicated admin connection (put "admin:" in front of server name) and starting the sql instance in single-user mode ("-m;" startup parameter), but why doing such invasive stuff when you can probably go with normal, supported methods?

_____________________________________________________
Microsoft Certified Master: SQL Server 2008
XDetails Addin - for SQL Developers
blog.sqlxdetails.com - Transaction log myths

Sean Pearce
Sean Pearce
Ten Centuries
Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)

Group: General Forum Members
Points: 1170 Visits: 3432
DBCC SHOW_STATISTICS(N'[dbo].[StgVendItem]', N'XIE1StgVendItem') 
WITH STATS_STREAM





The SQL Guy @ blogspot

@SeanPearceSQL

About Me
Vedran Kesegic
Vedran Kesegic
Old Hand
Old Hand (382 reputation)Old Hand (382 reputation)Old Hand (382 reputation)Old Hand (382 reputation)Old Hand (382 reputation)Old Hand (382 reputation)Old Hand (382 reputation)Old Hand (382 reputation)

Group: General Forum Members
Points: 382 Visits: 1255
Nice article here: http://blog.kejser.org/2011/07/07/the-ascending-column-problem-in-fact-tables-part-two-stat-job/
Still - unsupported, so you use it on your own risk.

_____________________________________________________
Microsoft Certified Master: SQL Server 2008
XDetails Addin - for SQL Developers
blog.sqlxdetails.com - Transaction log myths

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