Category Archives: SQL

Copy A Database Diagram To Another Database

For some reason SQL Server doesn’t have an easy way to "Create TO" for database diagrams, unlike stored procedures, functions ,etc. Here is how you can achieve moving a database diagram (or copying a database diagram) in SQL Server 2005 use Old_Database go –this will copy your database diagrams into a temporary table select * […]

Read More

Guid Or Int Primary Key?

When designing a database, and creating the tables and schema, we have to choose carefully what we want our primary key to be. There are many different aspects to this. This article discusses the benefits of using a GUID over an Integer primary key.

Read More

Prefix tables with dbo. in your SQL

A power tip on increasing your query execution speed is to prefix your table and stored procedure names with dbo. By prefixing with dbo, Our database makes one less call. Normally, when you do not use the dbo keyword, on a query such as Select * from Users where UserID = @UserID, it will first check the user’s schema to see if that table exists for them.

Read More