February 2007 Blog Posts
I use Yahoo's mail service since 1996. But today i doscovered a new thing that made me laugh for half an hour.
You have to use their ajax-ifed beta version. Click Compose and start clicking on the subject button.
It auto generates the subject line.
Here are some examples:
- LipSmack heartAttack girlie girl in a pink sleep sack
- How to Comb Your Curly Hair
- Is your coffee table decaff?
- Your earrings would make a great fishing lure!
- Quote me as saying I was misquoted.
- RE: four and twenty blackbirds baked in a pie
- Thank god and Greyhound she's gone
- Scratch golfer finds ball...
Since i've started playing with SQL Server 2005 i've come accross a few things that i think are very cool.
I write them here so i don't forget about them :))
One of them is a Dedicated Administrator Connection (DAC)
This is a special diagnostic connection which is used by DBA's to troubleshoot a server when the server is refusing other connections
for whatever reason.
DAC can be created with SqlCmd utility or in SSMS with admin:instance_name.
Also only one DAC is allowed per instance.
Remote network access must be enabled with SQL Server Surface Area Configuration
I think this is a very handy and usefull novelty.
You can find more...
When doing apps that deals with date there almost always comes a question on
how to store an incomplete date.
For example:
Person A is born on 1980-02-17.
Person B is born on 1980-02 <- The person doesn't know the exact day (This is acctually a real life scenario)
How to store this wisely in db? You can't really put a datetime DateOfBirth Column.
I usually take 3 int columns (year, month, day) with constraints but i'm wondering...
Does anyone know of a better method?
I've seen this question pop up here, and i think it's usefull to post it here, since not every one reads the forums (you should! :)) We'll in this thread at the end of the first page there's a procedure on how to downgrade a db from SQL Server 2k5 to SQL server 2000. Enjoy it.
Ever missed a Prod(columnName) function that works like a sum but it multiplies the column values?
If you have then you probably know that there's a workaround using a bit of high school math knowledge about base 10 logarithms.
It goes like this:
SELECT exp(sum(log(c1))) as MultiplicationResult FROM test
However this little helper doesn't yield correct results for a large enough set, because it goes from integer to decimal.
So there's a possibilty of an error.
This is also a perfect example of a user defined aggregate that can be implemented in CLR. And becuase there's no int to deciaml transition
it yields correct results.
This...
if you don't know what nested trigers are read here.
Triggers are nested when a trigger performs an action that initiates another trigger.
So if you have 2 table where each has an after update trigger like:
CREATE TABLE trTest1
(
id INT,
NAME VARCHAR(50)
)
GO
INSERT INTO trTest1
SELECT 1, 'NAME 1' UNION ALL
SELECT 2, 'NAME 2' UNION ALL
SELECT 3, 'NAME 3' UNION ALL
SELECT 4, 'NAME 4'
GO
CREATE TABLE trTest2
(
id INT,
NAME VARCHAR(50)
)
GO
INSERT INTO trTest2
SELECT 1, 'NAME 1' UNION ALL
SELECT 2, 'NAME 2' UNION ALL
SELECT 3, 'NAME 3' UNION ALL
SELECT 4, 'NAME 4'
GO
CREATE TRIGGER trigTest1 ON trTest1 FOR UPDATE AS
UPDATE t2
SET id = i.id...