Wednesday, January 16, 2008

Adding Single Qoute in SQL Query

Hi...

I would like to share how to add a single qoute in SQL Query.

example:

DatabaseName = Northwinds
TableName = Employees
FieldName = FirstName

and in the FirstName contain: Layong


we want the result show up when we process: 'Layong

we just need add 4x single qoute, and then the single qoute would show up.

here the simple query that I create:

SELECT '''' + FirstName
FROM Employees
WHERE FirstName = 'Layong'

The result will be:

'Layong

Have a nice try with this knowledge...


0 comments:

Google

Microsoft News for ADO .NET:

Our Email Address:

blog.programming@gmail.com