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) ...

3/19/2009

How to know version of MS SQL Server

"How to check which version of SQL Server I am on" this is a commonly asked question in SQL Server community; I have created a script which can be run in MS SQL Server 2000 and MS SQL Server 2005 you may download script from here
read complete FAQ on it here

3/09/2009

Community launched | Surat SQL Server User Group | DotNetChaps

Hi,

We have formed a Technical Community User Group. The aim of this User Group is to share/exchange what all we have in terms of the knowledge.

We have two separate forums for MS SQL and for Dot Net technology to avoid confusion. You may post all your queries pertaining to MS SQL at http://www.surat-user-group.org and if you are having a query in .Net (be it asp .net, c# or vb .net) please post it to http://tech.groups.yahoo.com/group/DotNetChaps/

http://www.surat-user-group.org is having an association with SQLPASS (http://www.sqlpass.org) and is an official SQLPASS Chapter.

http://tech.groups.yahoo.com/group/DotNetChaps/ is having an association with iNETA.

2/11/2009

MS has released KB960082 and KB960089 for MS SQL Server 2000 and MS SQL 2005

MS has released one Vulnerability bulletin found for MS SQL Server

This is applicable to below products

SQL Server 2000 SP4 (All edition) --> (KB960082)
SQL Server 2000 Itanium-based Edition Service Pack 4 --> (KB960082)
Microsoft SQL Server 2000 Desktop Engine (MSDE 2000) Service Pack 4 --> (KB960082)

SQL Server 2005 SP2 --> (KB960089)
SQL Server 2005 x64 Edition Service Pack 2 --> (KB960089)
SQL Server 2005 with SP2 for Itanium-based Systems -->(KB960089)

SQL Server 2005 Express Edition Service Pack 2 --> (KB960089)
SQL Server 2005 Express Edition with Advanced Services Service Pack 2 --> (KB960089)

Patches are available at http://www.microsoft.com/technet/security/Bulletin/MS09-004.mspx

1/19/2009

Microsoft Virtual Techdays

It would be a good time again.... Microsoft Virtual Techday (VTD) is back; below is an agenda
http://www.virtualtechdays.com/agendaday1.aspx

Get registered!!

1/09/2009

PUG Community Day 10 Jan 09

From 6:00 to 7:30 PM @ Nalanda,SEED Infotech Ltd
: Topic :
NAP with Windows Server 2008
: Speaker :
Abhishek Pradhan - Information Security(SIR Specialist)
Currenly working with Symmentec India,he have around 5 yrs of expertise on various Server Technologies and on Microsoft domain
Free event for all..
Some Landmark for Venue :
Near Mehendale Garage,Near Karnataka High School,Near Yugay Mangal Karyalaya,Near Gandhi Lawns[One near City Pride Kothrud]
Venue by : SEED Infotech Ltd.

1/08/2009

DBCC Checkdb gives error when you restoring database with CONTINUE_AFTER_ERROR

DBCC Checkdb gives error when you have finished restoring database with CONTINUE_AFTER_ERROR and you run DBCC CHECKDB. This will gives you an Error 8967 there may be inconsistancies in database or metadata which may lead to throw this error message....there is a workaround released by Microsoft Read workaround for Error 8967

1/06/2009

Why rollback is taking much longer time

Have you ever thought what is a reason that makes Rollback time consuming process?
Whenever you kill some spid or rollback transaction it would take 3 or 4 times more time then it has taken to execute that particular batch/transaction!!!! The reason is that the Rollback is single threaded and hence it most likely to take much longer time read complete article here

How T-SQL Kill Command works for MS SQL Server

Often I've seen a question wherein user has posted a query that what is kill command is doing in background? What is sleeping session status in sp_who2 output ? What is awaiting session status in sp_who2 output?
Awaiting or sleeping session status is a connection waiting for query from client, i.e. you've logged in using the application and you are yet to open and run a report, so this idle time is showing as a awaiting or sleeping session
You can find some more insight on How T-SQL Kill Command works!! and What is Awaiting/Sleeping status!!

DBCC Shrinkfile and DBCC Shrinkdb is taking more time

