Create full-text decimal / coloumn pointer, maybe ????? (SQL Server 2008)

I would like to create a full-text index for several columns, which are varcharsnumbers. And there is a problem with numbers.

Is there no way to add a column as a number or decimal for a full-text index?

I have, for example, an article in a table:

CREATE TABLE article
(   articleid   number(10)  not null,
    articlename     varchar(50)     not null,
    articlecode1    varchar(50)
);

CREATE FULLTEXT CATALOG MyCatalog;

CREATE FULLTEXT INDEX ON artikel
     (articleid LANGUAGE 0x0,
      articlename LANGUAGE 0x0,
      articlecode1 LANGUAGE 0x0)
KEY INDEX PK_ARTICLE ON MyCatalog
WITH CHANGE_TRACKING AUTO;

It is impossible to create, because it articleidis a number!

My alternative solution is to create a second column, such as articleidtext varchar, as a copy of the article. Fill the trigger later.

Is there no other way?

I also tried Cast as: CAST(articleid AS varchar) LANGUAGE 0x0it doesn't work either.

any other suggestion

THX ...

+3
source share
3 answers

, VARCHAR articleId - -, articleId, VARCHAR, , , :

ALTER TABLE dbo.article
ADD ArticleIDText AS CAST(ArticleID AS VARCHAR(20)) PERSISTED

ArticleIDText, ...

+2

Fulltext , . , , .

, !?

0

fulltext only works with types:

char, varchar, nchar, nvarchar, text, ntext, image, xml or varbinary (max)

0
source

Source: https://habr.com/ru/post/1788480/


All Articles