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.
