C# articles and tutorials on SharpDeveloper.NET

Sharpen your .NET skills with our C# articles, tutorials, demos, and source code by Sameer Alibhai
posts - 63, comments - 53, trackbacks - 1

SQL

Articles on SQL, SQL Server, etc..
Copy A Database Diagram To Another Database

posted @ Saturday, April 19, 2008 5:18 PM | Feedback (0) | Filed Under [ SQL ]

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

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

posted @ Sunday, August 12, 2007 8:54 PM | Feedback (0) | Filed Under [ SQL ]

Using DISTINCT in Aggregate Functions

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.

posted @ Thursday, July 05, 2007 11:10 AM | Feedback (0) | Filed Under [ SQL ]

How To Use SqlParameterCache (Caching Sql Parameters)

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!

posted @ Friday, June 29, 2007 8:35 PM | Feedback (1) | Filed Under [ .NET articles SQL ]

Search Trigger Text SQL Server 2005

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)

posted @ Tuesday, June 26, 2007 1:02 PM | Feedback (2) | Filed Under [ SQL ]

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.

posted @ Monday, June 25, 2007 6:14 PM | Feedback (1) | Filed Under [ SQL ]

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

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!

posted @ Friday, June 15, 2007 10:17 PM | Feedback (1) | Filed Under [ .NET articles SQL ]

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.

posted @ Tuesday, May 29, 2007 11:38 AM | Feedback (0) | Filed Under [ SQL ]

Powered by: