SQL Server 2005 provides several ways to find the name of the machine or SQL Server instance where you are currently executing your queries. From SQL Server BOL, I have compiled them as follows (Descriptions are copied from SQL Server Books Online)
–Windows computer name on which the server instance is running.
–For a clustered [...]
Posted Under: Uncategorized
This post was written by
namwar on October 30, 2007
Comments (0)
Auditing tables in enterprise applications stores information about data modification. The best practise in my opinion is to store the relevant information in database my using special Business Layer Auditing functions which make sure that the auditing information is relevant to your business context instead of creating triggers for each table. Triggers put unnecessary load [...]
Posted Under: Uncategorized
This post was written by
namwar on October 29, 2007
Comments (0)
Version controlling of the database code in production environment is not an easy task. Maintaining multiple versions of the database schema, managing different sets of data in production and test environment always gives you hard time. Microsoft has started feeling the importance of this issue and introduced the Visual Studio 2005 Team Edition for database [...]
Posted Under: Uncategorized
This post was written by
namwar on October 25, 2007
Comments (0)
Cross Tab Query or Matrix query is one of the classical problem faced by nearly every SQL developer. There are many ways to approach this problem but each one of them has issues of performance or maintenance or both. This is because they are not native to SQL Server and you need to write complex [...]
Posted Under: Uncategorized
This post was written by
namwar on October 23, 2007
Comments (0)
Identity column provides you the way to define an auto incrementing ID column which can be later used as a primary key and saves you of writing your own code to generate unique values at every INSERT statement. So far so good, but what happens if I roll back my transaction? Will I be able [...]
Posted Under: Uncategorized
This post was written by
namwar on October 21, 2007
Comments (0)
PHP is one of the most popular programming languages for web applications. Mostly PHP applications use mySQL for their database needs. To compete mySQL in PHP market, Microsoft has announced the first Community Technology Preview of SQL Server 2005 driver for PHP. This driver provided the scalable and reliable API to communicate with SQL Server [...]
Posted Under: Uncategorized
This post was written by
namwar on October 21, 2007
Comments (0)
Sometimes we need to quickly copy a table along with its data and structure to another database. There are many ways to do it like using SQL Server Integration Service etc. but if you are looking for the quickest solution for once in a blue moon situation then you can use SELECT INTO statement in [...]
Posted Under: Uncategorized
This post was written by
namwar on October 18, 2007
Comments (2)
Although dynamic sql string is almost always prone to SQL Injection attacks but sometimes they are unavoidable. This is particularly in the case when middle tier dynamically creates where clause and send it to database (which is by the way not a good idea but it is there in the market). The problem with the [...]
Posted Under: Uncategorized
This post was written by
namwar on October 16, 2007
Comments (3)
SQL Server Management Studio provides many improvements over classic Enterprise Manager. One of these improvements is the Filter option for Object Explorer. Normally, when you expand a node of Object Explorer, it lists all objects of that type. For example, if you expand Tables node, you will get the list of all tables. If you [...]
Posted Under: Uncategorized
This post was written by
namwar on October 12, 2007
Comments (1)
Once a upon a time there was a person who applied for a position of software architect. He got the job interview call. During interview he was asked how many years of experience do you have in software industry? Applicant replied, slightly more than 5 years. Interviewer said “But your resume shows that you have [...]
Posted Under: Uncategorized
This post was written by
namwar on October 10, 2007
Comments (0)