DBCC Shrinkfile and DBCC Shrinkdb would likely to take more time for SQL Server 2005 then it would take for SQL Server 2000. The question is why it is so!!! I was reading through some articles and find a wonderfull explaination on this, there is additional logic added to compact text/image (LOB datatypes) in SQL Server 2005 and hence it is taking some more time....Read complete article here

Enjoy reading....

1/05/2009

SQL Server 2005 SP3 is available for download

Microsoft has released SP3 for SQL Server 2005 and it is available for download. There are many things that were fixed and added to SQL Server 2005 SP3 below are the links

Find out what is new SQL Server 2005 SP3 http://technet.microsoft.com/en-us/library/dd353312(SQL.90).aspx
List of bugs that were fixed in SP3 are listed here http://support.microsoft.com/?id=955706

Download SQL Server 2005 SP3 here http://www.microsoft.com/downloads/details.aspx?FamilyID=ae7387c3-348c-4faa-8ae5-949fdfbe59c4&displaylang=en

Backup, Restoring and Disaster Recovery

Hi All,

Here is an excellent piece of information on Backup,Restoration and Disaster Recovery with the suggestion and related source of information.
http://www.microsoft.com/technet/prodtechnol/sql/2000/maintain/sqlbackuprest.mspx

Happy reading.

How to create partitioned table and index in SQL Server 2005

I have found good article on how to create partitioned table and index in SQL Server 2005 here is the link of the article http://msdn.microsoft.com/en-us/library/ms345146.aspx

hope this would helps

9/29/2008

What is Stored Procedure and How to write Stored Procedure

Stored Procedure (SP, here after I will refer it as SP) is as its name indicates stored in a database . SP contains one or more then single T-SQL in it, and it is re-usable. The beauty or advantage of SP is, it will get complied and stored in Database, now when ever you required to run the T-SQL or bunch of T-SQL you don't need to write it and compile it again, just call that Stored Procedure(SP).
Whereas in case of individual T-SQL it will get complied every time you run them; so it helps to reduce your time writing T-SQL, it saves CPU and I/O times it would take to compile and to create execution plan.

There are some advantages of using SPs, they are:
1. You do not need to rewrite your T-SQL which you would required to run often
2. It will get complied and stored in DB, and this will helps you saving your CPU & I/O cycle. * In case if some modification is done in SP you would required to re-compile it.
3. Can accept parameter as input value and will return output based on it
4. You can call one SP in another
5. You can have security configured for them, i.e. can grant or deny exeecute permission for particular user/role/group
6. SP which has parameters can help you protect from SQL Injection Attack
7. SP will help you reduce your network round-trip and hence network traffic

Here are some basic instruction and input on how to write SP(s).
http://www.sql-server-performance.com/articles/dba/stored_procedures_basics_p1.aspx http://www.sql-server-performance.com/articles/dev/create_stored_procedures_tsql_p1.aspx

9/25/2008

should I shrink my database

I have come across to the post "should I shrink my database" many times, this is certainly not recommended unless it is required. When we have ample space on the hard drive let it be in the size it is.

Because what happens is when you shrink it and as time passes by it would required to grow again and this time it again involves your CPU and I/O cycle which would be costly affair; again, herealso there may be counter arguments too but this is what certainly not recommended on other hand it *depneds* on case to case bases.

What we should really do is to investigate the reasons, why it has grown that big (if you feel so) for example
1. Auto growth option,
2. Activities like BCP/Bulk insert,
3. Reindex,
4. defregment of database

Please refer Tibor Karsazi's article here on the same topic http://www.karaszi.com/SQLServer/info_dont_shrink.asp

Hope this would helps.

9/22/2008

New KB Articles on SQL Server 2005 and SQL Server 2008

Here are link of new KB Articles released on SQL Server 2005 and SQL Server 2008
List of Builds that are released after SQL Server 2005 SP2
http://support.microsoft.com/kb/937137/
List of Builds that are released after SQL Server 2008
http://support.microsoft.com/kb/956909/

FIX: When you query through a view that uses the ORDER BY clause in SQL Server 2008, the result is still returned in random order http://support.microsoft.com/kb/926292

Distribution Agent do not skip error 20598 SQL Server 2008 http://support.microsoft.com/kb/956376

The syntax for '' is incorrect in SQL Server 2005 Analysis Services http://support.microsoft.com/kb/956039