Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

How to find (or create) the stats_stream, rowcount, and pagecount used in Update Statistics Expand / Collapse
Author
Message
Posted Tuesday, January 15, 2013 3:06 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Wednesday, May 1, 2013 1:05 PM
Points: 9, 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
Post #1407506
Posted Tuesday, January 15, 2013 6:35 PM


Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: Monday, September 29, 2014 5:52 AM
Points: 369, Visits: 1,215
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
Post #1407539
Posted Wednesday, January 16, 2013 3:15 AM


SSC Eights!

SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!

Group: General Forum Members
Last Login: Today @ 6:55 AM
Points: 941, Visits: 2,936
DBCC SHOW_STATISTICS(N'[dbo].[StgVendItem]', N'XIE1StgVendItem') 
WITH STATS_STREAM





The SQL Guy @ blogspot

@SeanPearceSQL

About Me
Post #1407717
Posted Wednesday, January 16, 2013 5:06 AM


Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: Monday, September 29, 2014 5:52 AM
Points: 369, Visits: 1,215
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
Post #1407759
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse