PontiacCZ
IS-IT--Management
- Feb 16, 2011
- 2
Hello,
I am trying to load a text file (HTML actually) and replace already existing table field (of "text" data type) with this file's content.
SQL server: 8.0 (SQL 2000 standard)
table: KART_CUSTOMERS
column: Data
input file: C:\temp\input.html
With help of web resources I was able to construct these SQL commands:
After running this I get following error:
Msg 186, Level 15, State 1, Server HP14281105721, Line 7
Data stream missing from WRITETEXT statement.
Yes, I feel the C:\temp\input.html; part is not correct. But if I put the filename into quotes, it would insert the filename itself (have just tried it ).
The official manual ( only says:
data
Is the actual text, ntext or image data to store. data can be a literal or a variable. The maximum length of text that can be inserted interactively with WRITETEXT is approximately 120 KB for text, ntext, and image data.
So what is the correct syntax for redirecting the input from a file?
I am trying to load a text file (HTML actually) and replace already existing table field (of "text" data type) with this file's content.
SQL server: 8.0 (SQL 2000 standard)
table: KART_CUSTOMERS
column: Data
input file: C:\temp\input.html
With help of web resources I was able to construct these SQL commands:
Code:
DECLARE @ptrval binary(16);
SELECT @ptrval = TEXTPTR(Data)
FROM KART_CUSTOMERS KC
WHERE KC.CUSTOMER_ID = 'T0000' AND ID = 0;
WRITETEXT KART_CUSTOMERS.Data @ptrval C:\temp\input.html;
After running this I get following error:
Msg 186, Level 15, State 1, Server HP14281105721, Line 7
Data stream missing from WRITETEXT statement.
Yes, I feel the C:\temp\input.html; part is not correct. But if I put the filename into quotes, it would insert the filename itself (have just tried it ).
The official manual ( only says:
data
Is the actual text, ntext or image data to store. data can be a literal or a variable. The maximum length of text that can be inserted interactively with WRITETEXT is approximately 120 KB for text, ntext, and image data.
So what is the correct syntax for redirecting the input from a file?