Delete a field in SQL Server 6.5
Author |
Message |
KB #1 / 9
|
 Delete a field in SQL Server 6.5
How the hell do you delete a field from an existing table in SQL Server 6.5? I don't care how (TSQL, DAO, ADO, Enterprise Manager), I just want to get rid of the fields that I don't use. KB
|
Tue, 10 Aug 2004 12:42:38 GMT |
|
 |
Janne Kej #2 / 9
|
 Delete a field in SQL Server 6.5
I'm afraid you have to create a new table, copy over the data, then delete the old table and rename the new. Janne
Quote: > How the hell do you delete a field from an existing table in SQL Server 6.5? > I don't care how (TSQL, DAO, ADO, Enterprise Manager), I just want to get > rid of the fields that I don't use. > KB
|
Tue, 10 Aug 2004 19:48:07 GMT |
|
 |
Bob Barro #3 / 9
|
 Delete a field in SQL Server 6.5
Quote:
>How the hell do you delete a field from an existing table in SQL Server 6.5? >I don't care how (TSQL, DAO, ADO, Enterprise Manager), I just want to get >rid of the fields that I don't use. >KB
Don't you have Books Online (BOL)? They should have been installed when you installed SQL Server. Just look in the SQL Server program group. If you can't find the answer to this question in BOL, then you need a lot of help with your research skills. :-) HTH, Bob Barrows Please reply to the newsgroup. My reply-to address is my "spam trap" and I don't check it very often.
|
Tue, 10 Aug 2004 20:13:19 GMT |
|
 |
Val Mazu #4 / 9
|
 Delete a field in SQL Server 6.5
Hi, ALTER TABLE allows to modify structure of table. Check full syntax in BOL Val Quote: >-----Original Message----- >How the hell do you delete a field from an existing table in SQL Server 6.5? >I don't care how (TSQL, DAO, ADO, Enterprise Manager), I just want to get >rid of the fields that I don't use. >KB >.
|
Tue, 10 Aug 2004 21:03:08 GMT |
|
 |
KB #5 / 9
|
 Delete a field in SQL Server 6.5
Ok Bob, you tell me where it mentions in BOL that a field can't be deleted in 6.5. And then, you tell me whether or not the microsoft newsgroups are a valid source of research.
Quote:
> >How the hell do you delete a field from an existing table in SQL Server 6.5? > >I don't care how (TSQL, DAO, ADO, Enterprise Manager), I just want to get > >rid of the fields that I don't use. > >KB > Don't you have Books Online (BOL)? They should have been installed > when you installed SQL Server. Just look in the SQL Server program > group. > If you can't find the answer to this question in BOL, then you need a > lot of help with your research skills. :-) > HTH, > Bob Barrows > Please reply to the newsgroup. My reply-to address is my "spam trap" and I
don't check it very often.
|
Fri, 13 Aug 2004 06:28:11 GMT |
|
 |
Bob Barro #6 / 9
|
 Delete a field in SQL Server 6.5
Quote:
>Ok Bob, you tell me where it mentions in BOL that a field can't be deleted >in 6.5. And then, you tell me whether or not the microsoft newsgroups are a >valid source of research.
Whoa - you seem to think I was insulting you or somthing. Sorry if that was the impression I gave. I thought I was telling you how to find your answers quicker than posting questions in a newsgroup and waiting for someone to answer them. Hmm, I just reread my message, and I can see that apologies are definitely in order. I can see why you would take offense (I must have been in a bad mood when I wrote that). Anyways, regarding your challenge: I opened BOL (6.5), clicked the Find button in the toolbar, and entered "delete column". Clicking OK resulted in a dialog listing quite a few hits. The first hit, "System messages", did not seem relevant, so I selected the second hit (ALTER TABLE statement). Halfway down the page I found this quote at the beginning of the Remarks section: ALTER TABLE adds columns or constraints to a table, or drops constraints from a table, but it does not allow columns to be removed. OK, so this topic does not seem to go into any detail in on how to remove a column. But I could swear I learned how to remove columns from BOL. Hmm - can't seem to find it now ... hmm, you seem to be right: no mention of how to drop a column (which should be a good indication that there is no way to do it short of creating a new table,etc. - but you're right: that seems to be a rather large leap for a newcomer to make). In my defense, It's been at least a year since I even opened 6.5's BOL. In 7.0, they added a DROP COLUMN statement Sorry, Bob Barrows PS. While the newsgroups are a valid source of research, they should be utilized on a last-resort basis. In no way should they be considered a substitute for reading the manual.
|
Fri, 13 Aug 2004 07:18:29 GMT |
|
 |
