Archive for October, 2008

c# :: prefix versus postfix increment

October 31, 2008 Posted Under: c#   Read More

I remember the pre and post incrementing function in C++ and Java but yesterday I got a bit of a refresher. So I’ve decided to put it on my blog in case other noobs out there is also looking for the answer. The screenshot pretty much explain it all.

finding foreign keys

October 30, 2008 Posted Under: sql   Read More

When you are attempting to drop an index on a table, you are given the following error: An explicit DROP INDEX is not allowed on index ‘db.tbl_name.index_name’. It is being used for UNIQUE KEY constraint enforcement. This normally means that the index on the table you are trying to modified is being referenced by another [...]

general network error

October 23, 2008 Posted Under: sql   Read More

The 16 new servers I am working on is getting a lot of these errors: [Microsoft][ODBC SQL Server Driver][DBNETLIB] General Network error. Check your network documentation ERROR [08S01] [Microsoft][SQL Native Client]Communication link failure System.Data.SqlClient.SqlException: A transport-level error has occurred when sending the request to the server. (provider: TCP Provider, error: 0 – An existing connection [...]

writing WHILE loop with 2 conditions

October 23, 2008 Posted Under: sql   Read More

Thru out the day, I was just hammering out WHILE loops left and right. Everything was going smoothly when looping thru using 1 condition. Cake walk. Then later in the day, I tried to throw in 2 conditions and disaster struck. The damn script never made it into the WHILE loop. It took me about [...]

semaphore timeout period has expired

October 21, 2008 Posted Under: sql   Read More

Yesterday, I was deploying some scripts to production. One of the script was to create a database and set its intial size to 50GB for data and log. It created the database alright on the local server but when it attempts to create it on remote servers, it failed with the following error message: Msg [...]

SQL 2008 Inserts

October 8, 2008 Posted Under: sql   Read More

Remember back in 2000 and 2005 or even older versions, when you were trying to insert multiple rows into a single table? Your code would look something like this insert into [table_name] (column_1, column_2) values (’1′,’2′) insert into (column_1, column_2) values (’3′,’4′) insert into (column_1, column_2) values (’5′,’6′) or insert into [table_name] (column_1, column_2) select [...]

Replication :: Check for Replication Errors

October 7, 2008 Posted Under: sql   Read More

Don’t you hate it when you are the last one to know about any type of replication error(s)? I mean, you are the bloody DBA for crying out loud. Shouldn’t you be on top of the game? The attached script will alert you when there are any errors in replication in the last 5 minutes. [...]

C# :: static void Main()

October 7, 2008 Posted Under: c#   Read More

As I’m reading my Essential C# 3.0 book, it was going over the null and void thing. I understand how null works because I use it a lot in SQL, but void is kind of new to me. Back in high school, I did some C++ stuff and managed to write a hangman program that [...]

Learning C#

October 6, 2008 Posted Under: general   Read More

So I’ve decided I want to learn some C# and write some hacks in order to take over the world!!! hahaha no. My noob skills in this arena wouldn’t even come close to making a dent. With SQL 2000 and 2005, all the documentation you’ll ever need is in the Book Online. After I installed [...]

Getting a percentage

October 3, 2008 Posted Under: sql   Read More

An annoying friend of mine and I was talking about percentage gain in stocks. I was damn good at math when I was in middle school but once I got to high school, I could care less. I take classes like Algebra, Geometry, Calculus and Trig. I passed them with either a ‘B’ or a [...]