Feed on
Posts
Comments

Archive for the ‘Best Practices’ Category

The RML utilities allow you to process SQL Server trace files and view reports showing how SQL Server is performing. For example, you can quickly see:
Which application, database or login is using the most resources, and which queries are responsible for that
Whether there were any plan changes for a batch during the time when the [...]

Read Full Post »

SQL Server stores history of all the taken backup forever. History of all the backup is stored in msdb database. Many times older history is no more required. Following Stored Procedure can be executed with parameter which takes days of history to keep. In following example 30 is passed to keep history of month.
USE msdb
GO
DECLARE [...]

Read Full Post »

Today we will see quick script which will check integrity of all the database of SQL Server.
EXEC sp_msforeachdb ‘DBCC CHECKDB(”?”)’
Above script will return you lots of messages in resultset. If there are any errors in resultset they will be displayed in red text. If everything is black text there is no error. Typical output of [...]

Read Full Post »

I just received following screen shot from one of the regular reader of SQLAuthority.com blog. He pointed out important milestone for our blog. We have crossed 5 millions visitors. In less than 2 years SQLAuthority.com blog has been visited by 5 millions visitors. I even missed the anniversary our blog. On November 1st 2008 SQLAuthority.com [...]

Read Full Post »

Quite often it happens that SQL Server Management Studio’s Dropdown box is cluttered with many different SQL Server’s name. Sometime it contains the name of the server which does not exist or developer does not have access to it. It is very easy to clean the list and start over.

Delete mru.dat file from following location.
For [...]

Read Full Post »

Just a day ago, while I was enjoying mini vacation during festival of Diwali I met one of the .NET developer who is big fan of Oracle. While discussing he suggested that he wished SQL Server should have feature where multiple variable can be declared in one statement. I requested him to not judge wonderful [...]

Read Full Post »

SQLAuthority Wishes Happy Diwali to All of You

Read Full Post »

Recently I have got many many request for SQL Server Interview Questions and Answers as well related articles. It seems many people are looking for Job or appearing for interview at this time of the year. I have included list of the my top downloads in side bar of the blog, still I receive many [...]

Read Full Post »

Hyper-V in Windows Server 2008 is a powerful virtualization technology that can be used by corporate IT to consolidate under-utilized servers, lowering TCO and maintaining or improving Quality of Service. Through a series of test scenarios that are representative of SQL Server application fundamentals, this document provides best practice recommendations on running SQL Server in [...]

Read Full Post »

A year ago I wrote post about SQL SERVER - Retrieve - Select Only Date Part From DateTime - Best Practice where I have discussed two different methods of getting datepart from datetime.
Method 1:
SELECT DATEADD(D, 0, DATEDIFF(D, 0, GETDATE()))
Method 2:
SELECT CONVERT(VARCHAR(10),GETDATE(),111)
I have summarized my post suggesting that either method works fine and I prefer to [...]

Read Full Post »

It has been long time since I wrote about SQL Humor. Following is the cartoon sent to me by many (more than 10 times) so far by many users. I did not publish it till now as it has been quite popular and I believed many people has already seen it. However, recently by one [...]

Read Full Post »

Very frequently I have been asked to create a page, post or article where in one page all the important concepts of SQL Server are covered. SQL Server 2008 is very large subject and can not be even covered 1000 of pages. In daily life of DBA there are few commands very frequently used and [...]

Read Full Post »

SQL SERVER - Guidelines and Coding Standards complete List Download
Coding standards and guidelines are very important for any developer on the path of successful career. A coding standard is a set of guidelines, rules and regulations on how to write code. Coding standards should be flexible enough or should take care of the situation where [...]

Read Full Post »

To express apostrophe within a string, nest single quotes (two single quotes).
Example:
SET @sExample = ‘SQL’’s Authority’

When working with branch conditions or complicated expressions, use parenthesis to increase readability.
IF ((SELECT 1
FROM TableName
WHERE 1=2) ISNULL)

To mark single line as comment use (–) before statement. To mark section of code as comment use (/*…*/).

Avoid the [...]

Read Full Post »

Use “Pascal” notation for SQL server Objects Like Tables, Views, Stored Procedures. Also tables and views should have ending “s”.
Example:
UserDetails
Emails

If you have big subset of table group than it makes sense to give prefix for this table group. Prefix should be separated by _.
Example:
Page_ UserDetails
Page_ Emails

Use following naming convention for Stored [...]

Read Full Post »

It is always interested to write article when reached at milestone. I start to receive many emails and suggestions just about when this blog is reaching any milestone.
One question keep on coming to me is why do I write or what is in it for me?
Satisfaction! I enjoy writing and helping community and by writing [...]

Read Full Post »

SQL Server MVP and my very good friend Jacob Sebastian has written two wonderful articles about SQL Server and XML. I encourage to read this two articles to anybody who are interested in learning SQL and XML.
How to generate a Delimited String using FOR XML PATH
XQuery Lab 19 - How to parse a delimited string?
I [...]

Read Full Post »

Since my new personal website is launched I have received many comments and emails regarding new section of Tip of the Minute. Right navigation bar of the my personal website http://www.pinaldave.com contains section of the Tip of the Minute. Every time when page is refreshed it displays one new tip related to SQL Server.
Few of [...]

Read Full Post »

Ahmedabad SQL Server User Group is just 2 months old chapter but it is getting extremely popular among enthusiastic IT professionals. I have joined this group and suggest all the developers of Ahmedabad and surrounding areas to join this group. It does not matter which application you are using but SQL Server is same everywhere.
Ahmedabad [...]

Read Full Post »

I think this is most popular question I receive in email, if I have SQL Server cheatsheet. Well, SQL Server is very wide subject and covering all the main topics of SQL Server will take 100 pages book as cheatsheet. I have tried to create one page cheatsheet which I use for my daily use. [...]

Read Full Post »

Older Posts »