|
Posted by tha_mihau on 07/12/06 07:21
Erland Sommarskog wrote:
> tha_mihau (mpietrzyk@autograf.pl) writes:
> > 1. Using SQLVARCHAR instead of SQLUNIQUEID results in "[Microsoft][ODBC
> > SQL Server Driver]Invalid character value for cast specification". What
> > do you meas format of the UID? You mean in the input file? in the input
> > file it is in "text format", like presented in my first post.
>
> The error message means that the string does not convert to a GUID.
> This could be because you have not specified the appropriate length or
> delimiter. I would try with 36 in length and no terminator.
>
> > 2. Setting length (for SQLUNIQUEID) different then 16 results in FAIL
> > result in bcp_bind.
>
> Since you have text input, you should not use SQLUNIQUEID, unless you
> convert the value in your program prior to passing it to BCP.
Thx, Erland!
Running
bcp_bind (m_hDbproc, (LPCBYTE)data, 0, 36, (LPCBYTE)NULL, 0,
SQLVARCHAR, colNo)
on a file with GUIDs with no braces did the trick.
Works like a charm.
Thanks again, M.
[Back to original message]
|