SQL Server Tutorial - Getting Started with SQL Server
sql server tutorial for beginners,sql server 2012 tutorial,sql server 2005 2008 2012 tutorial for beginners, sql server recipes,sql server tips, sql server tricks, sql server tips & tricks, sql server internal,sql server fresh tips, sql server latest tutorial
Drop all tables, stored procedure, views and triggers
Posted By : Shailendra Chauhan, 27 Sep 2012
Updated On : 27 Sep 2012
Version Support : SQL Server 2005,08,12
Keywords : remove all tables and stored procedures from database, remove all tables and data from database,remove all triggers, remove all views, drop all triggers, drop all views
Sometimes, there is a case, when we need to remove all tables, stored procedure, views and triggers completely from the database. If you have around 100 tables, stored procedure and views in your database, to remove these, completely from database became a tedious task. In this article, I would like to share the script
Difference between Primary Key and Unique Key
Posted By : Shailendra Chauhan, 26 Sep 2012
Updated On : 26 Sep 2012
Keywords : primary key vs unique key,primary key advantage over unique key,primary key features,unique key features
In SQL Server, we have two keys - primary key and unique key which distinctively or uniquely identify a record in the database. Both the keys seems identical, but actually both are different in features and behaviours. In this article, I would like to share the key difference between primary key and unique key.
Difference between Primary Key and Foreign Key
Posted By : Shailendra Chauhan, 26 Sep 2012
Updated On : 26 Sep 2012
Keywords : primary key vs foreign key,primary key advantage over foreign key,primary key features,foreign key features
In SQL Server, there are two keys - primary key and foreign key which seems identical, but actually both are different in features and behaviours. In this article, I would like to share the key difference between primary key and foreign key.
Magic table or Virtual table in SQL Server
Posted By : Shailendra Chauhan, 25 Sep 2012
Updated On : 25 Sep 2012
Version Support : SQL Server 2005,2008,2012
Keywords : use of magic table or virtual table,deleted table in sql server,inserted table in sql server,magic table with example,virtual table with example
Basically, magic table is the terminology used for virtual table in SQL Server since there is no magic in SQL Server. There are Inserted and Deleted virtual tables in SQL Server. These tables are automatically created and managed by SQL Server internally to hold recently inserted, deleted and updated values during DML operations (Insert,Update,Delete) on a database table.
Difference between Stored Procedure and Function in SQL Server
Posted By : Shailendra Chauhan, 15 Sep 2012
Updated On : 25 Sep 2012
Version Support : SQL Server 2005,2008,2012
Keywords : Difference between Stored Proc and Function, Difference between Stored Procedure and User Define Function(UDF).
tored Procedures are pre-compile objects which are compiled for first time and it's compiled format is saved which executes (compiled code) whenever it is called. But Function is compiled and executed every time when it is called.
Get field name, data type and size of database table
Posted By : Shailendra Chauhan, 31 Aug 2012
Updated On : 25 Sep 2012
Version Support : SQL Server 2005,2008,2012
Keywords : query to find column name datatype and size of table, get columns of a table with types and size, fetch columns fields of table
One student of me asked "how can we get fields name of a table with theirs type and size ?". In this article I am going to expose, how can we achieve this in SQL Server.
Get nth highest and lowest salary of an employee
Posted By : Shailendra Chauhan, 31 Aug 2012
Updated On : 25 Sep 2012
Version Support : SQL Server 2005,2008,2012
Keywords : query to find nth highest and lowest salary of employee, get nth highest and lowest value, find nth highest and lowest value
One student of me asked "how can we get nth highest and lowest salary on an employee ?". In this article I am going to expose, how can we achieve this in SQL Server.
Tips to improve SQL Server database design and performance
Posted By : Shailendra Chauhan, 27 Aug 2012
Updated On : 25 Sep 2012
Version Support : SQL Server 2005,2008,2012
Keywords : sql server best practice, tips to improve sql query performance, tips for good database design, sql server optimization techniques, tips for sql query optimization,sql server database design tips
Best performance is the main concern to develop a successful application. Like a coin database is the tail side (back-end) of an application. A good database design provides best performance during data manipulation which results into the best performance of an application.
Remove unsent database email from SQL Server
Posted By : Shailendra Chauhan, 26 Aug 2012
Updated On : 25 Sep 2012
Version Support : SQL Server 2005,2008
Keywords : delete unsent email form sql server mail queue,empty database mail queue,remove email from database mail queue
Suppose, you are sending mail to different-different users by using while loop and you forgot to insert while loop update statement. In this case SQL Server will generate thousands or millions of mail against a specific email address with in a min.
Remove duplicate records from a table in SQL Server
Posted By : Shailendra Chauhan, 24 Aug 2012
Updated On : 25 Sep 2012
Version Support : SQL Server 2005,2008,2012
Keywords : delete duplicate rows or records in sql server,removing duplicate records using sql server,sql server delete duplicate records or rows
Sometimes we required to remove duplicate records from a table although table has a UniqueID Column with identity. In this article, I would like to share a best way to delete duplicate records from a table in SQL Server.