SQL DATABASE: copying data of one table into another table
In C# I want to write the query for copying one table data into another table, can anybody help me?
Replies
-
Kaustubh Katdare
Share the code you've written so far 😀RAANAIn C# I want to write the query for copying one table data into another table, can anybody help me? -
vinciyou need sql code
INSERT INTO TABLE2 (COL1, COL2, COL3) SELECT COL1, COL4, COL7 FROM TABLE1​try this ​
with ADO.Net concepts apply the above query over database table and you get desired results -
PraveenKumar Purushothaman
Bulk Copy feature of ADO.NET might help you take a look at that: #-Link-Snipped-#RAANAIn C# I want to write the query for copying one table data into another table, can anybody help me? -
PraveenKumar PurushothamanThis is the simplest way to copy a table into another (new) table in the same SQL Server database. This way of copying does not copy constraints and indexes.
select * into
We can also select only a few columns into the destination table like belowfrom select col1, col2, col3 into
Use this to copy only the structure of the source table.from select * into
Use this to copy a table across two database in the same Sql Server.from select * into
Any one of the following methods can be employed to copy a table into a destination database on a different SQL Server.from 1. Data Transformation Service (DTS) â SQL Server 2000.
2. SQL Server Integration Service (SSIS) â SQL Server 2005
3. SQL Server âExport Dataâ task. â SQL Server 2000/2005
4. Create a linked Server of the destination SQL Server on the source SQL Server and then copy the table. â SQL Server 2000/ 2005.
5. We can also use My code library (SQL Server T-SQL code samples, snippets, examples, tips, tricks, stored procedures, user defined functions, VB programs): Narayana Vyas Kondreddi's home page to generate data insertion scripts and then run the insert scripts.
6. I almost forgot this 😉 you can open the source table , select the row(s), copy (ctrl + C) the row(s), open the destination table and then paste (ctrl + V) the row(s).
You are reading an archived discussion.
Related Posts
hey guys.. Why do shrinkage occur in castings? explain the changes in the atomic level....
This is probably old hat to many that haunt this section. Who knows? May be useful to some novices. I for one do not use a laptop, so I pass...
Name: sandeep s m
*Engineering Trade: Electronics and communication
Location: Bangalore, Karnataka, India
*Occupation: Working as a system engineer in alpha design technologies, bangalore (www.adtl.co.in)
Work Experience: 2.2 years in...
i am new to the CE, in the forums i haven't seen any one working in the domain FPGA. pls any one works inform me.
thank you
regards
sandeep
CEans,
Our eagle eyed members already caught us during our beta testing phase and it's now official. CrazyEngineers Home [ https://www.crazyengineers.com ] and sub-sections have been upgraded to offer a...