on 05-12-2015 7:50 AM
Hi
I want to copy data from one table to another. Fields in both the tables are same. Do i need to loop through each record or with 1 sql statement data can be copied like in SQL . For e.g Insert into test select * from temp
Thanks
Hi Sonu,
Im providing the Example go through it :-
INSERT INTO #TempTable (ID, Date, Name)
SELECT id, date, name
FROM physical_table
Here #TempTable is the temporary table And Don't forget to drop the temporary table after you have finished with it and before you try creating it again.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sonu,
It can work, but i suggest you specifiy the fields, just in case the sequence of the fields are different in both tables
Regards
Ad
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
108 | |
12 | |
11 | |
6 | |
5 | |
4 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.