Getting rid of the IDENTITY property on a column withou getting rid of the column

Getting rid of the IDENTITY property on a column withou getting rid of the column

Post by Kieran Owen » Sat, 15 Apr 2000 04:00:00



Hi all,

Using T-SQL, how do I get rid of the identity property on a column without
dropping the column or moving the data. I just want a plain old int.

Thanks

Kieran

 
 
 

Getting rid of the IDENTITY property on a column withou getting rid of the column

Post by C. E. Buttle » Sat, 15 Apr 2000 04:00:00


Is this SQL 7?  If so, try ALTER TABLE.


Quote:> Hi all,

> Using T-SQL, how do I get rid of the identity property on a column without
> dropping the column or moving the data. I just want a plain old int.

> Thanks

> Kieran


 
 
 

1. Getting rid of IDENTITY

I am trying to reduce the number of tables that contain identity
columns.  But I had some questions...

I have some tables that don't have any real natural key other than a
name/description.  These columns range anywhere from 30 to 64
characters in length.  I have detail tables that reference these
tables.  Should I use these wide character columns as the primary key
for the master table and reference them in the details?  Should they
be clustered??  I could create another column and uniquely identifies
the groups, but it would not be any less ambiguous than an identity
column, and as far as I can it would be even more difficult to
implement...

CREATE TABLE Groups (
  group_name varchar(64) NOT NULL,
  adate datetime NOT NULL CONSTRAINT DF__Groups__adate DEFAULT
(GETDATE()),
  CONSTRAINT PK__Groups PRIMARY KEY CLUSTERED (group_name) ON
[PRIMARY])

CREATE TABLE GroupMembers (
  group_name varchar(64) NOT NULL CONSTRAINT
FK__GroupMembers__group_name FOREIGN KEY REFERENCES Groups
(group_name),
  member_name varchar(30) NOT NULL,
  column0 int NOT NULL,
  ..
  columnN datetime NOT NULL,
  CONSTRAINT PK__GroupMembers PRIMARY KEY CLUSTERED (group_name,
member_name) ON [PRIMARY])

Ideas or criticisms?

Brandon
--
"In the beginning the universe was created. This has made a lot of
people very angry, and has been widely regarded as a bad move." -
Douglas Noel Adams (1952-2001)
[Please remove "nospam_" from email address to reply.]

2. ADO Data Control 6.0 (SP3) (OLEDB) & Win95

3. GETTING RID OF DUPLICATE COLUMNS..

4. Splitting up resullts of a query

5. Getting rid of a column in a table

6. Delphi to Control Excel Through OLE

7. Agility Grid Control, Getting rid and bringing back columns

8. Q: Oracle Trace Manager Crashes when starting...

9. getting rid of characters in database

10. Getting unwanted data that I can't get rid of

11. Getting rid of the time part

12. Getting rid of excess lseeks()

13. Getting Rid of toolbar in the DataReports