Skip to main content
replaced http://stackoverflow.com/ with https://stackoverflow.com/
Source Link
URL Rewriter Bot
URL Rewriter Bot

Also you can use option with dynamic management function sys.dm_fts_parser
Before script execution you need check full-text component is installed:

SELECT FULLTEXTSERVICEPROPERTY ('IsFulltextInstalled')

0 = Full-text is not installed. 1 = Full-text is installed. NULL = Invalid input, or error.

If 0 = Full-text is not installed then this post is necessary to you How to install fulltext on sql server 2008?How to install fulltext on sql server 2008?

SELECT b.ID, b.Name, STUFF((
SELECT ',' + d.Dept
FROM Employees e 
  JOIN Departments d ON d.ID IN(
                                SELECT display_term 
                                FROM sys.dm_fts_parser('"' + e.Depts + '"', 1033, NULL, 0) 
                                WHERE display_term NOT LIKE 'nn%'
                                )
WHERE b.ID = e.ID
ORDER BY d.Dept
FOR XML PATH('')), 1, 1, '') AS Depts
FROM Employees b

OR

SELECT e.ID, e.Name, 
 (
  STUFF((
  SELECT ',' + Dept
  FROM sys.dm_fts_parser('"' + e.Depts + '"', 1033, NULL, 0) p JOIN Departments d ON p.display_term = d.ID
  WHERE display_term NOT LIKE 'nn%'
  FOR XML PATH('')), 1, 1, '')
  ) AS Depts
 FROM Employees e

Also you can use option with dynamic management function sys.dm_fts_parser
Before script execution you need check full-text component is installed:

SELECT FULLTEXTSERVICEPROPERTY ('IsFulltextInstalled')

0 = Full-text is not installed. 1 = Full-text is installed. NULL = Invalid input, or error.

If 0 = Full-text is not installed then this post is necessary to you How to install fulltext on sql server 2008?

SELECT b.ID, b.Name, STUFF((
SELECT ',' + d.Dept
FROM Employees e 
  JOIN Departments d ON d.ID IN(
                                SELECT display_term 
                                FROM sys.dm_fts_parser('"' + e.Depts + '"', 1033, NULL, 0) 
                                WHERE display_term NOT LIKE 'nn%'
                                )
WHERE b.ID = e.ID
ORDER BY d.Dept
FOR XML PATH('')), 1, 1, '') AS Depts
FROM Employees b

OR

SELECT e.ID, e.Name, 
 (
  STUFF((
  SELECT ',' + Dept
  FROM sys.dm_fts_parser('"' + e.Depts + '"', 1033, NULL, 0) p JOIN Departments d ON p.display_term = d.ID
  WHERE display_term NOT LIKE 'nn%'
  FOR XML PATH('')), 1, 1, '')
  ) AS Depts
 FROM Employees e

Also you can use option with dynamic management function sys.dm_fts_parser
Before script execution you need check full-text component is installed:

SELECT FULLTEXTSERVICEPROPERTY ('IsFulltextInstalled')

0 = Full-text is not installed. 1 = Full-text is installed. NULL = Invalid input, or error.

If 0 = Full-text is not installed then this post is necessary to you How to install fulltext on sql server 2008?

SELECT b.ID, b.Name, STUFF((
SELECT ',' + d.Dept
FROM Employees e 
  JOIN Departments d ON d.ID IN(
                                SELECT display_term 
                                FROM sys.dm_fts_parser('"' + e.Depts + '"', 1033, NULL, 0) 
                                WHERE display_term NOT LIKE 'nn%'
                                )
WHERE b.ID = e.ID
ORDER BY d.Dept
FOR XML PATH('')), 1, 1, '') AS Depts
FROM Employees b

OR

SELECT e.ID, e.Name, 
 (
  STUFF((
  SELECT ',' + Dept
  FROM sys.dm_fts_parser('"' + e.Depts + '"', 1033, NULL, 0) p JOIN Departments d ON p.display_term = d.ID
  WHERE display_term NOT LIKE 'nn%'
  FOR XML PATH('')), 1, 1, '')
  ) AS Depts
 FROM Employees e
added 311 characters in body
Source Link

Also you can use option with dynamic management function sys.dm_fts_parser
Before script execution you need check full-text component is installed:

SELECT FULLTEXTSERVICEPROPERTY ('IsFulltextInstalled')

0 = Full-text is not installed. 1 = Full-text is installed. NULL = Invalid input, or error.

If 0 = Full-text is not installed then this post is necessary to you How to install fulltext on sql server 2008?

SELECT b.ID, b.Name, STUFF((
SELECT ',' + d.Dept
FROM Employees e 
  JOIN Departments d ON d.ID IN(
                                SELECT display_term 
                                FROM sys.dm_fts_parser('"' + e.Depts + '"', 1033, NULL, 0) 
                                WHERE display_term NOT LIKE 'nn%'
                                )
WHERE b.ID = e.ID
ORDER BY d.Dept
FOR XML PATH('')), 1, 1, '') AS Depts
FROM Employees b

OR

