Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Adding In HTML Links Expand / Collapse
Author
Message
Posted Monday, July 24, 2006 3:53 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Tuesday, February 12, 2008 5:57 PM
Points: 2, Visits: 2
Comments posted to this topic are about the content posted at http://www.sqlservercentral.com/columnists/gwilson/addinginhtmllinks.asp
Post #296903
Posted Tuesday, August 8, 2006 1:23 PM


Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Thursday, July 25, 2013 1:00 AM
Points: 53, Visits: 212
Interesting idea... I would lean towards applying this type of functionality as a business component of an application versus applying it at the database level. I'm also the guy that likes to put logs on the fire in the "Avoid Cursurs" camp.
Post #300384
Posted Tuesday, August 8, 2006 4:49 PM


Right there with Babe

Right there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with Babe

Group: General Forum Members
Last Login: Friday, January 17, 2014 11:05 AM
Points: 779, Visits: 222
I'd agree, probably best to avoid cursors. (Most) anytime you can offload iterative processing from the database into true recursive techniques using a different tool you're going to be better off.

Also, would it be better to use the REPLACE() function rather than PATINDEX()?
Post #300439
Posted Tuesday, August 8, 2006 8:27 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Tuesday, February 12, 2008 5:57 PM
Points: 2, Visits: 2
Aaron & Jason, thanks for the input.

Aaron, in regards to using the REPLACE() function - I didn't use it in this case, because the field being manipulated is a text, data type field. The REPLACE() function doesn't work on text fields. I generally store most web content in text fields because there is no size limitation.

Jason, I actually like to keep front and Ntier, application coding very generic, and offload complex coding to SQL Server, stored procedures when I can. I do get a lot of criticism for taking that strategy sometimes, but I think it makes life easier for applying application updates. I am a SQL server junkie.

thanks, Grey Wilson

Post #300463
Posted Wednesday, August 9, 2006 3:50 AM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Thursday, April 9, 2009 8:26 AM
Points: 13, Visits: 4

Nice idea.

I recently wrote some stored procedures that create hyperlinks, however there was a difference between what I did and what is described in this article.

I had to create hyperlinks to an intranet application, based upon dynamic content of the web page. The data from the database was to be used as an argument to an aspx web page.

Essentially, I used a stored procedure to pull data out of a database and then used .NET to populate the page. I had two choices as to how I displayed certain data fields within hyperlnks...

1. I could get the .NET code behind to do it on the fly. The problem with this was that if the server being linked to changed, someone would have to edit the code behind and re-compile the application. Not desireable as this is a complex application and not written using the normal Visual Studio method (Its written using Unix software development principles if anyone is interested)

2. I could get the stored procedure to output the hyperlinks directly instead of just the data field. This gets round the problem of having to re-compile the application to take account of any changes. The stored procedure is simply amended and re-run in SQL Server. This was beneficial because where I work there is a great deal more SQL server experience than there is Unix-style program development experience.

The way I did this was like this:-

Normal stored procedure snippet...

select mydatafield from mytable

Hyperlink snippet...

select 'http://myserver.net/mypath.aspx?' + 

         'myarg=' + mydatafield  as 'mydatafield'

from mytable

Simple! Isn't it?

Alastair

 

Post #300513
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse