Click here to Skip to main content
15,560,618 members
Home / Discussions / Database
   

Database

 
GeneralRe: mysql decimal fromat like ##.## Pin
Shweta N Mishra23-Nov-14 3:06
professionalShweta N Mishra23-Nov-14 3:06 
GeneralRe: mysql decimal fromat like ##.## Pin
Gilbert Consellado24-Nov-14 13:47
professionalGilbert Consellado24-Nov-14 13:47 
QuestionProblem in Insering Long text in mysql from c# Pin
Ramachandra12720-Nov-14 8:09
Ramachandra12720-Nov-14 8:09 
GeneralRe: Problem in Insering Long text in mysql from c# Pin
PIEBALDconsult20-Nov-14 8:33
professionalPIEBALDconsult20-Nov-14 8:33 
QuestionSQL Replace Function - error recognizing two or more strings Pin
miss78618-Nov-14 0:44
miss78618-Nov-14 0:44 
AnswerRe: SQL Replace Function - error recognizing two or more strings Pin
Richard Deeming18-Nov-14 3:53
mveRichard Deeming18-Nov-14 3:53 
GeneralRe: SQL Replace Function - error recognizing two or more strings Pin
miss78618-Nov-14 4:53
miss78618-Nov-14 4:53 
GeneralRe: SQL Replace Function - error recognizing two or more strings Pin
Richard Deeming18-Nov-14 7:00
mveRichard Deeming18-Nov-14 7:00 
I can't reproduce the problem using your SQL Fiddle data and the code I posted.


<Body><p align="justify">One is a 1m block of <a href="pagename.aspx?tag=AIREM 2006-1X 2A3>AIREM 2006-1X 2A3</a>, which has never appeared on SMO.<p></Body>


<body>It consists of: <a href="pagename.aspx?tag=BANKP>BANKP</a>, <a href="pagename.aspx?tag=BCJA>BCJA</a>, <a href="pagename.aspx?tag=BCJA>BCJA</a>M, <a href="pagename.aspx?tag=<a href="pagename.aspx?tag=BFTH>BFTH</a>><a href="pagename.aspx?tag=BFTH>BFTH</a></a>, <a href="pagename.aspx?tag=<a href="pagename.aspx?tag=BFTH>BFTH</a>><a href="pagename.aspx?tag=BFTH>BFTH</a></a>, and <a href="pagename.aspx?tag=EMPOP>EMPOP</a>.</body>


SQL
DECLARE @XML nvarchar(max);

SELECT
  @XML = XML
FROM
  article
WHERE
  id = '1'
;

SELECT
  @XML = Replace(@XML, [Name], N'<a href="pagename.aspx?tag=' + [Name] + N'>' + [Name] + N'</a>')
FROM
  [dbo].[database_tags]
WHERE
  @XML LIKE N'%' + [Name] + N'%'
;

SELECT @XML As Result;


NB: You should avoid using text, ntext or image types in SQL. They are deprecated and will be removed in a future version[^]. Use varchar(max), nvarchar(max) and varbinary(max) instead.



"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer


GeneralRe: SQL Replace Function - error recognizing two or more strings Pin
PhilLenoir18-Nov-14 11:41
professionalPhilLenoir18-Nov-14 11:41 
GeneralRe: SQL Replace Function - error recognizing two or more strings Pin
miss78620-Nov-14 2:45
miss78620-Nov-14 2:45 
GeneralRe: SQL Replace Function - error recognizing two or more strings Pin
PhilLenoir20-Nov-14 4:13
professionalPhilLenoir20-Nov-14 4:13 
AnswerRe: SQL Replace Function - error recognizing two or more strings Pin
PhilLenoir18-Nov-14 4:41
professionalPhilLenoir18-Nov-14 4:41 
Questionsuggest various tables for shopping site Pin
smart_vikas12-Nov-14 19:53
smart_vikas12-Nov-14 19:53 
AnswerRe: suggest various tables for shopping site Pin
Jörgen Andersson12-Nov-14 20:59
professionalJörgen Andersson12-Nov-14 20:59 
AnswerRe: suggest various tables for shopping site Pin
Mycroft Holmes12-Nov-14 23:40
professionalMycroft Holmes12-Nov-14 23:40 
QuestionRe: suggest various tables for shopping site Pin
Eddy Vluggen13-Nov-14 8:18
professionalEddy Vluggen13-Nov-14 8:18 
AnswerRe: suggest various tables for shopping site Pin
PIEBALDconsult13-Nov-14 8:35
professionalPIEBALDconsult13-Nov-14 8:35 
QuestionLONGTEXT not accepting large text! Pin
Jassim Rahma12-Nov-14 10:15
Jassim Rahma12-Nov-14 10:15 
AnswerRe: LONGTEXT not accepting large text! Pin
PIEBALDconsult12-Nov-14 10:20
professionalPIEBALDconsult12-Nov-14 10:20 
GeneralRe: LONGTEXT not accepting large text! Pin
Jassim Rahma12-Nov-14 10:51
Jassim Rahma12-Nov-14 10:51 
AnswerRe: LONGTEXT not accepting large text! Pin
Richard Deeming12-Nov-14 10:55
mveRichard Deeming12-Nov-14 10:55 
GeneralRe: LONGTEXT not accepting large text! Pin
Jassim Rahma12-Nov-14 10:59
Jassim Rahma12-Nov-14 10:59 
GeneralRe: LONGTEXT not accepting large text! Pin
Richard Deeming12-Nov-14 11:03
mveRichard Deeming12-Nov-14 11:03 
GeneralRe: LONGTEXT not accepting large text! Pin
Jassim Rahma12-Nov-14 11:08
Jassim Rahma12-Nov-14 11:08 
GeneralRe: LONGTEXT not accepting large text! Pin
Richard Deeming12-Nov-14 11:12
mveRichard Deeming12-Nov-14 11:12 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.