TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Chintan Dave
NA
67
37.3k
How to merge columns of two different tables into one table
Aug 21 2018 8:05 AM
DECLARE @String VaRCHAR(100) = 'Column1|Column2|Column3'
DECLARE @StringColumns VaRCHAR(100) = 'EmpID|EmpName|EmpDate'
Select 1 as Items,value as Columns1
from dbo.Split('|',@String)
Select 1 as Items,value as ColumnsTexts
from dbo.Split('|',@StringColumns)
These are the scripts for two sample tables which I would like to combine in a way given in screenshot.
Reply
Answers (
1
)
Microsoft SQL Server Management Studio 2012-14
not contained in either an aggregate function or the GROUPby