473,574 Members | 8,370 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Alter Table questions

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___4D94879 B' 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
3 4077
Hello,

"Darin" <darin_nospam@n ospamever> 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___4D94879 B' 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
Hi Darin,

I've had similar difficult sql questions answered at
microsoft.publi c.sqlserver.ser ver - 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@n ospamever> wrote in message
news:eR******** *****@TK2MSFTNG P12.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___4D94879 B' 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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
9817
by: Dylan Nicholson | last post by:
Seems that Oracle 9.2 (using MS ODBC driver) requires extra parentheses when adding multiple columns to a table: ALTER TABLE MyTable ADD (MyColumn1 VARCHAR(255), MyColumn2 VARCHAR(255)) vs ALTER TABLE MyTable ADD MyColumn1 VARCHAR(255), MyColumn2 VARCHAR(255)
1
11495
by: Lannsjo | last post by:
I need to change my primary key column type from smallint to int. I have tried: ALTER TABLE livegroup MODIFY id INT UNSIGNED NOT NULL AUTO_INCREMENT; But get an error message certainly since my id-column is primary key and references other tables as well. How can I come around this problem? Need help /Martin
4
5865
by: maricel | last post by:
Could someone confirm which tablespace is being used when running ALTER & CREATE INDEX. Is it the tempspace or the tablespace where the table resides? Many thanks, maricel
1
5473
by: Daniel Chou | last post by:
Hello, I have two questions about "not logged initially": 1. Before using "alter table tbname activate not logged initially", should the table be created with "not logged initially"? 2. After using "alter table tbname activate not logged initially", how to deactivate it?
0
6231
by: Gianfranco | last post by:
Hi, I'm not familiar at access and at VBA either, so I need some help or at least some hint please. I have table "availabledrivers", coming from a query to the table "drivers". Then I have a table "availablebus" coming from a query to "bus". Bus and Drivers have autonumber ID, so the tables I get have the IDs screwed up..I mean..there are...
2
31464
by: RamaKrishna Narla | last post by:
In MS SQL Server, I have the following tables with some data in it. create table table1 ( column1 varchar(32), column2 int not null, column10 varchar(255), ..... primary key (column1, column2), );
7
6966
by: Serge Rielau | last post by:
Hi all, Following Ian's passionate postings on problems with ALTOBJ and the alter table wizard in the control center I'll try to explain how to use ALTOBJ with this thread. I'm not going to get into the GUI because it is hard to describe in text. First of all what is the purpose of ALTOBJ()? This procedure was created mostly for ISVs who...
1
3485
by: vasilip | last post by:
I'm testing out db2 for a project I'm starting that requires proper xml support and I can't seem to get both xml and spatial data to work well in the same table. Once having created a table containing both xml and spatial data fields I can't seem to find a way to alter the table I have created a table containing an id, xmldata field and a...
11
4067
by: raylopez99 | last post by:
Keep in mind this is my first compiled SQL program Stored Procedure (SP), copied from a book by Frasier Visual C++.NET in Visual Studio 2005 (Chap12). So far, so theory, except for one bug (feature?) below. At some point I'm sure I'll be able to laugh about this, akin to forgeting a semi-colon in C/C++, but right now it's frustrating (time...
0
7739
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8258
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
5635
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5326
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3761
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3777
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2255
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1360
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1087
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.