SQL query in source code

Topics: SharpMap Project
Jul 25, 2013 at 11:31 AM
Dear all,

I have a small question to ask:

When I read the source code designed to read data from postgres in SharpMap PostGIS class. I find the query codes are
var strSQL = "SELECT \"" + ObjectIdColumn + "\" ";
strSQL +="FROM" + QualifedTable + "WHERE ";
I don't understand why not use

var strSQL ="SELECT" + ObjectIdColumn +"FROM" + QualifedTable + "WHERE" ?

Why there are some "\" " and what does this mean? Any guidance?

Many thanks!
Jul 25, 2013 at 2:06 PM
The columns should be placed in double-quotes to mark them as identifiers. Otherwise you cannot use capital letters in your column names.

Hth FObermaier
Aug 5, 2013 at 7:57 AM
In fact, the quotes are for "special characters" on column names, such as spaces or symbols. SQLServer also supports the brackets, but I think the quotes are ANSI SQL code