I. Split line use SQL:
I have a table like this
Id commaseperatedstring
1 A, B, C, D, E
2 x, y, z
What I want is to convert this
Id text
1
1 B
1 c
2 x
2 y
Like this.
Answer:
Select
T. ID, right(left(t.csv, number-1 ),
Charindex(',', reverse(left(','{t.csv, number-1 ))))
From
Master .. spt_values,
Your_table t
Where
Type = 'p' and number between 1 and len(t.csv) + 1
And (substring(t.csv, number, 1) = ',' or substring(t.csv, number, 1) = '')
Source: http://www.sql-server-performance.com/forum/threads/csv-to-columns.32141/#post-166346
Ii. Update a table's column inner join another table by a relative Column
Update a set a. Name = csrname from B join (select ID, csrname from B) as B on A. fkid = B. ID
Iii. Execute SQL file using command in SQL Server 2008
Osql-s "127.0.0.1"-U "sa"-P "sa"-d "northwind"-I "% Cd % \ 1. SQL"
Iv. Using sscm (SQL Server migration Assistant) to migrate data from Oracle to SQL Server
Just click "next" refer to this artice: http://www.cnblogs.com/yinc/archive/2011/07/24/2115345.html, it is useful and convenient.