entity framework code first and another database
Posted on 2013-01-12
I have an issue with a code first database. I have some data in a table that I copied to a new database so when I regenerate my code first db that I can copy it back.
If I create my code first db i can do inserts. If I create my db, delete a table, then restore it using a select into statement, I can no longer do inserts without having an issue with null ids (they are generated).
How can I copy data from one database table to another without deleting the first?
I am currently trying this:
SELECT * into [JTradeAdmin].[dbo].[OptionSettlementValues] FROM [JTradeAdminCopy].[dbo].[OptionSettlementValues]
but it requires me to delete the table first which gives me issues.