SQL Server security best practice

Security! This is the word comes in mind of every concerned person when it come...

Change the Collation Settings in MS SQL Server

This post will show you how to change the collation settings in MS SQL Server for specific database...

Resolve collation conflict

In this post I will show you how you can resolve collation conflict error...

Book: SQL Server 2008 High Availability

In this book I have tried to cover every single piece of information that might requires for installing and configuring SQL Server HA option like Clustering, Replication, Log Shipping and Database Mirroring...

Why to recompile Stored Procedure

Generally, we create views and stored procedures (proc here after) ...

10/26/2007

Some Tips for Merge Replication

* SQLAgent service should run under same domain account, which has local admin privilege and “Log in as a service” permission. This requires on both the server. In case, if SQL Server is not part of any Domain. We can use the user account which has identical name and password at servers i.e. ReplUser on SRVA with password ReplUser! and identically ReplUser on SRVB with password ReplUser!
* User account that is used to run the SQLAgent services have to have sysadmin privilege on both server, and it should be added in to db_owner fixed db role for database which is being replicated/replicating.
* Should include all the tables which are referenced, this will help to keep data consistency.
* If there are text/image column we need to update those column explicitly Updatetext statement. http://msdn2.microsoft.com/en-us/library/aa260658(SQL.80).aspx
* Try to avoid using Identity column as PK but if it is already implemented modify the property of Identity column as ‘Not for Replication’.
* Define both server (Publisher and Subscriber) as remote server at each other.
* Allocate adequate space for distribution, subscription and publication db.
* Avoid using Identity column as PK but if it is already implemented modify the property of Identity column as ‘Not for Replication’.
* Rowguid column is must, which also can be added at the time of configuring Merge replication.
* sp_dropmergearticle can be used to drop article from publication.
* sp_addmergearticle can be used to add article to publication.
Below are some links that will be usefull for replication troubleshooting, they are:
Troubleshooting Merge Replication http://support.microsoft.com/kb/315521 and
Managing Identity values in Replication environment http://msdn2.microsoft.com/en-us/library/aa237098(SQL.80).aspx
Violation of Primary Key (PK) Constraint http://support.microsoft.com/kb/813494

Merge agent incorrectly deletes rows after PK violation error
Adding and Droping an article in existing publication http://msdn2.microsoft.com/en-us/library/ms152493.aspx
Working with BLOB data in Replciation http://technet.microsoft.com/en-us/library/ms151206.aspx

10/05/2007

Estimating the size of Table

Many time it happens we were wrong with the Estimation of Table Size, wrong estimation of Row Size can trouble us with the growth of the database and ultimately we are ending up with the space crunch, and all this because of wrong Estimation of Table Size. So what we should consider the most with Estimating Table Sizing!!! Nullbitmap is the most important criteria here to take into consideration whenever you do a Estimation of Row Size, here is an excellent article on Row Size Estimation http://msdn2.microsoft.com/en-us/library/aa933068(SQL.80).aspx and http://msdn.microsoft.com/en-us/library/ms175991.aspx

9/27/2007

Tuning Stored Procedure

Most of the time I come accross the thread wherein user has requested to get started with stored procedure performance tuning , so here are some good reference material for tuning stored procedure and optimize stored procedure for performance
http://www.sql-server-performance.com/tips/stored_procedures_p1.aspx, http://www.sqlservercentral.com/articles/Performance+Tuning+and+Scaling/performancetuningstoredprocedures/2505/ and http://searchsqlserver.techtarget.com/generic/0,295582,sid87_gci1247499,00.html

9/10/2007

Automate Profiler Trace

The question I recently come accorss on SQL Server Performance, the OP was asking on "How to automate profiler trace" , their are system stroed procedure that can be used to automate profiler trace. The system stored procedure you can use are sp_trace_create,sp_trace_generateevent,sp_trace_setevent,sp_trace_setfilter and sp_trace_setstatus. Here is complete procedure described on "How to automate profiler trace" , refer http://vyaskn.tripod.com/server_side_tracing_in_sql_server.htm

Here is a link on "How to monitor trace on SQL Server 2005" http://support.microsoft.com/kb/912914/en-us

9/06/2007

New KB articles are added for SQL Server 2005

New Knowledge Base articles are added for SQL Server 2005, Here are the links

FIX: The performance of a query that performs an insert operation or an update operation is much slower in SQL Server 2005 SP2 than in earlier versions of SQL Server 2005

