Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Create empty column in results
Message
 
 
To
13/06/2008 10:15:02
Jay Johengen
Altamahaw-Ossipee, North Carolina, United States
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Environment versions
SQL Server:
SQL Server 2005
Miscellaneous
Thread ID:
01323801
Message ID:
01323812
Views:
15
>>>I get an error on the WorkPhone column that is doesn't like the quotes. How do I create an empty column?
>>>
>>>
>>>	[Phone] [varchar](14) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
>>>	'' AS WorkPhone,
>>>
>>
>>
>>select *, cast('' as varchar(12)) as WorkPhone from People
>
>
>	cast('' as varchar(12)) AS WorkPhone,
>
>
>Error:
>
>
>Msg 173, Level 15, State 1, Line 12
>The definition for column 'cast' must include a data type.
>
Can you show the exact context where you're trying to do this? I gave you the working code for Select-SQL (see also my updated reply). I just ran the above query before giving this answer.
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform