LouiseWong


I have a table filetable(id int, content ntext), when I invoke textcopy.exe (c:\textcopy /S servername /U sa /P apasswd /D filedatabase /T filetable /C content /W "where file_id=1" /F c:\a.txt /I)to import file content to a table's column whose datatype is ntext, I always get error warning as follows follows:


TEXTCOPY Version 1.0
DB-Library version 8.00.2039
SQL Server 'servername' Message 4004: Unicode data in a Unicode-only collation or ntext data cannot be sent to clients using DB-Library (such as ISQL) or ODBC version 3.7 or earlier. (Concerning line 1)
DB-Library Error 10007: General SQL Server error: Check messages from the SQL Server.
ERROR: Query execution failed.
NULL

who can help me to import file to a ntext column and don't need modify the column datatype thanks.




Re: import file to ntext column by textcopy.exe

vk_rajkumar


hi,

could Please tell me Presently which sql server version you are using

in the latest version of sqlserver 2005 , there is no features for Textcopy.exe {i am not sure, i tried, i couldn't able to findout the features}.

you need to copy the file from the sql server 2000.

i tried something.. i got same problem,

so, i copeid the textcopy.exe and ntwdblib.dll from the sqlserver 2000

and paste it in the server local dir. and use that dir

like,

master..cmdshell 'c:\textcopy.exe',@DBName,'sa','pwd','tablename','BlobContents',@cndtn,@attachmentfilename,'O'

and its works fine.

try it.

thanks







Re: import file to ntext column by textcopy.exe

Satya SKJ

He is on SQL 2000 as you can see 8.00 .... number there.

It's the SQL Server complaining that it doesn't support pure Unicode via TDS or older versions of ODBC. There's no fix for this error. Microsoft has deprecated DB-Library a long ago, in favor of ODBC, OLE DB, or SQL Native Client. Many new features of SQL 2005 aren't accessible via DB-Library so if you need them, you have to switch away from pymssql or other tools based on TDS and DB-Library.

A workaround is to change the column type to NVARCHAR (it doesn't exhibit this behaviour), or TEXT.







Re: import file to ntext column by textcopy.exe

Kunal

Hi Raj,

I agree that this will work. But what is the guarantee that this will keep working after applying the latest service packs (which microsoft is good at making)

Did you contact any Microsoft technician for the solution that you have provided

Thanks,






Re: import file to ntext column by textcopy.exe

vk_rajkumar

hi kunal,

i posted the query about the textcopy.exe, but there is no repponse for that.

so, i drop the concept and i tried in different concepts like below ,

using CLR enable sql procedure in sql Server 2005 ,[To download file from the blob field]

http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=1492979&SiteID=1

Thanks






Re: import file to ntext column by textcopy.exe

sohst

Hi,

I used the texcopy.exe utility as indicated in your post for a SQL 2005 database to extract an image. The utility returned no error and created the named image file, but truncated it. Instead of heaving x bytes in that file (a bigger .jpg file), it contained only 1 kb of unreadable binary data.

Do you have any idea from what this could come from / how to extract the whole data from the image row of a table

Thanks for your efforts!
Wolfgang / Berlin, Germany