FIX: You receive an incorrect result when you use a SQL Native Client provider to read the data on the client computer in SQL Server 2005

How to enable the SQL Server 2005 Integration Services process to generate a dump file when the process experiences exceptions

FIX: Error message when you run a query that selects many columns and that joins many tables in SQL Server 2005 Service Pack 2: "The query processor could not produce a query plan"

FIX: An application that is included in SQL Server 2005 may stop responding when you specify a network protocol that is not valid in the application

FIX: Error message when you use Database Engine Tuning Advisor to tune a database in SQL Server 2005 Service Pack 2: "An unhandled win32 exception occurred in dtaengine90.exe [4308]"


FIX: Error message when you use the Bcp.exe utility together with the queryout option in Microsoft SQL Server 2005: “BCP host-files must contain at least one column”

Some or all SQL Server 2005 services are not listed in SQL Server Configuration Manager, or you receive a "No SQL Server 2005 components were found" error message when you perform operations in SQL Server 2005 Surface Area Configuration

Error message when you run a distributed query against a loopback linked server in SQL Server 2005: "Transaction context in use by another session" or "MS DTC has cancelled the distributed transaction"

You cannot upgrade the named instance of SQL Server 2000 Desktop Engine Service Pack 3a that is installed together with Application Center 2000 Service Pack 2 to SQL Server 2000 SP4

Renaming SQL Server that hosts Reporting Server

Sometimes business demands or change in naming convention for servers lead to situation where one should change / rename the Server running MS SQL Server, it would not that panic renaming SQL Server as you have sp_dropserver and sp_addserver to help you, but what if this SQL Server box have reporting server too; well microsoft has workaround for it refer - http://technet.microsoft.com/en-us/library/ms345235.aspx

9/05/2007

Devcon2007 - A great Success

Hi All,

I am too glad... DevCon 2007 organized pune has great success, over 1100 attendes was recorded for this event. I thought this would the highest number of audiance till date , it includs IT professionals and students.
Special thanks to all energetic members and volunteers of Pune User Group members and MSP(s) who has played key role in this success.

8/20/2007

8/17/2007

DevCon - 2007 Organized by Pune User Group

Pune User Group has organized an event “DevCon “ in the month of August, the details and for Entry passes check your nearest location on website

http://devcon.puneusergroup.org/

8/14/2007

Download System View Map for MS SQL Server 2005

Download the System View map for SQL Server 2005, this would definately helpfull to DBA(s).
http://download.microsoft.com/download/0/d/f/0dfe488e-a335-4480-8a8a-b405e32f4368/SQL2005_Sys_Views.pdf

Webcast on Reading Execution Plan and Query Tuning

http://www.microsoft.com/india/webcasts/default.aspx

Aug - 28th ; 14:00 - 15:30 IST

SQL Server 2005: Reading Execution Plans
The toughest part of analysis of any query is reading the execution plans. Many see this as the most difficult part, but this webcast removes this myth. We will walk you through the various operators and what they mean in the actual reading of the execution plan. There are some small changes made between SQL Server 2000 to SQL Server 2005 and we will take a quick at the same too.

Speaker: Vinod Kumar

Aug - 28th ; 14:00 - 15:30 IST

SQL Server 2005: Query Tuning
As part of application development everyone is faced with the need to tune their applications query. One aspect will be reading execution plans, but there are tons of other parameters that need attention to start the tuning exercise. This webcast takes a look at those parameters and the various tools and the tuning parameters we need to use with SQL Server 2005.

Speaker: Vinod Kumar

7/30/2007

hotfix or SP stops unexpectedly on SQL Server 2005

SQL Server 2005 Cluster which has many instances or contain many nodes may gives you error while upgrading it with hotfix or service pack; the simple procedure to update hotfix and sp has been given by Microsoft, read more on KB 936488

Failed to connecto to SSIS

Sometimes we receive "SSMS failed to connect to SSIS on client machine", Microsoft has released KB 940232 for the workaround

Timeout occured while running dbcc freeproccache/alter database/sp_configure/sp_detace_db

Some of us might have face timeout when we run DBCC FREEPROCCACHE, Alter Database, Restore Database, SP_configure or sp_detach_db ; Microsoft has released KB 925419 which has workaround for the problem.

7/16/2007

Disaster Recovery Articles on MS SQL Server

Here are some good Disaster Recovery articles on MS SQL Server
http://support.microsoft.com/kb/307775