sql server - Migrate data from non Normalized database to a well Design database -


I am migrating from a bad design table to a new general in sqlserver 2008.
My goal here is to find the total number of records in the source table store in a variable, enter each row through the loop and the destination table. I've done many searches on similar posts:

: and

but was able to modify a code - now get this error:

  Message 207, Level 16, State 1, Line 5 Invalid column name 'Num_Row_in_table'  

Code:

  entry @ INT DECLARE @Num_Row_in_table int SET @ I = 1 WHILE (@ and & lt; = Num_Row_in_table) Insert into the destination table (first name, last name, photo, SN) (MyDB.dbo.sourcetable from FirstName, LASTNAME, Photo, SN) SET @ I = @ I + 1 END  

Forget the sign; Just do this:

  Insert in the destination location (first name, last name, photo, SN) MyDB.dbo.sourcetable before name, LASTNAME, Photo, SN Select  < / Pre> 

Comments

Popular posts from this blog

java - Can't add JTree to JPanel of a JInternalFrame -

javascript - data.match(var) not working it seems -

javascript - How can I pause a jQuery .each() loop, while waiting for user input? -