TSQL - Nested a case statment to insert values into a table
Posted on 2011-03-08
I'm working on an insert / select statement for migrating data from one database to another.
The host DB has a flat table structure so I need to select a field which could be A, B or C for example and somehow convert this value so that A = 1, B = 2 and C= 3 in the destination table.
My script uses an insert and selecr statement to import the data? Being a newcomer to TSQL i', not sure what the best way to handle this would be? e.g Case Statement imbedded in the select clause?