KB #7 / 9
|
 Delete a field in SQL Server 6.5
Bob, My apologies back to you Bob. Monday morning, bad weekend and a pile of end-user problems to greet me this morning. Thanks for your assistance. KB
Quote:
> >Ok Bob, you tell me where it mentions in BOL that a field can't be deleted > >in 6.5. And then, you tell me whether or not the microsoft newsgroups are a > >valid source of research. > Whoa - you seem to think I was insulting you or somthing. Sorry if > that was the impression I gave. I thought I was telling you how to > find your answers quicker than posting questions in a newsgroup and > waiting for someone to answer them. Hmm, I just reread my message, and > I can see that apologies are definitely in order. I can see why you > would take offense (I must have been in a bad mood when I wrote that). > Anyways, regarding your challenge: > I opened BOL (6.5), clicked the Find button in the toolbar, and > entered "delete column". Clicking OK resulted in a dialog listing > quite a few hits. The first hit, "System messages", did not seem > relevant, so I selected the second hit (ALTER TABLE statement). > Halfway down the page I found this quote at the beginning of the > Remarks section: > ALTER TABLE adds columns or constraints to a table, or drops > constraints from a table, but it does not allow columns to be removed. > OK, so this topic does not seem to go into any detail in on how to > remove a column. But I could swear I learned how to remove columns > from BOL. Hmm - can't seem to find it now ... hmm, you seem to be > right: no mention of how to drop a column (which should be a good > indication that there is no way to do it short of creating a new > table,etc. - but you're right: that seems to be a rather large leap > for a newcomer to make). In my defense, It's been at least a year > since I even opened 6.5's BOL. In 7.0, they added a DROP COLUMN > statement > Sorry, > Bob Barrows > PS. While the newsgroups are a valid source of research, they should > be utilized on a last-resort basis. In no way should they be > considered a substitute for reading the manual.
|
Fri, 13 Aug 2004 07:37:28 GMT |
|
 |
KB #8 / 9
|
 Delete a field in SQL Server 6.5
Not in 6.5 it doesn't. Check Bob Barrows second reply to me.
Quote: > Hi, > ALTER TABLE allows to modify structure of table. Check > full syntax in BOL > Val > >-----Original Message----- > >How the hell do you delete a field from an existing table > in SQL Server 6.5? > >I don't care how (TSQL, DAO, ADO, Enterprise Manager), I > just want to get > >rid of the fields that I don't use. > >KB > >.
|
Fri, 13 Aug 2004 07:43:18 GMT |
|
 |
Allan Sun [M #9 / 9
|
 Delete a field in SQL Server 6.5
Hello, Following is simple sample of T-SQL about how to delete a column: ALTER TABLE <TableName> DROP COLUMN <ColumnName> Alter a table to drop a column This example modifies a table to remove a column. CREATE TABLE doc_exb ( column_a INT, column_b VARCHAR(20) NULL) GO ALTER TABLE doc_exb DROP COLUMN column_b GO EXEC sp_help doc_exb GO DROP TABLE doc_exb GO Hope it helps! Regards, Allan Sun This posting is provided "AS IS", and confers to no rights.
|
Sat, 14 Aug 2004 11:05:22 GMT |
|
|
|