Click here to Skip to main content
15,891,828 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
1.I want to move all data from old table to new table like cut and paste.
2.Then want to move some data(when i click check box particular row in front end)from old to new table like copy paste.

Any body give example in asp.net c#.i need code behind format.(SQL queries)

What I have tried:

How to move and copy data from one table to another table in MSSQL
Posted
Updated 22-Feb-17 19:49pm

Think of it!

Logic:

  1. Move

    • INSERT[^] (add) data into new or existing table
    • DELETE[^] (remove) data from source table

  2. Copy

    • INSERT (add) data into new or existing table



The best way to achieve that is to use stored procedures[^].

For further details, please see:
Walkthrough: Using Only Stored Procedures (C#)[^]
Create a simple data application by using ADO.NET[^]

Try!
 
Share this answer
 
Try this ...
SQL
Select * into YourNewTableName from YourOldTableName

It will create and copy all data into yourNewTable. after that you can insert more records on it.

Thanks
AARIF SHAIKH
 
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