ALTER TABLE ALTER COLUMN 
Author Message
 ALTER TABLE ALTER COLUMN
Heya,

I have table STOKMOTION with field described as;
[INCREMENT] [numeric](18, 0) IDENTITY (1, 1) NOT NULL

Now I want to make add NOT FOR REPLICATION statement and tried below;

ALTER TABLE STOKMOTION ALTER COLUMN [INCREMENT] [numeric](18, 0) IDENTITY
(1, 1) NOT NULL NOT FOR REPLICATION
and it failed with below error:

Server: Msg 156, Level 15, State 1, Line 1
Incorrect syntax near the keyword 'IDENTITY'.

How can I make it work ?

Thnks & BRgds.



Mon, 23 Jan 2006 17:17:58 GMT
 ALTER TABLE ALTER COLUMN

Hi Adam,

You can't change columns with IDENTITY with the ALTER TABLE ALTER COLUMN
statement. The easiest way to do it is change the column in Enterprise
Manager. You can save the change script that is created and have a look at
it to see how it is done.

--
Jacco Schalkwijk MCDBA, MCSD, MCSE
Database Administrator
Eurostop Ltd.


Quote:
> Heya,

> I have table STOKMOTION with field described as;
> [INCREMENT] [numeric](18, 0) IDENTITY (1, 1) NOT NULL

> Now I want to make add NOT FOR REPLICATION statement and tried below;

> ALTER TABLE STOKMOTION ALTER COLUMN [INCREMENT] [numeric](18, 0) IDENTITY
> (1, 1) NOT NULL NOT FOR REPLICATION
> and it failed with below error:

> Server: Msg 156, Level 15, State 1, Line 1
> Incorrect syntax near the keyword 'IDENTITY'.

> How can I make it work ?

> Thnks & BRgds.



Mon, 23 Jan 2006 17:32:48 GMT
 ALTER TABLE ALTER COLUMN
Thnks Jacco,
How about adding NOT FOR REPLICATION in Enterprise Manager ? Is there a way
?


Quote:
> Hi Adam,

> You can't change columns with IDENTITY with the ALTER TABLE ALTER COLUMN
> statement. The easiest way to do it is change the column in Enterprise
> Manager. You can save the change script that is created and have a look at
> it to see how it is done.

> --
> Jacco Schalkwijk MCDBA, MCSD, MCSE
> Database Administrator
> Eurostop Ltd.



Mon, 23 Jan 2006 17:37:12 GMT
 ALTER TABLE ALTER COLUMN
Hi Adam,
Depends on the version really. Sql 7.0 EM does not allow this; generate a
script, add this option and run!
In Sql 2000, the EM allows this from the interface. Go to Design mode, click
on the identity column and have a look at the options in the Columns window
at the bottom. From the drop-down of Identity field, select as appropriate.

Regards,
Raj Moloye


Quote:
> Thnks Jacco,
> How about adding NOT FOR REPLICATION in Enterprise Manager ? Is there a
way
> ?



> > Hi Adam,

> > You can't change columns with IDENTITY with the ALTER TABLE ALTER COLUMN
> > statement. The easiest way to do it is change the column in Enterprise
> > Manager. You can save the change script that is created and have a look
at
> > it to see how it is done.

> > --
> > Jacco Schalkwijk MCDBA, MCSD, MCSE
> > Database Administrator
> > Eurostop Ltd.



Mon, 23 Jan 2006 18:59:04 GMT
 ALTER TABLE ALTER COLUMN

Where is the change scipt saved?

Originally posted by Jacco Schalkwijk

Quote:
> Hi Adam,

> You can't change columns with IDENTITY with the ALTER TABLE
> ALTER COLUMN
> statement. The easiest way to do it is change the column in Enterprise
> Manager. You can save the change script that is created and have
> a look at
> it to see how it is done.

> --
> Jacco Schalkwijk MCDBA, MCSD, MCSE
> Database Administrator
> Eurostop Ltd.




> > Heya,
> > I have table STOKMOTION with field described as;
> > [INCREMENT] [numeric](18, 0) IDENTITY (1, 1) NOT NULL
> > Now I want to make add NOT FOR REPLICATION statement and tried
>     below;
> > ALTER TABLE STOKMOTION ALTER COLUMN [INCREMENT] [numeric](18, 0)
>     IDENTITY
> > (1, 1) NOT NULL NOT FOR REPLICATION
> > and it failed with below error:
> > Server: Msg 156, Level 15, State 1, Line 1
> > Incorrect syntax near the keyword 'IDENTITY'.
> > How can I make it work ?
> Thnks & BRgds.

--
Posted via http://dbforums.com


Sun, 09 Apr 2006 15:50:07 GMT
 
 [ 5 post ] 

 Relevant Pages 

1. Alter Table Alter Column Syntax

2. ALTER TABLE ALTER COLUMN

3. Help with Alter Table Alter Column

4. syntax for ALTER TABLE ALTER COLUMN DEFAULT

5. ALTER TABLE ALTER COLUMN to set Default

6. Errors With ALTER TABLE/ALTER COLUMN

7. Alter table alter column syntax

8. Alter table alter column

9. Alter table alter column

10. alter table alter column

11. ALTER TABLE/ALTER COLUMN problem with MS Access 2K

12. Alter table alter column text


 
Powered by phpBB® Forum Software