SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 Help on data import/export needed
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

krainov
Yak Posting Veteran

57 Posts

Posted - 07/24/2012 :  04:42:19  Show Profile  Reply with Quote
Hi there!
Due to the changes in application architechture I need to write a SQL procedure to import old data to the new DB file.
Here is the old tables view:

And the new one:

What is the right way to do that?

Edited by - krainov on 07/24/2012 04:43:48

RickD
Slow But Sure Yak Herding Master

United Kingdom
3560 Posts

Posted - 07/24/2012 :  06:10:01  Show Profile  Reply with Quote
First thing is to map your columns between old and new, so from the above, MATERIAL_ID would map to ID in Material, SHOW would map to IsVisible etc..

From there, it is a case of bulking out the other columns with values (they may be defualt or condition based, you need to ask the architect or the BA questions to know what to put into the new fields).

Once you have found all this out, write a SELECT query that gets the data out of the old system in the new systems format, then go back to your BA and ask them if it looks correct, then write the INSERT.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.03 seconds. Powered By: Snitz Forums 2000