Click here to Skip to main content
15,898,134 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
hello guys.

i have a problem in moving the data into another database.


i have a listbox. then when i select one. a form view will appear.
on that form view. there is an editing. and i have this "category" that when i selected or update it, the data from this "category" will be saved from the default database. and to another database.

i hope you can help me.

thanks a lot.

-chaosgray-
Posted
Updated 29-May-11 14:13pm
v2
Comments
[no name] 29-May-11 22:04pm    
And what have you tried? You need an insert method, what do you have?

1 solution

Hi chaosgray,
You can use full qualified table names to do this(only if both the databases are of same type (SQL SERVER))

Please try SELECT INTO
SQL
SELECT * INTO
     [Database1].[dbo].[CodeProjectTmp1]
FROM [DataBase2].[dbo].[CodeProjectTmp2]


The same logic will workout for INSERT INTO along with a SELECT statement.

You can also try OUTPUT clause in SQL server to tweak it

click here for more about OUTPUT clause
 
Share this answer
 
Comments
RaviRanjanKr 30-May-11 0:30am    
Perfect Answer,My 5 :)

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