January 2007 Blog Posts
If you're reading this blog you're probably familiar with ADO.Net and it's SqlCommand object.
Now this SqlCommand object has a CommandTimeout property that specifies the number of seconds
after which the command will terminate. The default value is 30.
Now we get to the SqlConnection and the connection string. in the connection string you can specify
Connection Timeout = numberOfSeconds
after which the connection timeouts.
We also have to set the SqlConnection object to the SqlCommand.Connection property.
Nothing special so far.
Now my question is:
If we set the Connection Timeout in our connection string to higher value than the SqlCommand.CommandTimeout's is,
WHY DOESN'T the SqlCommand.CommandTimeout get set to that higher...
A derivative is walking down the street and sees a hot function.
So he grabs her, takes her into the bushes and differentiates her once.
Little later he sees another function and differentiates her twice.
He goes on an sees this super hot function. really sexy.
So he grabs her and differentiates her once and nothing, differentiates her second time, still nothing.
After 10 unsuccessfull differentiations he gets tired and asks the function:
"How come i can't differentiate you???!???"
And the function answers:
"HA!! That because i'm ex !!!"
and beats the crap out the derivative.
I recently wanted to create a stored procedure that would be only in master database and get some information_schema stuff for the current database.
One requirement is that the sproc has s "sp_" prefix. I also thought that it's the only requirement. I was wrong not for the first nor the last time.
The sproc would always return me information schema data belonging to the master db.
The second thing you have to do is mark the sproc a system object.
In Sql Server 2000 we have to set the system marking to on with master.dbo.sp_MS_upd_sysobj_category
In Sql Server 2005 we have the sys.sp_MS_marksystemobject...
Enums are a great tool. They give meaning to meaningless numbers. I love using them as flags since it couldn't be simpler. So i always used the [Flags] attribute on my enums But why do we need that attribute? You can bitwise non [Flags]'d enums just the same. The difference lies in the Enum.ToString() method. If your enum has the [Flags] attribute set then the ToString() will return a CSV separated list of bitwised enum values. If there's no [Flags] attribute ToString() will return a number for every bitwised value. As always it's best ilustrated with an example:[Flags]
A SELECT tag is what a DropDowList in Asp.Net renders to in HTML and it's a standard web control. If you ever had to pop up a DIV over it (a menu in most cases) then you know that in IE6 and below and FireFox 1.x the select tag showed over the div tag. This was/is annoying as hell. There was a hack for this by putting an IFrame into a DIV but this introduced problems with linking etc... Now FINALLY this is fixed in IE7 and FireFox 2.x. I'm glad! Aren't you? :)
This document is a must read for any serious network admin and i do dare to say also for a DBA.
.Net developers are welcome to read it since it is usefull.
A few excerpts:
(1) It Has To Work.
(3) With sufficient thrust, pigs fly just fine. However, this is not necessarily a good idea. It is hard to be sure where they are going to land, and it
could be dangerous sitting under them as they fly overhead.
(4) Some things in life can never be fully appreciated nor understood unless experienced firsthand. Some things in networking can never be fully...