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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

change field type problem?

Status
Not open for further replies.

vcavusoglu

Programmer
Apr 26, 2001
41
0
0
TR
Hi.

i have got a lot of database my customers.

some tables field type must be change
(94 field in 15 table)

I want to write pratical sql script.

change : int field to money field

how ?

i try it.

"Alter Table TABLE1 Alter column FIELD1 money" is not running

a error message
Server: Msg 5074, Level 16, State 1, Line 1
The object 'DF_HAT_FIELD1' is dependent on column 'FIELD1'.
Server: Msg 4922, Level 16, State 1, Line 1
ALTER TABLE ALTER COLUMN FIELD1 failed because one or more objects access this column.
 
It seems you have DEFAULT object created for that column.
You need at first do DROP DEFAULT DF_HAT_FIELD1,
than ALTER column and than use CREATE DEFAULT ...

Zhavic


---------------------------------------------------------------
In the 1960s you needed the power of two Comodore64s to get a rocket to the moon. Now you need a machine which is a vast number of times more powerful just to run the most popular GUI.
 
please more information.

(please explain to command)

i am a inexperienced user
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top