显示标签为“develop”的博文。显示所有博文
显示标签为“develop”的博文。显示所有博文

2012年3月27日星期二

BCP with ODBC Native driver

We are using Visual Studio 2003 to develop a VC++ application to support SQL Server 2000 and 2005 through ODBC driver. I was able to successfully test the application with ODBC driver for 2000. But when it comes to the SQL Server 2005 using native ODBC driver it fails with "ODBCBCP.dll is not compatible with 'SQL Native Client' driver. Please configure 'SQL Server' driver for the DSN or connection string.

Then I tried to use the sqlncli.h inplace of odbcss.h and replaced the odbcbcp.lib with sqlncli.lib pointing to the C:\Program Files\Microsoft SQL Server\90\SDK\Lib\x86 folder.

Code Snippet

#include <sql.h>

#include <sqlext.h>

#include <sqltypes.h>

#define _SQLNCLI_ODBC_

#include <sqlncli.h>

Now I can not compile the program. The errors I am getting are as follows:

c:\Program Files\Microsoft SQL Server\90\SDK\Include\sqlncli.h(2894): error C2061: syntax error : identifier 'DB_UPARAMS'

c:\Program Files\Microsoft SQL Server\90\SDK\Include\sqlncli.h(2901): error C2061: syntax error : identifier 'DB_UPARAMS'
etc

c:\Program Files\Microsoft SQL Server\90\SDK\Include\sqlncli.h(2938): error C2061: syntax error : identifier 'HCHAPTER'
c:\Program Files\Microsoft SQL Server\90\SDK\Include\sqlncli.h(2944): error C2061: syntax error : identifier 'HCHAPTER'
etc

The same code just works fine in the Visual Studio 2005, but we need the dll in Visual studio 2003.

I think I am missing pretty obvious. Your help is appreciated.

Can you try not defining _SQLNCLI_ODBC_, I believe that would work.

Thanks

Waseem

sql

2012年2月9日星期四

basic replication question

I'm interested in creating a replicated SQL server database on my laptop to develop without having to be connected to the network. I'd like to make changes and then synchronize when connected, both data and design changes. With SQL it looks like replication only applies to data and not to schema, stored procedures, dts packages, etc.

Do I understand this correctly.Do I understand this correctly.
Nope.

See
Schema changes under replication in bol.
A stored proc can be an published article.
DTS packages are stored in msdb..sysdtspackages if you keep them in sql server and you can copy them by copying the contents of this table.
It's usually easier just to copy all the stored procs too.

Have you thuoght about restoring a backup rater than replication which has quite a large learning curve and administrative overhead.