0

Improve SQL Server Plan Execution Speed With Foreign Keys and constraints

Posted by Sameer on January 11, 2010 in SQL |

Its been a while since I have posted, and I thought this was too amazing to NOT share Apparently, using Check Constraints and adding Foreign Keys not only improves the quality of your database through ensuring referential integrity and data integrity in general, apparently it also helps the Query Analyzer design better plans! Take a [...]

8

Copy A Database Diagram To Another Database

Posted by Sameer on April 19, 2008 in SQL |

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 * [...]

6

Check if a record exists using IF EXISTS instead of COUNT(*) for increased performance

Posted by Sameer on August 12, 2007 in SQL |

How to find out if a record exists in a table efficiently using the IF EXISTS keyword, and 2) How to test and optimize two queries to see which is faster using SQL Server Management Studio. Includes screenshots

0

Using DISTINCT in Aggregate Functions

Posted by Sameer on July 5, 2007 in SQL |

The T-SQL aggregate functions (COUNT, SUM, AVG, MIN, and MAX) can all be used with the DISTINCT keyword to calculate them on distinct columns only.

2

How To Use SqlParameterCache (Caching Sql Parameters)

Posted by Sameer on June 29, 2007 in .NET articles, SQL |

This article describes how to cache your SqlParameters. Using the SqlParameterCache allows you to increase efficiency of calling stored procedures and even on executing regular SQL queries!

5

Search Trigger Text SQL Server 2005

Posted by Sameer on June 26, 2007 in SQL |

How to search if a trigger contains certain text in SQL Server 2005:

SELECT OBJECT_NAME(id)
FROM syscomments
WHERE [text] LIKE ‘%your_search_here%’ AND OBJECTPROPERTY(id, ‘IsTrigger’) = 1
GROUP BY OBJECT_NAME(id)

5

Guid Or Int Primary Key?

Posted by Sameer on June 25, 2007 in SQL |

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.

7

Creating Maintainable Database Queries In C# (with source code)

Posted by Sameer on June 15, 2007 in .NET articles, SQL |

7 tips on how to create maintainable database queries. Create a data object, avoid stored procedures, build with stringbuilder, keep it together, code SQL over C#, use a SqlParameter Array, and Trust your judgement!

0

Prefix tables with dbo. in your SQL

Posted by Sameer on May 29, 2007 in 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.

Copyright © 2007-2014 SharpDeveloper now AgileChai All rights reserved.
This site is using the Desk Mess Mirrored theme, v2.0.2, from BuyNowShop.com.