Click here to Skip to main content
15,913,027 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: , +
Hello All,
I have created a temporary table with same fields as that in existing table in database.But i am getting problem in bringing the data of existing table into temporary table.How It is possible to fill the temporary table from existing table .
Posted

Use Import Data option from SQL Server Management studio.
 
Share this answer
 
It's just a matter of creating the table, then inserting into it

Create Table
SQL
CREATE TABLE #CampAlloc (
    [TitleID] [int] NOT NULL ,
    [SupplierID] [int] NOT NULL ,
    [RecordingCompanyID] [int] NULL
) ON [PRIMARY]


Insert Data
SQL
INSERT INTO #CampAlloc
SELECT TitleID, SupplierID, RecordingCompanyID
FROM CampaignAllocation
WHERE CampaignID = @CampaignID 


what problem are you getting, any error message?
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900