INF: Dynamically Altering Table Definitions in SQL ServerID: Q64176
|
Transact-SQL supplies the ALTER TABLE command to add new columns to an
existing table. This article explains how to perform the following
additional table definition changes:
The above table definition changes can be done in SQL Server in at
least three ways:
INSERT <tablename>
SELECT <col list>
FROM <table list>
create table test1
(col1 char(10),
col2 int)
insert test1 values("First Row",1)
insert test1 values("Second Row",2)
insert test1 values("Third Row",3)
create table test2
(col1 char(15),
col2 char(5))
insert test2
select col1, convert(col2,char(5))
from test1
Additional query words: Transact-SQL
Keywords : kbprg SSrvServer
Version : 4.2
Platform : OS/2
Issue type :
Last Reviewed: March 9, 1999