Abbas
Abbas

Reputation: 5044

Image Path using T-Sql

i am newbie in sql server, my requirement is i want to get the image path from the database field, but stuck what could be the query can anyone out there help me with this.

this is my format

<div align=center><imge src=/portals/0/logo.gif width=279 height=86 /></div>

i need /portals/0/logo.gif from the above html, using t-sql

Upvotes: 0

Views: 160

Answers (1)

Kevin Stricker
Kevin Stricker

Reputation: 17388

You would want your database table to look something more like this to avoid the problem of parsing the filename out of that HTML in the first place. You can always reconstruct the if you have all the varying data stored separately in the database.

CREATE TABLE images (
    id int IDENTITY,
    path nvarchar(255),
    width int,
    height int
)

If you have some existing data you just want to extract file names from, I would recommend using a tool other than an RDBMS.

Upvotes: 1

Related Questions