For those who are interested in SQL Server 2008 Certification, download the pdf from the below link. This reference pdf is self explanatory and gives the complete list of certifications that needs to be completed by an individual to gain MCTS and MCITP in SQL Server 2008 from Microsoft.
Microsoft SQL Server 2008 Certification Paths
Saturday, September 25, 2010
Monday, September 13, 2010
Schema Changes History Report in SQL Server 2008
In one of my previous posts "Find out who has changed what" I had explained how to find out who has changed what in SQL server when the trace is enabled.
In SQL Server 2008, the Default trace is enabled by default during the installation and this default trace in SQL Server 2008 acts as a Blackbox for the SQL Server. Hence it is also called as "Black Box" in SQL Server 2008 and the default trace cannot be stopped by using the Query "Exec sp_trace_setstatus 'Trace_id',0 --0 stops the trace " . This has to be stopped using the sp_configure.
To Use this report, Just right Click on the database and choose the option "Reports" and Select "Standard Reports" and choose "Schema Changes History".

To Test this, I executed the below query on AdventureWorks Database. I have also included the Statements "Waitfor Delay" to know the Time Difference.
Drop table Tbl_TestSchemaChangesHistoryReport
And here is the results.

In SQL Server 2008, the Default trace is enabled by default during the installation and this default trace in SQL Server 2008 acts as a Blackbox for the SQL Server. Hence it is also called as "Black Box" in SQL Server 2008 and the default trace cannot be stopped by using the Query "Exec sp_trace_setstatus 'Trace_id',0 --0 stops the trace " . This has to be stopped using the sp_configure.
To Use this report, Just right Click on the database and choose the option "Reports" and Select "Standard Reports" and choose "Schema Changes History".

To Test this, I executed the below query on AdventureWorks Database. I have also included the Statements "Waitfor Delay" to know the Time Difference.
Use AdventureWorks
Go
Create Table Tbl_TestSchemaChangesHistoryReport
( Id int,
Name Varchar(50))
Waitfor Delay '00:01:00' -- to know the time difference
Alter table Tbl_TestSchemaChangesHistoryReport Add Address_Column varchar(100)
Waitfor Delay '00:01:00' -- to know the time difference
And here is the results.
Labels:
MSSQL,
SQL Information,
SQL Queries,
SQL Server 2008,
Troubleshooting
Friday, August 13, 2010
Run a multi server Query in SQL server 2008 without using CMS
Hey guys, here is a way which you can use to run the same query on multiple servers without using CMS (Central Management Server).

And here are the results
In this article I will be showing how to run a multi server query without using CMS in SQL server 2008.
This is very simple.
Open the SQL Server 2008 SSMS (SQL Server Management Studio) and register the servers.
Right-Click on the registered Server Group and select “New Query”.

On the newly opened query window, run the below command
Select SERVERPROPERTY('ProductVersion') AS 'Version',
SERVERPROPERTY('ProductLevel') AS 'Level',
SERVERPROPERTY('Edition') AS 'Edition'

This article is also available in pdf format for downloading.
Please Click here to get your copy now.
Please Click here to get your copy now.
Labels:
MSSQL,
SQL Information,
SQL Server 2008,
Undocumented,
What's New
Saturday, August 7, 2010
Changing the color of the Status bar in SQL Server 2008 Management Studio
Hey Guys are you bored of seeing the same color on the status bar each time you open the New Query window in your SQL Server 2008 Management Studio?
Here is the way how you can change the color of the status bar. This can be done for each server or for each window.
For Each Server:
Click on “Connect” on select “Database Engine”








Here is the way how you can change the color of the status bar. This can be done for each server or for each window.
For Each Server:
Click on “Connect” on select “Database Engine”
Click on Options
And click on the check box “Use Custom Color:” and press “Select”
Now Click “OK” and then “Connect”.
Now right click on the server and choose “New Query” and notice the Status bar of the New Query Window, it will show the Color you choose in the previous step.
For Each Window:
Click on “File”, expand “New” and choose “Database Engine Query” and follow the same steps as above.
Labels:
MSSQL,
SQL Information,
SQL Server 2008,
What's New
Covering Index or Index with Included Columns
Covering Index or Index with included Columns is a new functionality which is introduced in SQL Server 2005 onwards and is an extension to Non-Clustered Indexes.
This is because the non-key columns have the following benefits:
- They can be data types that are not allowed as index key columns.
- They are not considered by the Database Engine when calculating the number of index key columns or index key size.
So creating Covering Indexes can significantly improve the query performance because all the columns in the query are included in the index itself, either as key or nonkey columns. And only the index pages and not the data pages will be used in retrieving the data.
Covering indexes can bring in a lot of performance to the query, because it can save a huge amount of I/O operations.
How to Create a Covering Index:
Using T-SQL:
/*This query will create a non-clustered index by name IX_Address_PostalCode
on PostalCode Column and includes the non-key columns AddressLine1,
AddressLine2, City, StateProvince */
USE AdventureWorks;
GO
CREATE NONCLUSTERED INDEX IX_Address_PostalCode
ON SalesLT.Address (PostalCode)
INCLUDE (AddressLine1, AddressLine2, City, StateProvince);
GO
/* And the below Query will be covered by the index and gives more performance */
SELECT AddressLine1, AddressLine2, City, StateProvince, PostalCode
FROM SalesLT.Address
WHERE PostalCode BETWEEN '85000' and '90000';
GO
Using GUI:




This article is also available in pdf format for downloading.
Subscribe to:
Posts (Atom)