StanleyGu's Blog
.NET Consultant C# ASP.NET SQL Server Silverlight
Sign in
|
Join
Home
Contact
About
RSS
Atom
Comments RSS
Search
Tags
.NET
ADO.NET
Architect
ASP.NET 3.5
C#
Enterprise Library
IIS 7.0
Office
Silverlight 3.0
Solution
Tip
T-SQL
Visual Studio 2008
WCF
Windows Server 2008
Sponsors
advertise here
Navigation
Home
Blogs
Archives
April 2010 (3)
March 2010 (2)
February 2010 (5)
January 2010 (6)
December 2009 (8)
November 2009 (1)
February 2010 - Posts
0
Comments
Tip 12 : Common T-SQL Escape Scenarios: Percent (%), Underscore (_)
by
StanleyGu
Scenario 1 : You have a Purchase table with field named DiscountRate. The DiscountRate values can be true percentage such as "2.5%", "5.0%", or can be other values such as "N/A", "Fixed Rate", etc. You want all the records with true percentage. To implement...
Filed under:
Tip
,
T-SQL
0
Comments
Tip 11 : Group By Date for DateTime Type Field
by
StanleyGu
You have a Purchase table with fields of ID, PurchaseAmount and PurchaseDate. The PurchaseDate field is DateTime type that includes Date and Time information. You want daily total purchase amount. To implement this, you can do GROUP BY based on Date portion...
Filed under:
Tip
,
T-SQL
4
Comments
Architect 3 : Building Data Access Layer Using Microsoft Enterprise Library 4.1
by
StanleyGu
You have a Customer table with three fields: ID, LastName and FirstName. You are building a data access layer to retrieve all the records from the Customer table and return the result as a collection of Customer objects. You want implement it using Microsoft...
Filed under:
C#
,
Architect
,
ADO.NET
,
Enterprise Library
9
Comments
Solution 5 : Implementing Optional Parameters in T-SQL Stored Procedures
by
StanleyGu
You have a stored procedure GetCustomers with two parameters: LastName, FirstName. The stored procedure returns all the records matching the values of the parameters. You want the parameters be optional, which means skipping the parameter if you do not...
Filed under:
C#
,
Solution
,
T-SQL
1
Comments
Tip 10 : Returning the first part of a string with delimiter
by
StanleyGu
You have a string delimited by underscore such as 1stPart_2ndPart_3rdPart and want to return the first part of the string only. C# Implementation of using Split function: T-SQL implementation of using SUBSTRING and CHARINDEX functions:
Filed under:
C#
,
Tip
,
T-SQL
More Posts