By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,301 Members | 1,752 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,301 IT Pros & Developers. It's quick & easy.

.NET: Naming convention for a column with "AS" in stored procedure

P: n/a
Hi,

I have a stored procedure that looks like the follows:

-------------------------------------------------------------------------------------
SELECT
ClientName AS 'Client Name',
Location,
ReportInstanceID
FROM
#CORE
-------------------------------------------------------------------------------------

I want to add the stored procedure to my C# code manually as a typed
DataTable. Obviously I'll need to add data columns for the three
columns in the SELECT statement.

Question: Shall I use "ClientName" or "Client_Name" for the first
column? What's the naming convention in .NET for the column names with
"AS" in the stored procedure?

Thanks!

-Emily

Jan 8 '07 #1
Share this Question
Share on Google+
2 Replies


P: n/a
I would avoid column names with spaces in them like I would a
police officer when driving 80mph in a 55mph zone. They will
haunt you, make your life a living hell, require you to use
square brackets around them when you want to use them and
be a pain in the A** that you have to deal with every single
time you want to touch that table. (Not that I'm bitter.)

If you really, really don't want to use ClientName
(which is the recommended standard), use Client_Name. At least
if you do that, and you're using it for column headers somewhere,
you can replace all underscores, and get a workable column header.

Robin S.
-----------------------------------

"Fir5tSight" <fi********@yahoo.comwrote in message
news:11**********************@i15g2000cwa.googlegr oups.com...
Hi,

I have a stored procedure that looks like the follows:

-------------------------------------------------------------------------------------
SELECT
ClientName AS 'Client Name',
Location,
ReportInstanceID
FROM
#CORE
-------------------------------------------------------------------------------------

I want to add the stored procedure to my C# code manually as a typed
DataTable. Obviously I'll need to add data columns for the three
columns in the SELECT statement.

Question: Shall I use "ClientName" or "Client_Name" for the first
column? What's the naming convention in .NET for the column names with
"AS" in the stored procedure?

Thanks!

-Emily

Jan 8 '07 #2

P: n/a
On 8 Jan 2007 08:35:29 -0800, Fir5tSight wrote:
Hi,

I have a stored procedure that looks like the follows:

-------------------------------------------------------------------------------------
SELECT
ClientName AS 'Client Name',
Location,
ReportInstanceID
FROM
#CORE
-------------------------------------------------------------------------------------

I want to add the stored procedure to my C# code manually as a typed
DataTable. Obviously I'll need to add data columns for the three
columns in the SELECT statement.

Question: Shall I use "ClientName" or "Client_Name" for the first
column? What's the naming convention in .NET for the column names with
"AS" in the stored procedure?

Thanks!

-Emily
Hey Emily,

I think it's up to your personal preference to chose which naming
convention to go. Personally i'd do ClientName, because it's easier to type
:)
--
Bits.Bytes
http://bytes.thinkersroom.com
Jan 8 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.