Ramani Sandeep's Blog

DotNetting – Fast , Easy Way of Developing Applications

Posts Tagged ‘Create Table from Existing table’

SQL Server – Copy Table from 1 Database to another

Posted by Ramani Sandeep on October 3, 2008

—————————————————-
Method : 1
—————————————————-

USE PropertyIdea
GO
—-Create Table
CREATE TABLE Country (CountryID int, Country nvarchar(50),Code int)

—-INSERT INTO Country using SELECT
INSERT INTO Country (CountryID , Country ,Code)
SELECT CountryID , Country ,Code
FROM [Kunj.Corp].[dbo].[Country]

—-Verify that Data in Country
SELECT * FROM Country

—————————————————-
Method : 2
—————————————————-
USE PropertyIdea
GO

—-Create Table

CREATE TABLE Country (CountryID
int, Country nvarchar(50),Code int)

—INSERT INTO Country using SELECT

INSERT INTO Country (CountryID, Country ,Code)

SELECT CountryID , Country ,Code

FROM [Kunj.Corp].[dbo].[Country]

—-Verify that Data in Country

SELECT * FROM Country

Posted in SQL Server | Tagged: , | Leave a Comment »

 
Follow

Get every new post delivered to your Inbox.

Join 317 other followers