How to created this type file in runtime.

Posted by Jayakumars under C# on 3/22/2017 | Points: 10 | Views : 275 | Status : [Member] [MVP] | Replies : 3
Hi

How to Create Html File using Sql server .

I have mention my Data like this when i run procedure i need generated
Html File using sql server only. How will do this any one guide me

My Table output this

Id Name Content
1 John <html><a1>Test1</a1></html>
2 David <html><a1>Test2</a1></html>
3 Refel <html><a1>Test3</a1></html>

1.html contains

1 John <html><a1>Test1</a1></html>

etc...

Mark as Answer if its helpful to you


Responses

Posted by: Rajnilari2015 on: 3/22/2017 [Member] [Microsoft_MVP] [MVP] Platinum | Points: 25

Up
0
Down
@Jayakumars Sir,please try this

DECLARE @T TABLE(Data VARCHAR(100))
INSERT INTO @T VALUES('1 John <html><a1>Test1</a1></html>')
INSERT INTO @T VALUES('2 David <html><a1>Test2</a1></html>')
INSERT INTO @T VALUES('3 Refel <html><a1>Test3</a1></html>')

SELECT
Id = PARSENAME(Data, 3)
,Name=PARSENAME(Data, 2)
,Content = PARSENAME(Data, 1)
FROM
(SELECT Data = REPLACE(Data,' ','.')
FROM @T)X


/*
Result
---------

Id Name Content
1 John <html><a1>Test1</a1></html>
2 David <html><a1>Test2</a1></html>
3 Refel <html><a1>Test3</a1></html>

*/




--
Thanks & Regards,
RNA Team

Jayakumars, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Jayakumars on: 3/23/2017 [Member] [MVP] Bronze | Points: 25

Up
0
Down
Hi
Thanks your reply. But your reply not suitable for me.
Because My Question I have Data in my table thats no problem

when i run my procedure i need some path created html file only with this table Data
thats my requirement .

can you try and post



Mark as Answer if its helpful to you

Jayakumars, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Drivingdirections on: 3/23/2017 [Member] Starter | Points: 25

Up
0
Down
Thanks for the guide, it's useful!
https://sites.google.com/site/drivingdirection2017/

Jayakumars, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response