SELECT e.ID, e.Name, 
 (
  STUFF((
  SELECT ',' + Dept
  FROM sys.dm_fts_parser('"' + e.Depts + '"', 1033, NULL, 0) p JOIN Departments d ON p.display_term = d.ID
  WHERE display_term NOT LIKE 'nn%'
  FOR XML PATH('')), 1, 1, '')
  ) AS Depts
 FROM Employees e

Also you can use option with dynamic management function sys.dm_fts_parser
Before script execution you need check full-text component is installed:

SELECT FULLTEXTSERVICEPROPERTY ('IsFulltextInstalled')

0 = Full-text is not installed. 1 = Full-text is installed. NULL = Invalid input, or error.

If 0 = Full-text is not installed then this post is necessary to you How to install fulltext on sql server 2008?

SELECT b.ID, b.Name, STUFF((
SELECT ',' + d.Dept
FROM Employees e 
  JOIN Departments d ON d.ID IN(
                                SELECT display_term 
                                FROM sys.dm_fts_parser('"' + e.Depts + '"', 1033, NULL, 0) 
                                WHERE display_term NOT LIKE 'nn%'
                                )
WHERE b.ID = e.ID
ORDER BY d.Dept
FOR XML PATH('')), 1, 1, '') AS Depts
FROM Employees b

Also you can use option with dynamic management function sys.dm_fts_parser
Before script execution you need check full-text component is installed:

SELECT FULLTEXTSERVICEPROPERTY ('IsFulltextInstalled')

0 = Full-text is not installed. 1 = Full-text is installed. NULL = Invalid input, or error.

If 0 = Full-text is not installed then this post is necessary to you How to install fulltext on sql server 2008?

SELECT b.ID, b.Name, STUFF((
SELECT ',' + d.Dept
FROM Employees e 
  JOIN Departments d ON d.ID IN(
                                SELECT display_term 
                                FROM sys.dm_fts_parser('"' + e.Depts + '"', 1033, NULL, 0) 
                                WHERE display_term NOT LIKE 'nn%'
                                )
WHERE b.ID = e.ID
ORDER BY d.Dept
FOR XML PATH('')), 1, 1, '') AS Depts
FROM Employees b

OR

SELECT e.ID, e.Name, 
 (
  STUFF((
  SELECT ',' + Dept
  FROM sys.dm_fts_parser('"' + e.Depts + '"', 1033, NULL, 0) p JOIN Departments d ON p.display_term = d.ID
  WHERE display_term NOT LIKE 'nn%'
  FOR XML PATH('')), 1, 1, '')
  ) AS Depts
 FROM Employees e
added 101 characters in body
Source Link

Also you can use option with dynamic management function sys.dm_fts_parser
Before script execution you need check full-text component is installed:

SELECT FULLTEXTSERVICEPROPERTY ('IsFulltextInstalled')

0 = Full-text is not installed. 1 = Full-text is installed. NULL = Invalid input, or error.

If 0 = Full-text is not installed then this post is necessary to you How to install fulltext on sql server 2008?

SELECT b.ID, b.Name, STUFF((
SELECT ',' + d.Dept
FROM Employees e 
  JOIN Departments d ON d.ID IN(
                                SELECT display_term 
                                FROM sys.dm_fts_parser('"' + e.Depts + '"', 1033, NULL, 0) 
                                WHERE display_term NOT LIKE 'nn%'
                                )
WHERE b.ID = e.ID
ORDER BY d.Dept
FOR XML PATH('')), 1, 1, '') AS Depts
FROM Employees b

Also you can use option with dynamic management function sys.dm_fts_parser
Before script execution you need check full-text component is installed

SELECT b.ID, b.Name, STUFF((
SELECT ',' + d.Dept
FROM Employees e 
  JOIN Departments d ON d.ID IN(
                                SELECT display_term 
                                FROM sys.dm_fts_parser('"' + e.Depts + '"', 1033, NULL, 0) 
                                WHERE display_term NOT LIKE 'nn%'
                                )
WHERE b.ID = e.ID
ORDER BY d.Dept
FOR XML PATH('')), 1, 1, '') AS Depts
FROM Employees b

Also you can use option with dynamic management function sys.dm_fts_parser
Before script execution you need check full-text component is installed:

SELECT FULLTEXTSERVICEPROPERTY ('IsFulltextInstalled')

0 = Full-text is not installed. 1 = Full-text is installed. NULL = Invalid input, or error.

If 0 = Full-text is not installed then this post is necessary to you How to install fulltext on sql server 2008?

SELECT b.ID, b.Name, STUFF((
SELECT ',' + d.Dept
FROM Employees e 
  JOIN Departments d ON d.ID IN(
                                SELECT display_term 
                                FROM sys.dm_fts_parser('"' + e.Depts + '"', 1033, NULL, 0) 
                                WHERE display_term NOT LIKE 'nn%'
                                )
WHERE b.ID = e.ID
ORDER BY d.Dept
FOR XML PATH('')), 1, 1, '') AS Depts
FROM Employees b
added 101 characters in body
Source Link
Loading
added 153 characters in body
Source Link
Loading
Source Link
Loading