Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 as first name

Author  Topic 

esthera
Master Smack Fu Yak Hacker

1410 Posts

Posted - 2005-02-22 : 03:16:57
Is there anyway I can write an sql so that the field name comes out as first name with a space.

my sql is select firstname as first name,id,number from mytable

The above obviously doesn't work -- is there something that will work?

marat
Yak Posting Veteran

85 Posts

Posted - 2005-02-22 : 03:20:10
try
select firstname as 'first name',id,number from mytable
Go to Top of Page

esthera
Master Smack Fu Yak Hacker

1410 Posts

Posted - 2005-02-22 : 03:47:42
this worked

Thanks!
Go to Top of Page

TG
Master Smack Fu Yak Hacker

6065 Posts

Posted - 2005-02-22 : 08:09:31
The standard way to refer to object names in SqlServer is with [square brackets].

Be One with the Optimizer
TG
Go to Top of Page
   

- Advertisement -