This white paper covers some of the operational and administrative tasks associated with SQL Server 2005 security and enumerates best practices and operational and administrative tasks that will result in a more secure SQL Server system.
SQL SERVER – DBCC command to RESEED Table Identity Value – Reset Table Identity
DBCC CHECKIDENT can reseed (reset) the identity value of the table. For example, YourTable has 25 rows with 25 as last identity. If we want next record to have identity as 35 we need to run following T SQL script in Query Analyzer. DBCC CHECKIDENT (yourtable, reseed, 34) If table…
Read MoreSQL SERVER – Union vs. Union All – Which is better for performance?
This article is completely re-written with better example SQL SERVER – Difference Between Union vs. Union All – Optimal Performance Comparison. I suggest all of my readers to go here for update article. UNION The UNION command is used to select related information from two tables, much like the JOIN…
Read MoreSQL SERVER – Download 2005 SP2a
Microsoft released an updated SQL Server 2005 SP2 on March 5th, 2007. The build number is 9.00.3042.01. The previous build number was 9.00.3042.00.Microsoft released a SP2a patch for the second service pack for SQL Server 2005 to fix the issues with the maintenance plans.If you have upgraded to SP2, use…
Read MoreSQL SERVER – Script to Determine Which Version of SQL Server 2000-2005 is Running
To determine which version of SQL Server 2000/2005 is running, connect to SQL Server 2000/2005 by using Query Analyzer, and then run the following code: SELECT SERVERPROPERTY('productversion'), SERVERPROPERTY ('productlevel'), SERVERPROPERTY ('edition') The results are: The product version (for example, 8.00.534). The product level (for example, “RTM” or “SP2”). The edition…
Read MoreSQL SERVER – QUOTED_IDENTIFIER ON/OFF and ANSI_NULL ON/OFF Explanation
When create or alter SQL object like Stored Procedure, User Defined Function in Query Analyzer, it is created with following SQL commands prefixed and suffixed. What are these – QUOTED_IDENTIFIER ON/OFF and ANSI_NULL ON/OFF? SET QUOTED_IDENTIFIER ON GO SET ANSI_NULLS ON GO--SQL PROCEDURE, SQL FUNCTIONS, SQL OBJECTGO SET QUOTED_IDENTIFIER OFF…
Read MoreSQL SERVER – Delete Duplicate Records – Rows
Following code is useful to delete duplicate records. The table must have identity column, which will be used to identify the duplicate records. Table in example is has ID as Identity Column and Columns which have duplicate data are DuplicateColumn1, DuplicateColumn2 and DuplicateColumn3. DELETE FROM MyTable WHERE ID NOT IN…
Read MoreSQL SERVER – T-SQL Script to find the CD key from Registry
Here is the way to find SQL Server CD key, which was used to install it on machine. If user do not have permission on the SP, please login using SA username. Expended stored procedure xp_regread can read any registry values. I have used this XP to read CD_KEY. This…
Read More