Example
Create table "Region_A"
CREATE TABLE [dbo].[Region_A](
[RegionID] [int] IDENTITY(1,1) NOT NULL,
[RegionDescription] [nchar](50) NOT NULL
)
Add a few rows of data for this table.
INSERT INTO [dbo].[Region_A] ([RegionDescription])
VALUES (N'Eastern ')
INSERT INTO [dbo].[Region_A] ([RegionDescription])
VALUES (N'Western ')
INSERT INTO [dbo].[Region_A] ([RegionDescription])
VALUES (N'Northern')
INSERT INTO [dbo].[Region_A] ([RegionDescription])
VALUES (N'Southern')
Copy data from existing table (Region_A) to new table (Region_B)
SELECT * INTO Region_B FROM Region_A
Copy data from existing table (Region_A) to another existing table (Region_C)
Create table "Region_C"
CREATE TABLE [dbo].[Region_C](
[RegionID] [int] IDENTITY(1,1) NOT NULL,
[RegionDescription] [nchar](50) NOT NULL
)
Transfer data from Region_A to Region_C
INSERT INTO Region_C ([RegionDescription])
SELECT [RegionDescription] FROM Region_A
Related posts:
No Comments