August 1, 2011 at 2:27 am
Hello Friends ,
I need to create a table using select statement
but my syntax is throw the errror
-------------------------------------------------------------
Syntax:
CREATE TABLE T3 (A) AS SELECT 'A'
Error :
Msg 173, Level 15, State 1, Line 1
The definition for column 'A' must include a data type.
------------------------------------------------------------
Plz help me!! and tell me where the datatype should be declared in this case..
Plz Send running code sample for do the same..
Thanks to all!! who take interest ..
August 1, 2011 at 2:37 am
This should help:
http://msdn.microsoft.com/en-us/library/ms174979.aspx
Let us know if there's anything in particular that you don't understand.
John
August 1, 2011 at 2:46 am
Another way of doing this without using CREATE TABLE is
SELECT 'A' as A into T3
this will create the table for you, if you need to specify the data type then you can CAST the value to the correct one.
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply