Re: BCP using ODBC - problem with unique identifier
- From: "tha_mihau" <mpietrzyk@xxxxxxxxxxx>
- Date: 12 Jul 2006 00:21:50 -0700
Erland Sommarskog wrote:
tha_mihau (mpietrzyk@xxxxxxxxxxx) 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.
.
- Prev by Date: Re: 2005: calling .NET procedure - one more question
- Next by Date: Re: 2005: using SMO
- Previous by thread: 955585 - Limited Term Employee / Infrastructure...position at hewlett Packard
- Next by thread: vba sql server connection
- Index(es):