April 12, 2004 at 10:30 am
Each day I import a text file into SQL Server 2000, v7.0 from Unix. I would like to know how to change the datatype from char/text to datetime?
Bill Camp
April 13, 2004 at 2:26 pm
From BOL:
ALTER TABLE table
{ [ ALTER COLUMN column_name
{ new_data_type [ ( precision [ , scale ] ) ]
[ COLLATE < collation_name > ]
[ NULL | NOT NULL ]
| {ADD | DROP } ROWGUIDCOL }
]
| ADD
{ [ < column_definition > ]
| column_name AS computed_column_expression
} [ ,...n ]
| [ WITH CHECK | WITH NOCHECK ] ADD
{ < table_constraint > } [ ,...n ]
| DROP
{ [ CONSTRAINT ] constraint_name
| COLUMN column } [ ,...n ]
| { CHECK | NOCHECK } CONSTRAINT
{ ALL | constraint_name [ ,...n ] }
| { ENABLE | DISABLE } TRIGGER
{ ALL | trigger_name [ ,...n ] }
}
mom
April 13, 2004 at 2:45 pm
Use ISDATE function in order to see if the format is correct,k and then use CONVERT
April 13, 2004 at 4:54 pm
Is this text formated for parsing out fields?
If so, use convert or cast for each field type.
ISDATE and other functions can be found at microsoft.com (developers SQL manual)
Coach James
July 8, 2004 at 5:41 pm
Hi, I have a problem I want UPDATE a column of name "alumnokey" of type "int" to "int identity(1,1) primary key", when i want do the change, show me error. Someone know how can change the properties of this column, please.
Thanks.
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply