开发者

TSQL or SSIS convert Columns into Rows

开发者 https://www.devze.com 2023-03-05 06:25 出处:网络
Could anyone please suggest how to achieve the following开发者_JAVA技巧? i.e. convert columns in to rows using either TSQL or SSIS:

Could anyone please suggest how to achieve the following开发者_JAVA技巧? i.e. convert columns in to rows using either TSQL or SSIS:

e.g. from this:

col1    col2
start   end

to this:

start
end

from this:

col1    col2    col3    col4
start   break   start   end

to this:

start
break
start
break

Thank you.


Thanks @Dalex for your answer.

Since I'm using SSIS I ended up using Unpivot Transformation Task which required no code.

0

精彩评论

暂无评论...
验证码 换一张
取 消