Quantcast
Channel: Forum Getting started with SQL Server
Viewing all articles
Browse latest Browse all 7129

string replace and regnerate

$
0
0

need to get new column with url for each item in the csv coloumn. we can predefine the csv

CREATE TABLE [dbo].[Table_2](
	[items] [nchar](10) NULL,
	[url_desc] [nvarchar](250) NULL
) ON [PRIMARY]
GO
INSERT [dbo].[Table_2] ([items], [url_desc]) VALUES (N'ms,goo,bi ', N'http:\\www.bing.com')
INSERT [dbo].[Table_2] ([items], [url_desc]) VALUES (N'gm,hm,ya  ', N'www.hotmail.com')
INSERT [dbo].[Table_2] ([items], [url_desc]) VALUES (N'ms,hm,bi  ', N'www.microsoft.com')

My values can be hardcoded.. for writing case below .

expected result

http:\\www.microsoft.com, http:\\www.google.com,http:\\www.bing.com
www.gmail.com, www.hotmail.com,www.yahoo.com
www.microsoft.com, www.hotmail.com,www.bing.com


ShanmugaRaj


Viewing all articles
Browse latest Browse all 7129

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>