Pages

Thursday, August 22, 2013

SQL SERVER – ReIndexing Database Tables and Update Statistics on Tables | Journey to SQL Authority with Pinal Dave

SQL SERVER 2005 uses ALTER INDEX syntax to reindex database. SQL SERVER 2005 supports DBREINDEX but it will be deprecated in future versions. When any data modification operations (INSERT, UPDATE, or DELETE statements) table fragmentation can occur. DBCC DBREINDEX statement can be used to rebuild all the indexes on all the tables in database. DBCC… Continue Reading...

Source: SQL SERVER – ReIndexing Database Tables and Update Statistics on Tables | Journey to SQL Authority with Pinal Dave

SQL SERVER – UDF – Function to Convert Text String to Title Case – Proper Case | Journey to SQL Authority with Pinal Dave

Following function will convert any string to Title Case. I have this function for long time. I do not remember that if I wrote it myself or I modified from original source. Run Following T-SQL statement in query analyzer: SELECT dbo.udf_TitleCase('This function will convert this string to title case!') The output will be displayed in… Continue Reading...

Source: SQL SERVER – UDF – Function to Convert Text String to Title Case – Proper Case | Journey to SQL Authority with Pinal Dave

SQL SERVER – Primary Key Constraints and Unique Key Constraints | Journey to SQL Authority with Pinal Dave

Primary Key: Primary Key enforces uniqueness of the column on which they are defined. Primary Key creates a clustered index on the column. Primary Key does not allow Nulls. Create table with Primary Key: CREATE TABLE Authors ( AuthorID INT NOT NULL PRIMARY KEY, Name VARCHAR(100) NOT NULL ) GO Alter table with Primary Key:… Continue Reading...

Source: SQL SERVER – Primary Key Constraints and Unique Key Constraints | Journey to SQL Authority with Pinal Dave

SQL SERVER – Function to Convert List to Table | Journey to SQL Authority with Pinal Dave

Update : (5/5/2007) I have updated the UDF to support SQL SERVER 2005. Visit :SQL SERVER - UDF - Function to Convert List to Table Reference : Pinal Dave (http://blog.SQLAuthority.com) Continue Reading...

Source: SQL SERVER – Function to Convert List to Table | Journey to SQL Authority with Pinal Dave

SQL SERVER – FIX : Error 15023: User already exists in current database. | Journey to SQL Authority with Pinal Dave

Error 15023: User already exists in current database. 1) This is the best Solution. First of all run following T-SQL Query in Query Analyzer. This will return all the existing users in database in result pan. USE YourDB GO EXEC sp_change_users_login 'Report' GO Run following T-SQL Query in Query Analyzer to associate login with the… Continue Reading...

Source: SQL SERVER – FIX : Error 15023: User already exists in current database. | Journey to SQL Authority with Pinal Dave

SQL SERVER – Creating Comma Separate List From Table | Journey to SQL Authority with Pinal Dave

Update : (5/5/2007) I have updated the script to support SQL SERVER 2005. Visit :SQL SERVER - Creating Comma Separate Values List from Table - UDF - SP Reference : Pinal Dave (http://blog.SQLAuthority.com) Continue Reading...

Source: SQL SERVER – Creating Comma Separate List From Table | Journey to SQL Authority with Pinal Dave

SQL SERVER – SQL Server 2005 Samples and Sample Databases (February 2007) | Journey to SQL Authority with Pinal Dave

The samples download provides over 100 samples for SQL Server 2005, demonstrating the following components: Database Engine, including administration, data access, Full-Text Search, Common Language Runtime (CLR) integration, Server Management Objects (SMO), Service Broker, and XML Analysis Services Integration Services Notification Services Reporting Services Replication The samples databases downloads include the AdventureWorks sample online transaction… Continue Reading...

Source: SQL SERVER – SQL Server 2005 Samples and Sample Databases (February 2007) | Journey to SQL Authority with Pinal Dave