|
Posted by Igor on 08/30/06 10:25
OK thank you, I will try your solution. Unfortunately i'm limited to
MSSQL 2000 but thank you for you suggestion.
Erland Sommarskog wrote:
>
> It appears that you have to use the JOIN syntax, as in this example:
>
> CREATE TABLE #projects (id int NOT NULL,
> description ntext NULL)
> go
> CREATE TABLE #t (id int NOT NULL,
> descr ntext NOT NULL)
> go
> INSERT #projects (id) VALUES(21)
> INSERT #t(id, descr) VALUES (1, replicate('ABCD', 1000))
> go
> UPDATE #projects
> SET description = t.descr
> FROM #projects p
> CROSS JOIN #t t
> WHERE t.id = 1
> AND p.id = 21
> go
> SELECT * FROM #projects
> go
> DROP TABLE #projects, #t
>
> Note that if you are on SQL 2005, there is no reason to struggle with
> ntext. Use nvarchar(MAX) instead, which is a first-class cititez, but
> can fit just as much data as ntext.
>
> --
> Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se
>
> Books Online for SQL Server 2005 at
> http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
> Books Online for SQL Server 2000 at
> http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
Navigation:
[Reply to this message]
|