0

I am new to ASP.NET and I want to move data from database table to another table in the same database. I searched a lot but I didn't find such thing in ASP.NET MVC. I have a Table 1 and Table 2 in my ABC database and I want to move data from Table 1 to Table 2. I do not have much knowledge to do this thing have you know any blog that can solve my problem. I tried a lot but did not find.

Like http://www.codedisqus.com/0QyjVjgPqg/move-data-from-one-listbox-to-another-on-button-click-in-aspnet-mvc.html

http://blogs.msdn.com/b/adonet/archive/2012/02/09/ef-4-3-code-based-migrations-walkthrough.aspx

Entity Framework CodeFirst Move Data From One table To another

2
  • 2
    ASP.NET MVC is a web framework - it doesn't move data ..... what you're looking for is something in either SQL Server database directly (using T-SQL code), or a data access technology like ADO.NET or Entity Framework Commented Jun 13, 2015 at 7:37
  • A simple - INSERT INTO table2 SELECT * FROM table1; would actually move data from one table to other. If you want to move specific columns, then INSERT INTO table2 (column_name(s)) SELECT Column_name(s) FROM table1; Commented Jun 13, 2015 at 8:07

1 Answer 1

2

In order to insert data from one table (Database1) to another table(DataBase2).

Check following code:

Insert into Database2.dbo.Table1 Select * from Database1.dbo.Table1

With due respect to sir ramiramilu :)

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.