Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

SQL Encode Text String

12 views
Skip to first unread message

MS Forum Newsgroup User

unread,
Nov 23, 2009, 3:46:28 PM11/23/09
to
Hi,

Is there a equivalent of Server.HtmlEncode in SQL itself?

Thanks

Michael Coles

unread,
Nov 23, 2009, 3:58:57 PM11/23/09
to
No built-in functions, but you could create one with CLR or you could do it
in the client using the ASP.NET function you reference. See this post
http://www.sqlclr.net/Examples/tabid/55/articleType/ArticleView/articleId/31/Default.aspx
for a CLR solution.

"MS Forum Newsgroup User" <us...@microsoft.com> wrote in message
news:uOgoS4Hb...@TK2MSFTNGP06.phx.gbl...

Michael Coles

unread,
Nov 23, 2009, 3:59:56 PM11/23/09
to
Oops, that was the HTML Decode function. Here's HTML Encode:
http://www.sqlclr.net/Examples/tabid/55/articleType/ArticleView/articleId/30/Default.aspx

"MS Forum Newsgroup User" <us...@microsoft.com> wrote in message
news:uOgoS4Hb...@TK2MSFTNGP06.phx.gbl...

MS Forum Newsgroup User

unread,
Nov 23, 2009, 4:15:13 PM11/23/09
to
Thanks Michael, is there anything for Classic ASP similar?

Regards!

"Michael Coles" <michaelcoAToptonlineDOTnet> wrote in message
news:e$uzq$HbKHA...@TK2MSFTNGP05.phx.gbl...

Dan

unread,
Nov 24, 2009, 8:54:35 AM11/24/09
to

"MS Forum Newsgroup User" <us...@microsoft.com> wrote in message
news:OEDa9IIb...@TK2MSFTNGP06.phx.gbl...

You can't run "classic ASP" inside SQL Server. Assuming you mean VBScript,
you can't use that either.

If you're using ASP to interact with SQL Server, why would you need HTML
encoding in the SQL?

Either use the client (in this case ASP) to do the formatting, or use a CLR
(which needs to be in a .NET language, which Michael pointed you to).

--
Dan

0 new messages