November 2006 Blog Posts
Update: I've created a muliti connection version which can be found here.
Usually time measuring in sql server is done in 2 ways: with the help of GetDate() function or with SET STATISTICS TIME ON.
For doing hardcore performance analysis where any time reduction counts you need more precise measuring capabilities and the two mentioned are only accurate to a milisecond order.
In SQL Server 2000 there was no practical way to change this.
SQL server 2005 to the rescue. It has DMV's which hold time in microseconds which is better. but they can't be always used to measure the duration of the statement. You...
A coworker found this in code generated by Visual Studio 2005:
this.sqlSelectCommand2.CommandText = "SELECT columnName1, columnName2, columnName3, columnN" + "ame4, columnName5, columnName6 FROM MyViewFromMa" + "nyTables"
Searching for...
I've come accross a video recently that was tagged with VeoTAG.
I must say that IT IS AWSOME!
I can already see the uses in presentation videos.
No more searching for that 47th minute minute where there's something that you like...
or was that 34th minute?
maybe 58th minute?
74th?
ARGGGHHH....!!!!
Just click on a comment and you're there.
This is a very cool idea.
Since this blog is hosted i don't have access to it's source code. That means that i can't play with the source, can't add counters,
can't have anykind of statistics etc... All i can do is post a formatted post or article and have galleries.
Subtext colleccts statistics by showing you numbers for aggregated views and web views and it also has a refferals page that you can see who clicked you.
And I really wanted to have some statistics. I've looked into Google analytics when it came out and I still think it's awsome.
So i wondered how to put it in my blog....
Well SP2 CTP for SQL Server 2005 is here. Amongst all things new and fixed bugs there's one that i wanted to see if it's any good.
That is the vardecimal storage format.
My first thought and try was:
Create table t1(col1 vardecimal)
followed by
Create table t1(col1 vardecimal(18,12))
which both failed nicely with the following message:
Column, parameter, or variable #1: Cannot find data type vardecimal.
Ok then let's try google and MSDN. Both return exactly zero (at the time of writing) explenations of how to do this.
in the above link of new stuff this is said about vardecimal:
Added new functionality in the SQL Server...
I've seen a lot of confusion about the scope and lifetime of temporaray tables.
While i think that ##global temp tables are clear, #local temp tables are a different story.
They seen to sometimes work and sometimes not, especially when used with dynamic sql.
So what is the problem?
Mostly basic misunderstanding.
So because i'm such a nice guy, i'll try to elaborate a bit about "them darn #temps". :)
BOL clearly states:
Local temporary tables are visible only in the current session... ... Temporary tables are automatically dropped when they go out of scope, unless explicitly dropped using DROP TABLE So how is scope/session defined?
Scopes/Sessions...
here's a select. don't run it just look at it and think what it returns:
SELECT 123.654, 123d6, 123e4, '123'e4
ok now run it.
the results are:
(No column name)
d6
(No column name)
e4
...