Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL statement to change data type of column

Status
Not open for further replies.

MikeT

IS-IT--Management
Joined
Feb 1, 2001
Messages
376
Location
US
I need to issue an SQL statement that will change the datatype of a column from nvarchar to money.
While we're on the subject, does anyone have a link to explanations of all the datatypes; (varchar vs. nvarchar) and so on?

Thanks!
 
1) There is no single SQL command that will convert a column from varchar to money. You'll need to create a new column (or new table) with a money column and drop the old column. If the old column contains data you'll need to explicitly convert and move the data to the new column.

You can use Enterprise Manager to convert the column but it will create a new table and insert the data into the new table. It drops the old table.

2) SQL BOL defines the data types. You can find BOL at Microsoft.


3) You can execute the sp_datatype_info system stored proc to list info about data types. Terry L. Broadbent
FAQ183-874 contains tips for posting questions in these forums.
NOTE: Reference to the FAQ is not directed at any individual.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top