Feed on
Posts
Comments

Archive for the ‘SQL Constraint and Keys’ Category

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 »

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 »

Download SQL Server 2008 Interview Questions and Answers Complete List
Interview is very important event for any person. A good interview leads to good career if candidate is willing to learn. I always enjoy interview questions and answers series. This is my very humble attempt to write SQL Server 2008 interview questions and answers. SQL Server [...]

Read Full Post »

SQL SERVER - 2008 - Interview Questions and Answers Complete List Download
1) General Questions of SQL SERVER
Which command using Query Analyzer will give you the version of SQL server and operating system?
SELECT SERVERPROPERTY (‘productversion’), SERVERPROPERTY (‘productlevel’), SERVERPROPERTY (‘edition’)
What is SQL Server Agent?
SQL Server agent plays an important role in the day-to-day tasks of a [...]

Read Full Post »

SQL SERVER - 2008 - Interview Questions and Answers Complete List Download
1) General Questions of SQL SERVER
2) Common Questions Asked
Which TCP/IP port does SQL Server run on? How can it be changed?
SQL Server runs on port 1433. It can be changed from the Network Utility TCP/IP properties -> Port number, both on client [...]

Read Full Post »

SQL SERVER - 2008 - Interview Questions and Answers Complete List Download
1) General Questions of SQL SERVER
What is Cursor?
Cursor is a database object used by applications to manipulate data in a set on a row-by-row basis, instead of the typical SQL commands that operate on all the rows in the set at one time.
In [...]

Read Full Post »

SQL SERVER - 2008 - Interview Questions and Answers Complete List Download
1) General Questions of SQL SERVER
What is RDBMS?
Relational Data Base Management Systems (RDBMS) are database management systems that maintain data records and indices in tables. Relationships may be created and maintained across and among the data and tables. In a relational database, relationships [...]

Read Full Post »

Primary key, Foreign Key and Default constraint are the 3 main constraints that need to be considered while creating tables or even after that. It seems very easy to apply these constraints but still we have some confusions and problems while implementing it. So I tried to write about these constraints that can be created [...]

Read Full Post »

Imran Mohammed is great SQL Expert and always eager to help community members. He enjoys answering question and solving problems of other community fellows. His answers are always detailed and trustworthy. Today we will see interesting question from Prasant and excellent answer from Imran Mohammed.
Question from Prasant:
Hi,
I want to drop the primary key on one [...]

Read Full Post »

I found one of the Jr. Developer writing trigger for the requirement where he wanted to make sure invalidate data does not enter in table column. I suggested him to write Check Constraint. Check Constraints are very handy to make sure all the data in the table is validated before it enters in the database.
Let [...]

Read Full Post »

Very frequently Jr. Developers request script for creating default constraint over table column. I have written following small script for creating default constraint. I think this will be useful to many other developers who want this script to keep handy.
ALTER TABLE Customers
            ADD CONSTRAINT DF_Customers_Address2
            DEFAULT ’UNKNOWN’ FOR Address2

Reference : Pinal Dave (http://www.SQLAuthority.com)

Read Full Post »

I recently came across very nice article about optimization tips for SQL Server 2005. Here is the list of those 12 tips.
Twelve Tips For Optimizing Sql Server 2005 Query Performance
1. Turn on the execution plan, and statistics
2. Use Clustered Indexes
3. Use Indexed Views
4. Use Covering Indexes
5. Keep your clustered index small.
6. Avoid cursors
7. Archive old [...]

Read Full Post »

What I love most about this blog is active readers participation. If readers are becoming contributor is the true success for any blog or online community. Recently many readers have contributed their suggestions and script to this blog.
Joffery has provided nice script which is modification to previous article of SQL SERVER - 2005 - Find [...]

Read Full Post »

Christopher Miller read article of SQL SERVER Database Coding Standards and Guidelines Complete List Download and came up with wonderful SQL Server Script to rename all their database constraint with more organized constraint names, which helps to easily identify the constraint database exist on.
Christopher Miller - “When we submit our schema updates internally, we usually [...]

Read Full Post »

One of the most popular request I have received on this blog is to create one page which list all the SQL Server FAQs. SQL Server technology is very broad as well very deep. This is my humble attempt to list few of the daily used details in one page. Let me know your opinion [...]

Read Full Post »

Regular reader of SQLAuthority.com blog Madhaiyan Seenivasan has send email with one very interesting script. This script generates all the foreign key addition script for your database. Many times there are situations where one need to drop all the foreign key and add them back. This SQL Script can be used for the same purpose.
You [...]

Read Full Post »

Just a day ago while working with database Jr. Developer asked me question how to add column along with column constraint. He also wanted to specify the name of the constraint. The newly added column should not allow NULL value. He requested my help as he thought he might have to write many lines to [...]

Read Full Post »

I am very pleased to write my 500th post. After 500 posts, I still have same feeling when I wrote first post on this blog. I would like to thank my family for their continuous support in writing this blog. Most of all I want to thank all of YOU for being wonderful readers of [...]

Read Full Post »

Read my article in SQL Server Magazine March 2007 Edition
I will be not able to post complete article here due to copyright issues. Please visit the link above to read the article.

Read Full Post »

SQL SERVER - Cursor to Kill All Process in Database
SQL SERVER - Find Stored Procedure Related to Table in Database - Search in All Stored procedure
SQL SERVER - Shrinking Truncate Log File - Log Full
SQL SERVER - Simple Example of Cursor
SQL SERVER - UDF - Function to Convert Text String to Title Case - Proper [...]

Read Full Post »

Older Posts »