Thursday, September 08, 2005
Wednesday, September 07, 2005
bit or tinyint
Is it better to use a tinyint field instead of a bit field if you are going to index it? Some people say it would probably be better to use a tinyint because the bit has to be extracted from the bitmask causing some overhead. I haven't found any real deep technical information about this but it sounds acceptable.
So if any of you have real hardcore stuff please post a comment :-D
In case I find some info I'll obviously send a little update!
Tuesday, September 06, 2005
Insufficient result space to convert uniqueidentifier value to char.
Insufficient result space to convert uniqueidentifier value to char.
This was caused by a CAST as varchar without specifying the length (or a too short length).
Just using CAST(field as char(36)) solved the problem.
Understanding TempDB, table variables v. temp tables and Improving throughput for TempDB
Finding Duplicate Indexes in Large SQL Server Databases
I suppose it happens more than you think...
Monday, September 05, 2005
Create a PDF from a stored procedure without using 3rd party utils
Check it out.
I can't say that I'm a fan of such practices but who knows someone might be able to use it out there.
Thursday, September 01, 2005
Uninstalling CTP
Check out this post. The VS 2005 Diagnostic and Uninstall Tool does the sometimes difficult task for you!
Tuesday, August 30, 2005
Override isolation level
Eg.
SET TRANSACTION ISOLATION LEVEL SERIALIZABLE
SELECT Field FROM table t1
INNER JOIN table2 t2 WITH (READUNCOMMITTED) ON t1.ID = t2.ID
This would cause serializable locks on t1 and read uncommitted on t2.
Monday, August 29, 2005
String Summary Statistics
SQL Server 2005 includes patented technology for estimating the selectivity of LIKE conditions. It builds a statistical summary of substring frequency distribution for character columns (a string summary). This includes columns of type text, ntext, char, varchar, and nvarchar. Using the string summary, SQL Server can accurately estimate the selectivity of LIKE conditions where the pattern may have any number of wildcards in any combination. For example, SQL Server can estimate the selectivity of predicates of the following form:
Column LIKE 'string%'
Column LIKE '%string'
Column LIKE '%string%'
Column LIKE 'string'
Column LIKE 'str_ing'
Column LIKE 'str[abc]ing'
Column LIKE '%abc%xy'If there is a user-specified escape character in a LIKE pattern (i.e., the pattern is of the form LIKE pattern ESCAPE escape_character), then SQL Server 2005 guesses selectivity. This is an improvement over SQL Server 2000, which uses a guess for selectivity when any wildcard other than a trailing wildcard % is used in the LIKE pattern, and has limited accuracy in its estimates in that case. The String Index field in the first row set returned by DBCC SHOW_STATISTICS includes the value YES if the statistics object also includes a string summary. The contents of the string summary are not shown. The string summary includes additional information beyond what is shown in the histogram. For strings longer than 80 characters, the first and last 40 characters are extracted from the string and concatenated prior to considering the string in the creation of the string summary. Hence, accurate frequency estimates for substrings that appear only in the ignored portion of a string are not available.
Sunday, August 28, 2005
MySQL
I honestly love SQL Server even more now :-) I don't want to talk bad about MySQL itself because I don't know enough about the product to do so. But the tools provided are really sad as opposed to the tools that are included with SQL Server. I just wanted to know the queries that were run and their io, cpu, duration etc (<3 Profiler<3) but apparently there is no way with the standard tools to determine this. Graphical Query plans or even plans like the Text Query Plans in SQL Server... couldn't find it :-(
Friday, August 26, 2005
MSDN users to get early access to Visual Studio 2005 tools
Very good news!
Thursday, August 25, 2005
Using Sp_configure To Change a Value Will Issue DBCC FREEPROCCACHE
SQL Server Magazine's Reader's Choice Awards
Congratulations to the authors!
Buy
Wednesday, August 24, 2005
Adding a non nullable column without a default
There is however an easy workaround.ALTER TABLE only allows columns to be added that can contain nulls or have a DEFAULT definition specified. Column 'NewColumn' cannot be added to table 'tbl_test' because it does not allow nulls and does not specify a DEFAULT definition.
ALTER TABLE dbo.tbl_test
ADD NewColumn smalldatetime NOT NULL
CONSTRAINT DF_ToDrop DEFAULT ('2000-01-01')
ALTER TABLE dbo.tbl_test
DROP CONSTRAINT DF_ToDrop
Tuesday, August 23, 2005
sql_variant
One tip I would give you is to always explicitly cast the value you insert (or update) to the datatype you want it to be. Apparently SQL Server uses 2 extra bytes to determine the extra information like the datatype etc. (eg. int would be 6 bytes).
The SQL_VARIANT_PROPERTY function gives you information about the variant itself like datatype, total bytes, precision ...
For more information visit:
sql_variant
SQL_VARIANT_PROPERTY
Monday, August 22, 2005
Back and already having fun
Thursday, August 11, 2005
Holiday
I've got 2 weeks off so you might not read very much this week and the week to come :)
Take care
Thursday, August 04, 2005
Give the New PIVOT and UNPIVOT Commands in SQL Server 2005 a Whirl
Wednesday, August 03, 2005
This must be painful
Ouch ouch ouch
Let’s get into standards now. Guess what, Paul? Your site,
WinSuperSite.com currently has 124
validation errors, according to the W3C’s Markup Validation Service.
Even worse, the page which contains your “Boycott IE” story currently has 207
validation errors. Both pages don’t even define the page’s doctype,
which is almost always the first line of the web page.
Monday, August 01, 2005
Page splits
One way of determining whether you are having page splits and how many is to use the function ::fn_dblog (@StartingLSN, @EndingLSN). Passing NULL to the two parameters makes sure that the whole log is being read.
eg.
SELECT [Object Name], [Index Name], COUNT(*)
FROM ::fn_dblog(NULL, NULL)
WHERE Operation = 'LOP_DELETE_SPLIT'
GROUP BY [Object Name], [Index Name]
ORDER BY COUNT(*) DESC
You can reduce page splits by specifying a good fill factor. There is no real rule of thumb about fill factors. It all depends on the rowsize and number of rows inserted (between index rebuilds). So specifying a good fill factor and a DBCC DBREINDEX from time to time will minimize the number of page splits.
Friday, July 29, 2005
An unexpected error occurred in Report Processing. (rsUnexpectedError)
After some surfing I came across an article in the Reporting Services newsgroup where one MattiasT had the same problem and he found the conditions for it to happen.
1. You are using a table.
2. The HideDuplicates property is used on a detail cell in this table.
3. The table contains a subreport.
And sure enough... when I remove the HideDuplicates the report generates just fine.
Unfortunately there seems to be no solution for the time being, except for changing the way you create the report because having all 3 conditions is a prerequisite.
Thursday, July 28, 2005
TempDB and missing Device
One of our development servers was used for tests with a SAN disk. They moved our TempDB to the SAN and after the tests removed the SAN disks. No problem, but they forgot to move the TempDB location to the local disks. Result? No more SQL Server :-x
In order to get it back up we did the following:
Start SQL Server from the command prompt with the following syntax
sqlserver -f -c -T3609 -T4022
-f: minimal configuration mode
-c: not as a service (console mode so you can follow the nice little thingies SQL Server does)
-T3609: skip tempdb creation at startup
-T4022: bypasses automatically started procedures
Then we updated sysdatabases and sysaltfiles (I know it's hardcore) with the correct file locations.
Restart SQL Server and GO GO GO
The Daily WTF (What The F*ck)
It's a website that gathers programming stupidity on a daily basis.
Tuesday, July 26, 2005
Connected Systems Developer Competition - Win $50,000 USD
Check out this link.
Monday, July 25, 2005
Mindi Abair
Check them out.
Week @ Home
It's good to be back but I liked it more being home ;-)
Friday, July 15, 2005
CHAR and NULL
This was true in SQL Server 6.5 but not in SQL Server 2000. So if you really need a nullable CHAR field it may be better to define the field as VARCHAR.
Wednesday, July 13, 2005
Report Packs
Microsoft provides some nice Report Packs from time to time.
Have fun
Monday, July 11, 2005
New computer - installed
I am very pleased with the results although I had some trouble with XP64 and I had to install XP32 again :-(
Thursday, July 07, 2005
A bold statement: "Open source could damage the market"
Bob Hayward, senior vice president and chief research officer, Gartner Research Asia-Pacific, said that software developers could be discouraged from creating new software because of the multitude of open source software available for free. This is further driven by major vendors that are making their software available as open source.
Check out the complete article here
Software Patents... No no no
Of the 732 people 648 voted no, a clear vote imho.
I suppose this will not be the end of the whole story...
Wednesday, July 06, 2005
New computer - update
Tuesday, July 05, 2005
SAN Phase II
Seems our plans are quite useless, the layout of the disks has changed :-( Anyway, we decided on a new plan. Currently +200 disks are assigned to our development servers. We're waiting for the draft as proposed by them (considering our remarks of course).
Monday, July 04, 2005
Friday, July 01, 2005
Tetris SAN
Thursday, June 30, 2005
AWE 3GB PAE... WTF?
/3GB
Windows normally allows user mode applications to use 2GB of memory. The switch moves the starting point of the kernel to 3GB making it available to user mode applications. Windows 2003 added an extra switch userva to customize the exact amount between 2GB and 3GB. In short this makes it possible for your applications to use 3GB instead of 2GB of memory. Do note that there may be some drawbacks when your server is very powerful. In some cases the server might be able to handle so many threads that it's 1GB of kernel memory is insufficient.
Note Microsoft Product Support Services strongly recommends using a range
of memory for the /USERVA switch that lies within the range of 2800-3030. This
range is wide enough to provide a large enough pool of system page table entries
for all currently observed issues. Usually a setting of /userva=2800 will
provide close to the maximum available number of system page table entries
possible.
PAE (Physical Address Extension)
PAE allows Windows to use more memory than 4GB in combination with AWE
AWE
AWE is an API that enables programs to address more than 4GB (with PAE). It enables them to reserve memory as 'non-paged' memory. This means that memory taken by AWE is never paged to disk until the applications is closed or explicitly frees it.
Wednesday, June 29, 2005
8 Steps to better Transaction Log throughput
And after that add her website to your favorites!
Tuesday, June 28, 2005
New Computer
This is what I had in mind:
A lot of the parts are not available right now so I'll have to wait a while until they are delivered. Finally I will be able to install Windows XP 64 bit, and then probably notice that half my programs no longer work :-sMSI S939 K8N SLI Platinum nForce4UltraSLI 4DCDDR4 2PCI-X Sata 7.1ch FW GLan
AMD Athlon 4200+ 64Bit X2 Dual-Core Processor Socket 939 Boxed with cooler
GEIL Ultra-X Series Dual Channel 1GB 2x512MB PC3200 400MHz Selected 5ns CL 2 5-2-2 GLX1GB3200DC
Western Digital Raptor 74Gb E-Sata 10000rpm 8Mb cache 5,2Mms
Maxtor 300Gb 7200rpm SATA 150 16Mb DiamondMax 10
Gainward PCI-E GT6600GT PowerPack! Ultra/1980PCX TV-DVI 256Mb 2ns DDR3 Fan
Sharkoon Silvation Case - Airflow by included Airtunnel - Alu front panel Screwless - w/o PS
Power Supply 400Watt ATX JJ-400PPGA Silent Intel 2 20/24 pin 8cm SATA - PCI-E Retail + power cable
NEC DVD +R/+-RW ND-3540 Black OEM Dual Layer
DVD LG 8161B 48x16x Tray Blk Black (black or white + black front)
Floppy disk drive Sony 1,44MB Black
Any comments on what to buy or not to buy are of course welcome!
Monday, June 27, 2005
Microsoft Update Services
Not only will it update your Windows but also your Exchange Server, SQL Server, Office, ...
Please check for details as not all versions of the above mentioned products are supported.
Check it out here
BINARY_CHECKSUM AND CHECKSUM
It's purpose is to build hash indices speeding up queries by matching a 4-byte int instead of a costly character comparison. Especially on large text columns the function can be of use.
For more information check out the BOL.
I'll take the example from BOL (c) Microsoft
-- Create a checksum index.There's also a little brother called CHECKSUM_AGG which returns the checksum of the values in a group. The example in BOL uses it to track changes in data.
SET ARITHABORT ON
USE
Northwind
GO
ALTER TABLE Products
ADD cs_Pname AS
checksum(ProductName)
CREATE INDEX Pname_index ON Products (cs_Pname)
/*Use the index in a
SELECT query. Add a second search
condition to
catch stray cases where
checksums match,
but the values are not
identical.*/
SELECT *
FROM Products
WHERE checksum(N'Vegie-spread') =
cs_Pname
AND
ProductName = N'Vegie-spread'
Friday, June 24, 2005
Thursday, June 23, 2005
Batch Compilation, Recompilation, and Plan Caching Issues in SQL Server 2005
Go go go
Tuesday, June 21, 2005
MSDN TV - Reporting Services 2005
Download
TempDB guidelines
Assessments for SQL Server 2005
I scored 70% on the SQL Server 2005 for Developers test, not too bad for a first time I hope :-)
In case you wonder, I'm not bored, I'm just testing some processes that take quite some time ;-)
Microsoft Windows Server 2003 Performance Advisor
It's a diagnostics program that collects performance information. Once the program collected the data you can get a nice overview of all the information captured. It is a highly configurable program and not for the faint of heart. It supports trending if you have a SQL Server 2000 database available.
Monday, June 20, 2005
SQL Server 2005 - June CTP Installed
I wanna play but it's too late :( I need some rest if I want to make it through the week :)
Friday, June 17, 2005
Creating covering indexes in SQL Server 2005
I've been testing the new INCLUDE statement in 2005.
From the BOL:
INCLUDE ( column [ ,... n ] )
Specifies the nonkey columns to
be added to the leaf level of the nonclustered index. The nonclustered index can
be unique or nonunique.
The maximum number of included nonkey columns is 1,023 columns; the minimum
number is 1 column.
Column names cannot be repeated in the INCLUDE list and cannot be used
simultaneously as both key and nonkey columns. For more information, see Index
with Included Columns.
All data types are allowed except text, ntext, and image. The index must be
created or rebuilt offline (ONLINE = OFF) if any one of the specified nonkey
columns are varchar(max), nvarchar(max), or varbinary(max) data types.
Computed columns that are deterministic and either precise or imprecise can
be included columns. Computed columns derived from image, ntext, text,
varchar(max), nvarchar(max), varbinary(max), and xml data types can be included
nonkey columns as long as the computed column data types is allowable as an
included column. For more information, see Creating Indexes on Computed
Columns.
Didn't have much time but I did a couple of quick tests. Just created a simple table with a covered index 'the old way' and then 'the new way'. From what I've seen until now the duration is not much less but inserting 10000 records in to the table takes about 10000 reads less with the INCLUDE index. From the info above I suppose it has something to do with the fact that the nonkey column is only present on the leaf level and not throughout the whole tree like a key column.
As soon as I find some time to test is a little deeper I'll try to let you know!
SQL Server 2005 - June CTP
As you probably already know... SQL Server June 2005 Community Technology Preview is available!
Go go go!
AWE vs SQL Server 2000 SP4
The bad news is that it's not available yet at least not to the public, although it should be available through PSS.
Report Builder available in Standard Edition of SQL Server 2005 Reporting Services
In February, we announced the product line for SQL Server 2005. As part ofI think it's great that Microsoft listens to their users... keep up the good work!
this announcement, we revealed that Reporting Services would ship with
Standard
and Enterprise Editions and that Report Builder would be available
with
Enterprise Edition. Based on your feedback, and because we believe that
reporting is a core scenario for all customers, we've made the decision to
include Reporting Services in all versions for SQL Server 2005 including
Express, Workgroup, Standard and Enterprise Editions. In addition, Report
Builder will be available with Workgroup, Standard and Enterprise
Editions.
Thursday, June 16, 2005
How to avoid "Parameter Sniffing" in SQL Server 2005
Although Ken Henderson gave us a nice solution some time ago for SQL Server 2000, SQL Server 2005 will support the OPTIMIZE FOR statement. Adding this to a query makes sure the plan is optimized for the value you specify. And when all else fails you can even force a particular query plan with the new USE PLAN statement. I'll try to give some examples as soon as I find some time.
Tuesday, June 07, 2005
Visual Studio 2005 and SQL Server 2005 release date announced
More information here
As part of the keynote address, Paul Flessner, senior vice president of
Server Applications at Microsoft, showed the company’s continued momentum in
preparation for the launch of SQL Server™ 2005, Visual Studio® 2005 and BizTalk®
Server 2006, and announced that these products will be formally launched during
the week of Nov. 7.
Reporting Services still doing a great job
This gives me the chance to leave for Spain in a happy mood. We (our company) are going on a trip to Spain from Wednesday (yep that's right, tomorrow :p) until Tuesday next week. While we are there there will be 2 courses. One will be about SQL Server 2005 and the other one about Visual Studio 2005 and obviously .NET 2.0. Two great topics imho although many people will disagree :)
The weather is looking quite nice for the time being ;)
Friday, June 03, 2005
Reporting Services doing a great job
A couple of minor data issues the first 2 days in production but everything went quite well.
/me is happy
How to avoid "Parameter Sniffing" in SQL Server 2000
Funny he's using Belgium as an example, it's where I live :)
Monday, May 30, 2005
The first test run in production today was a bit disappointing :( Instead of 32 we were only getting 17 reports per second. Although that is still twice the amount we need I would have hoped that the performance would be better. The problem is that there are other processes running (and quite heavy ones) while the reports are being generated. Because the new SAN has to be installed we are running all this on local disks atm.
Friday, May 27, 2005
Thursday, May 26, 2005
I'll let you know whether I'm happy or sad come Tuesday :-)
Friday, May 20, 2005
As soon as I find some time I'll test it. I'll keep you updated.
http://www.ssw.com.au/SSW/Products/ProdSummaryList.aspx
The UPDLOCK locking hint is a very interesting one.
It prevents other connections from updating a record but allows other connections to still read the information. It assures you that your process will be the next in line for an exclusive lock. SQL Server actually uses update locks before acquiring an exclusive lock (eg. UPDATE with a WHERE clause). It happens so fast most of the times that they probably won't popup in the locking information you get to see.
To prevent conversion deadlocks (typical in a read and update transaction) it is a good idea to use this locking hint (you'll probably want a REPEATABLE READ or SERIALIZABLE isolation level for these kind of transactions too).
Thursday, May 19, 2005
With 1 DB server and 2 App servers we are generating 32 reports/sec. Quite a nice result as our target was 8/sec :-)
If you want more information or details feel free to contact me.
Wednesday, May 18, 2005
In order to get a text from a database to display in the page footer you have to include a textbox in the data region and then reference this textbox in a second textbox which you create in the footer region.
No problem so far, a bit weird but not too much trouble. However, when exporting to PDF the footer would just display on the first page and not on all the following pages.
I have solved it by defining an extra parameter, clearing the prompt text and setting the default value to From Query. Select the correct Dataset and the field you would like to use.
Works like a charm.
There was one little issue left though. The report would fail if the stored procedure that retrieved the parameter value would not return any records. I have solved this with the following simple yet effective workaround:
DECLARE @Description varchar(1024)
SELECT @Description = [Description] FROM tbl_document_caption WHERE ...
SELECT @Description as [Description]
It was created by a friend of mine and I promised I would promote it :-D
http://www.lollersaurus.com
Tuesday, May 17, 2005
From the Microsoft website:
Warning: Microsoft has found an issue with the final build of SP4 that
impacts customers who run SQL Server with Address Windowing Extensions (AWE)
support enabled. This issue only impacts computers with more than two gigabytes
(2 GB) of memory where AWE has been explicitly enabled. If you have this
configuration, you should not install SP4. Microsoft is currently working on the
problem and will issue an update soon.
Wednesday, May 11, 2005
By the looks of this column is doesn't look too good (for the time being though).
Monday, May 09, 2005
https://blogs.msdn.com/slavao/archive/2005/01/29/363181.aspx
http://www.microsoft.com/sql/downloads/2000/sp4.asp
In case you guys don't know her already.
She is one of the absolute gurus in the obscure SQL Server world :-)
http://www.sqlskills.com/blogs/kimberly/
Her blog isn't updated on a daily basis but when she updates it you can be sure that it's very usefull information.
Wednesday, May 04, 2005
SELECT o.Name as 'Table Name', g.GroupName
FROM sysobjects o
JOIN sysindexes i on i.id = o.id
JOIN sysfilegroups g on g.groupid = i.groupid
Tuesday, May 03, 2005
It is an in depth study of DBCC SQLPERF (WAITSTATS) with a lot of information on what to monitor.
There are a couple of interesting formulas in the article that came to my attention.
Initial Compiles(%) = (SQL Compilations/sec - SQL Recompilations/sec) / Batch Requests/sec
Plan Reuse (%) = (Batch Requests/sec - Initial Compiles/sec) / Batch Requests/sec
To determine the optimal Packet Size use the following formula:
Average Number of Bytes per packet = Bytes Total/sec / Packets/sec
Wednesday, April 27, 2005
TRUNCATE is faster than DELETE is not a complete answer (although true), but what makes it faster.
DELETE removes the rows one at a time and records this in the transaction log. TRUNCATE removes them by deallocating the data and index pages and only this action is logged.
There are a couple of things to note though:
- If a foreign key references the table TRUNCATE will not work
- If the table is publishing data for replication TRUNCATE will not work
- Delete triggers are not fired
Many people believe that TRUNCATE is not logged, this is of course not true. You can use TRUNCATE in a transaction (try using it in a transaction and rollback that transaction).
Wednesday, April 20, 2005
Friday, April 15, 2005
We have an Execute SQL task that calls a stored procedure containing xp_cmdshell to BCP out 2 tables and some other stuff. Somewhere after the export of the second one the step reports to be completed successfully although there are a couple commands that need to be executed after the BCP (in the same stored procedure).
Apparently - still investigating though - using NO_OUTPUT solves the problem
We've been looking for a problem in a DTS package for 3 days with 2 people already.
I've stumbled on the following KB which explains why we were probably looking on the wrong places :(
FIX: A DTS Package That Uses Global Variables Ignores Error Message Raised by RAISERROR
Solved in a hotfix and of course in SP4 which should be arriving around June (I guess)
Tip 2
What is the fiber mode used for and when should I use it?
SQL Server 7.0 and 2000, by default, run in what is called "thread mode." What this means is that SQL Server uses what are called UMS (User Mode Schedulers) threads to run user processes. SQL Server will create one UMS thread per processor, with each one taking turns running the many user processes found on a busy SQL Server. For optimum efficiency, the UMS attempts to balance the number of user processes run by each thread, which in effect tries to evenly balance all of the user processes over all the CPUs in the server.
SQL Server also has an optional mode it can run in, called fiber mode. In this case, SQL Server uses one thread per processor (like thread mode), but the difference is that multiple fibers are run within each thread. Fibers are used to assume the identity of the thread they are executing and are non-preemptive to other SQL Server threads running on the server. Think of a fiber as a "lightweight thread," which, under certain circumstances, takes less overhead than standard UMS threads to manage. Fiber mode is turned on and off using the "lightweight pooling" SQL Server configuration option. The default value is "0", which means that fiber mode is turned off.
So what does all this mean? Like everything, there are pros and cons to running in one mode over another. Generally speaking, fiber mode is only beneficial when all of the following circumstances exist:
--Two or CPUs are found on the server (the more the CPUs, the larger the benefit).
--All of the CPUS are running near maximum (95-100%) most of the time.
--There is a lot of context switching occurring on the server (as reported by the Performance Monitor System Object: Context Switches/sec. Generally speaking, more than 5,000 context switches per second is considered high.
--The server is making little or no use of distributed queries or extended stored procedures.
If all the above are true, then turning on "lightweight pooling," option in SQL Server may see a 5% or greater boost in performance.
But if the four circumstances are all not true, then turning on "lightweight pooling" could actually degrade performance. For example, if your server makes use of many distributed queries or extended stored procedures, then turning on "lightweight pooling" will definitely cause a problem because they cannot make use of fibers, which means that SQL Server will have to switch back-and- forth from fiber mode to thread mode as needed, which hurts SQL Server's performance.
Also note that some features no longer work when enabling this mode like SQLMail.
(c) http://www.sql-server-performance.com
Thursday, April 07, 2005
Read about some interesting new features in SQL Server 2005.
- CTE
- CROSS/OUTER APPLY
- DELETE/UPDATE OUTPUT INTO
- INSERT WITH MERGE
- XPath Queries in XML columns
- Triggers on DDL
- ...
The list is long and very very interesting :(
I can hardly wait to use it but unfortunately the release will be around the end of the year and before companies start using it will take some time too. At home I will of course enjoy it to it's fullest :)
Wednesday, March 16, 2005
Check out this link, the article is written by a colleague of ours and it's quite nice (kk biased information but I still think it is :p)
Monday, March 14, 2005
I'll try to post some of them from time to time. Please note that some content might be from other sources than myself, I will try to mention them as accurate as possible!
Tip 1:
A good query to view index information (© Kimberly Tripp)
SELECT object_name(si.[id]) AS [TableName]
, rowcnt AS [Row Count]
, CASE
WHEN si.indid = 0 then 'Heap'
WHEN si.indid = 1 then 'CL'
WHEN INDEXPROPERTY ( si.[id], si.[name], 'IsAutoStatistics') = 1 THEN 'Stats-Auto'
WHEN INDEXPROPERTY ( si.[id], si.[name], 'IsHypothetical') = 1 THEN 'Stats-HIND'
WHEN INDEXPROPERTY ( si.[id], si.[name], 'IsStatistics') = 1 THEN 'Stats-User'
WHEN si.indid between 2 and 250 then 'NC ' + RIGHT('00' + convert(varchar, si.indid), 3)
ELSE 'Text/Image'
END AS [IndexType]
, si.[name] AS IndexName, si.indid
, CASE
WHEN si.indid BETWEEN 1 AND 250 AND STATS_DATE (si.[id], si.indid) < DATEADD(m, -1, getdate())
THEN '!! More than a month OLD !!'
WHEN si.indid BETWEEN 1 AND 250 AND STATS_DATE (si.[id], si.indid) < DATEADD(wk, -1, getdate())
THEN '! Within the past month !'
WHEN si.indid BETWEEN 1 AND 250 THEN 'Stats recent'
ELSE ''
END AS [Warning]
, STATS_DATE (si.[id], si.indid) AS [Last Stats Update]
FROM sysindexes AS si
WHERE OBJECTPROPERTY(id, 'IsUserTable') = 1
ORDER BY [TableName], si.[indid]
Friday, March 11, 2005
Batch Compilation, Recompilation, and Plan Caching Issues in SQL Server 2005
Wednesday, March 09, 2005
Tuesday, March 08, 2005
This is a nifty little tool that scripts your reports for deployment on other servers, it also generates a handy batchfile for the deployment.