Archive for the ‘SQL Server 2008’ Category

How to check the SQL Server Version

You can check the sql server version by using the SERVERPROPERTY function.

Exampe:

SELECT
SERVERPROPERTY(‘ProductVersion’) AS ProductVersion,
SERVERPROPERTY(‘ProductLevel’) AS ProductLevel,
SERVERPROPERTY(‘Edition’) AS Edition,
SERVERPROPERTY(‘EngineEdition’) AS EngineEdition;
GO

Read More…

, ,

No Comments


Difference between Clustered and Non-Clustered Index
  • Clustered Index
    1. A clustered index is a special type of index that reorders the way records in the table are physically stored.
    2. Therefore table can have only one clustered index. The leaf nodes of a clustered index contain the data pages.
  • Non-Clustered Index
    1. A nonclustered index is a special type of index in which the logical order of the index does not match the physical stored order of the rows on disk.
    2. The leaf node of a nonclustered index does not consist of the data pages. Instead, the leaf nodes contain index rows.

source

, , , ,

No Comments


Rebuild Index Script for SQL Server

DECLARE @tblName VARCHAR(50)

DECLARE rs CURSOR FOR
SELECT TABLE_NAME FROM information_schema.tables WHERE [TABLE_TYPE] =N’BASE TABLE’

OPEN rs
FETCH NEXT FROM rs INTO @tblName

WHILE @@FETCH_STATUS = 0
BEGIN
DBCC DBREINDEX( @tblName,”,90)
END

CLOSE rs
DEALLOCATE rs

, ,

No Comments


Saving Changes Not Permitted.

Refer to this article

No Comments



SetPageWidth