Reply to Re: BCP using ODBC - problem with unique identifier

Your name:

Reply:


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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация