By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,881 Members | 1,115 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,881 IT Pros & Developers. It's quick & easy.

Alter Table questions

P: n/a
I have many columns in different tables set to money. I want to change
those to be decimal(18,2).

I do the following:

ALTER TABLE AROpenItem ALTER COLUMN copn_taxamt decimal(19,2)

I get an error:

The object 'DF__AROpenIte__copn___4D94879B' is dependent on column
'copn_taxamt'.
BUT

I can open SQL Server Enterprise manager, go to design table, and change
that column. It displays a message:

The following tables will be saved to your database. Do you want to
continue?
ARCustomer
AROpenItem

(AROpenItem references the customer # from ARCustomer).

I click Yes, and it changes the column fine.

How can I get the column to change from an alter table command? I drop
the foreign key constraint and still receive the object error from query
analyzer, but the enterprise manager doesn't display the table message.

Any ideas?
Darin

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 20 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Hello,

"Darin" <darin_nospam@nospamever> schrieb:
I have many columns in different tables set to money. I want
to change those to be decimal(18,2).

I do the following:

ALTER TABLE AROpenItem ALTER COLUMN
copn_taxamt decimal(19,2)

I get an error:

The object 'DF__AROpenIte__copn___4D94879B' is
dependent on column 'copn_taxamt'.


This is a VB.NET language group. Notice that you will have a better
chance to get an answer if you post to the ADO.NET newsgroup in future:

news://msnews.microsoft.com/microsof...amework.adonet

Web interface:

http://msdn.microsoft.com/newsgroups...amework.adonet

--
Herfried K. Wagner
MVP VB Classic, VB.NET
http://www.mvps.org/dotnet
Nov 20 '05 #2

P: n/a
Hi Darin,

I've had similar difficult sql questions answered at
microsoft.public.sqlserver.server - some of the mvp's there are very
knowledgeable about sql. My guess is that some system sp's are at work when
you get it done inside sql server's table designer.

HTH,

Bernie

"Darin" <darin_nospam@nospamever> wrote in message
news:eR*************@TK2MSFTNGP12.phx.gbl...
I have many columns in different tables set to money. I want to change
those to be decimal(18,2).

I do the following:

ALTER TABLE AROpenItem ALTER COLUMN copn_taxamt decimal(19,2)

I get an error:

The object 'DF__AROpenIte__copn___4D94879B' is dependent on column
'copn_taxamt'.
BUT

I can open SQL Server Enterprise manager, go to design table, and change
that column. It displays a message:

The following tables will be saved to your database. Do you want to
continue?
ARCustomer
AROpenItem

(AROpenItem references the customer # from ARCustomer).

I click Yes, and it changes the column fine.

How can I get the column to change from an alter table command? I drop
the foreign key constraint and still receive the object error from query
analyzer, but the enterprise manager doesn't display the table message.

Any ideas?
Darin

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 20 '05 #3

P: n/a
I didn't mean to post this question to this newsgroup. Just a whoops on
my part.
Sorry.

Darin

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 20 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.