Re: Alter table alter column
From: Uri Dimant (urid_at_iscar.co.il)
Date: 03/09/04
- Next message: Tibor Karaszi: "Re: Alter table alter column"
- Previous message: Dave: "Re: Multiple Queries in a single line"
- In reply to: khanhbui: "Alter table alter column"
- Next in thread: Tibor Karaszi: "Re: Alter table alter column"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 9 Mar 2004 12:38:34 +0200
Hi
One more approach
DROP TABLE Table1
CREATE TABLE Table1
(
Col1 varchar(10) NOT NULL,
CONSTRAINT PK_Table1 PRIMARY KEY (Col1)
)
INSERT INTO Table1 VALUES('1')
GO
EXEC sp_rename 'Table1', 'Table1_Old'
GO
SELECT ISNULL(CAST(Col1 AS int), 0) AS Col1
INTO Table1
FROM Table1_Old
DROP TABLE Table1_Old
ALTER TABLE Table1
ADD CONSTRAINT PK_Table1
PRIMARY KEY (Col1)
GO
"khanhbui" <khanh@monterpoint.co.uk> wrote in message
news:edvQoCcBEHA.3796@TK2MSFTNGP10.phx.gbl...
> Hi All,
> I tried to use T-sql command alter table alter colum column_name to
change
> a column datatype (small int to int)
> It returned an error that some other objects using that column, I used the
> enterprise manager it's OK
> is there any tricks to alter a column without using Enterprise Manager ?
> Thanks in advance
>
>
- Next message: Tibor Karaszi: "Re: Alter table alter column"
- Previous message: Dave: "Re: Multiple Queries in a single line"
- In reply to: khanhbui: "Alter table alter column"
- Next in thread: Tibor Karaszi: "Re: Alter table alter column"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|