ODBC Batch Insert Error On Windows 64 Bit Machine.
Jan 16, 2008
I€™m facing a SQL batch insert issue on Windows 64 bit (IA-64) platform. I€™m using €˜Column-Wise Binding€™ of parameters. The example program hosted on Microsoft site (http://msdn2.microsoft.com/en-us/library/ms709287.aspx) returns error of SQL_NEED_DATA for batch insert on Windows 64 bit platform. The same code works fine on 32 bit platform. I€™m using SQL Server 2000 as the database and tried using both native SQL server ODBC driver and Merant 5.2 ODBC drivers. Any help on this will be greatly appreciated.
View 5 Replies
ADVERTISEMENT
Apr 11, 2007
Hi all,
When I run the following T-SQL statement using SQLExecDirect with the SQL Server ODBC driver, it seems to indicate to me that the driver is somehow treating the SQL as a batch rather than a single statement.
Code Snippet
IF (1=1)
UPDATE MyTable
SET [Guid] = 'A663EC5D-A3AF-4391-8C45-9EBE87C9FD6C',
[Id] = 1
[FieldA] = 'Always run'
WHERE ([ID] = 1)
ELSE
INSERT INTO MyTable ([Guid],[Id],[FieldA]) VALUES (NEWID(), 2,'Never run')
Now the above statement is only a simplified statement to illustrate my problem, but I've also tested this stripped down version to ensure that I could replicate the problem with it.
Assuming I have the following table definition and data, I would expect that SQLExecDirect return SQL_ERROR due to the unique key constraint being violated on the [guid] column. However, I'm getting a SQL_SUCCESS_WITH_INFO error.
Code Snippet
CREATE TABLE MyTable
(
[Guid] uniqueidentifier,
[Id] int,
[FieldA] varchar(100)
)
INSERT INTO MyTable ([Guid],[Id],[FieldA]) VALUES (NEWID(), 1,'A')
INSERT INTO MyTable ([Guid],[Id],[FieldA]) VALUES (NEWID(), 1,'B')
According to a MS knowledge base article 195297:
In the version 3.6 SQL Server ODBC driver, SQLExecute, SQLExecDirect, or SQLParamData returns SQL_ERROR only if no other statements are executed after the first statement. If any other statements are executed after the first, even a simple RETURN statement with no return value, SQLExecute or SQLExecDirect returns SQL_SUCCESS_WITH_INFO
This makes me think that somehow the SQL Server driver is treating the T-SQL (with IF-ELSE) as a batch of statements (normally delimited with semi colon e.g. "statement1; statement2;").
I'm running MSDE, with SQL Server driver (SQLSRV32.DLL) v2000.85.1117.00 on Windows XP Professional SP2.
However, running the same SQL but changing the driver to the SQL Native Client (SQLNCLI.DLL) v2005.90.1399.00 returns SQL_ERROR as I expect.
Also the same SQL returns the desired error using both SQL Server and SQL Native Client drivers when connecting to SQL Server 2005.
So in summary:
Driver MSDE SQL Server 2005
{SQL Server} SQL_SUCCESS_WITH_INFO SQL_ERROR
{SQL Native Client} SQL_ERROR SQL_ERROR
Is there any settings that I need to set? Does anybody have any ideas?
Any help greatly appreciated!
View 3 Replies
View Related
Feb 21, 2008
I have create a batch file, that creates an ODBC then updates the application datasource key in the registry to the new system dsn name.
The problem is that the new DSN doesn't work when i try and connect the application...but if i had manually created the odbc source the app connects as expected... i have checked the registry and there is no difference between the two dsns created...but the application throws IM002[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified after i have also changed the applications registry key to point to the new database.
Now the interesting things to note are that when i re-create the odbc to the old server and database (sql 2000) by batch file it works fine. The new ODBC is linking to a sql 2005 database, but it is still using the 2000 drivers and when i manually created it, it worked also.
Another interesting thing is that if i go into the odbc dsn and click configure, go through and test the connection it works fine... after i close this i then retry the application and it opens correctly...
I need this to be automated with no manual intervention, as this will be added to a large group of users login scripts!
Any help greatly appreciated.
My batch file code is as below:
ODBCCONF.exe CONFIGSYSDSN "SQL Server" "DSN=RMS Live 2005 | SERVER=d-db99sql2005| Trusted_Connection=Yes | Database=RMS-Livedb"
View 4 Replies
View Related
Mar 8, 2008
Hi,
First, I would like to apologize if this is in anyway not related to Transact-SQL. And I would greatly appreciate your help for this is an urgent requirement. I just have a batch file which performs an ftp. Now, if the ftp process aborts, i would like to send out a mail and page the on-call person. I am not sure how to do this - I mean how to send email and send message through pager. My batch file is called by the Windows scheduler.
Thanks in advance.
View 7 Replies
View Related
Mar 11, 2008
Developed reports in SSRS on local (32 bit) PC for ODBC connection (32 bit - Intersystems Cache database) - worked OK.
Deployed report to (64 bit) server, using same (32 bit) ODBC driver - report failed.
Aware of SSIS Run64BitRuntime flag that (apparently) allows use of 32 bit ODBC driver on 64 bit server.
Is there something similar in SSRS?
Or, a work around?
What other alternatives?
Wait for 64 bit ODBC driver for Cache database?
Wait for Run64BitRuntime flag to be included in SSRS?
Give up and use Crystal?
View 1 Replies
View Related
Nov 13, 2007
Hi,
Am new to SQL Server 2005...actually this is my first day with it
am trrying to connect to SQL Server which resides on a 64-bit machine from a 32-bit machine using ODBC with a DSN aliasing thing
it gives me error msg "login failed for user XXX" with error state indicating that password missmatch or sometimes invalid user!!
i dont use the password i keep it blank and checked everything i could possibly think of...
regards,
View 1 Replies
View Related
Jul 23, 2005
Hello.How to execute add users window, backup wizard and other windows fromEnterprice Manager on client machine? Does MDAC or sth is able to do this?bye...--__ __|__\ | || |_// / \ \_// FreeBSD: The Power To Serve|__// |__|| | \ \__// / \ +------------------------------++[ http://bukox.prv.pl ][ http://total.bukox.dmkproject.pl ]+
View 1 Replies
View Related
Apr 23, 2015
I'm running windows 8.1 with SQL.Server.2012.
I've admin permissions on the PC but can't access SSIS because Access is denied like below.
However the solution proposed below is not appropriate for me as I can't find DCOM User Group Membership on my Windows 8.1 machine.
[URL]
View 2 Replies
View Related
Mar 9, 2015
How to append an hostname/computername to a text file using windows batch command?
View 1 Replies
View Related
Jul 20, 2005
Hi,I am facing one more problem. As soon as i started the sql server firsttime, my windows 2000 machine reboots and i was not able to start sql serveragain. I had to uninstall and install again and this process repeats. Doanyone has idea about what is happening ??Thanks a lot,Dinesh
View 2 Replies
View Related
Dec 19, 2006
Hi,
I want to know whether the MSDE is already installed or not on my system using a C# program. For this I have a method which will take the service name as argument and returns whether that servce is found or not. Now I want to know which windows service (service name) will be running on my machine if the MSDE is already installed. Please help me out.
View 1 Replies
View Related
Oct 9, 2006
I am developing an ETL system on a 32-bit machine let's say, called 'dwdev'. The application connects to a Sybase database as a source system using ODBC connection. I am able to run this application directly from Visual studio 2005 and i am able to deploy it into SQL Server 2005 and run it from Server as a job. Both work. At this server i am connecting to a SQL Server instance called 'dwdev'.
When i transfer my application onto a 64-bit machine, let's say called 'dwtest', i am able to run my application from Visual Studio 2005 properly and it works, but when i deploy it into SQL Server (instance is called 'dwtest') and try to run it as a job just like the development machine, it gives an error and stops executing.
I was facing 'data source' type of error when i was first trying it from Visual Studio, but i solved this problem by setting Run64bitRunTime settings to FALSE on the Project's properties Debugging Page, at 64-bit machine. now it uses 32-bit runtime then 32-bit Sybase ODBC driver. But i cannot force the application to use 32 bit runtime when i am executing it from SQL Server as a job.
How can i do that? is there an alternative method?
Thanks for your help...
View 1 Replies
View Related
Sep 11, 2006
Can someone point me at an article that tells how to allow the
ASP.net worker process to connect, via windows authentication, to a
remote sql server instance ?
View 2 Replies
View Related
Feb 5, 2008
Hi,
I have a database of Sql server 2000 in one of my windows XP machine. when iam trying to connect that database from other machine i am getting sql server does n't exist message. I can able to connect the sqlserver through the Enterprise manager but i can not connect the sqlserver through code.
I already used the same code to connect the sql server in windows 2000 machine and i connected to the database without any problem. but iam facing the problem with windows XP machine.
can any body help me to solve this problem.
thanks in advance.Mahesh
View 4 Replies
View Related
Jan 23, 2004
I'm using ASP.net to do a Select and I want to insert all the results into a table that is stored locally
I can put an SP local but cant put on the other DB
How would i achieve this batch insert? is it possible?
thanks
Mark
View 4 Replies
View Related
Aug 20, 2015
We have a Job  that calls a SSIS package 2005 that does some processing and execute a BAT file.  This Job is being called by a web application.The BAT file creates a folder and named it based on the current date ( YYYY_MM) e.g 2015_07
echo %date:~10,4%_%date:~4,2%
md %date:~10,4%_%date:~4,2%
pause
exit 0
It was working okay in the SQL Agent 2005 server until we moved  to the new server SQL Agent 2012 using the same package SSIS package 2005. Now the issue is, instead of creating the folder based on YYYY_MM, it's now being created as YYYY_DD.I've checked the Regional settings of both server and they have the same "ENGLISH (United States) format. I even ran the code below and they're returning the same output echo %date:~ 10,4%_% date :~4,2%
I know the BAT file can be improved by not depending current locale in WINDOWS, but I just want to understand how this issue occurs and how does the regional setting being overridden?
View 2 Replies
View Related
Jun 11, 2007
I changed the login password on my computer today, and now I cannot connect to the SQL Server instance I have on that same machine. I am using Windows Authentication. I would think that, if I can log on to my computer, I would be able to connect to the database, since I have been "authenticated" by windows but, that does not appear to be the case. Can anyone offer any advice? Thanks in advance for any help you can provide.
View 4 Replies
View Related
May 14, 2008
Hi all,
i am tring to install and configure reporting services in Windows 2003 SP2- 64 bit machine as part of installing SCE 2007, and i followed the procedure for confiurng all the options in reportingservices config tool,
all the options show green flag and still could not proceed further as the following error is coming
"The Selected Sql server reportin service instance is not configured , please configure to continue" which halts the further process,
I have installed SQL Server 2005 edition and installed Sql server 2005 SP2 also,
any inputs on this issue , i would welcome them,
View 2 Replies
View Related
Oct 24, 2006
Hi
I developed a windows application in Visual studio 2005 and the database is sqlexpress.
I wanted my application to run on another system.For that i have installed sqlexpress 2005 on that machine.But that machine doesn't show me any enterprise manager or query manager for sqlserver.
Is there any solution for this.
Thanks
View 3 Replies
View Related
Feb 7, 2005
Hi can any one help me with the skeleton script (sample one)of running Bulk insert in batches........ I need to do it in batches as the input data is huge.....
The logic is I have to insert thru bcp in fact table...
After that batch execution for 50,000 thousand record.... wise.... if any of the batch failes i need to identify and have to rerun from that point onwards...... this is OLAP thing...
View 6 Replies
View Related
Jul 23, 2005
Hello,We have an internal application that accesses SQL Server 2000 via ODBC.The connecton is established with user id and password. We recentlyreceived a business request to allow the software to work with Windowsauthentication scheme going forward. This implies that users will nolonger have passwords to login to the database. The Windows PC wouldtake care of the authentication.Is there a way (perhaps a connection string) to allow ODBC to connectto the database in this new environment? I would appreciate any tipsor pointers.
View 2 Replies
View Related
Mar 20, 2008
Hi,
I am in the middle of writing a console application that acquires data from dynamic odbc connections and inserts the results into a MSSQL database. I'm currently using a datareader to generate multiple calls to a stored procedure and batch execute them by means of a simple counter; this works fine.
However, I'm a little concerned that it seems to take so long to execute the sql stored procs and was wondering if anyone may know of any methods to help speed it up either on the app side or sql, or both.
I had a quick word with our dba who spoke briefly about some kind of process where by the application fires the request across to the database and carries on leaving the db to queue the request or something to that effect. He ran away before I could get any sort of sense out of him.
Any help greatly appreciated
Thanks
View 4 Replies
View Related
Mar 31, 2015
How do you prevent this:"If you import a very large number of rows, dividing the data into batches can offer advantages. After each batch complete, the transaction is logged. If, for any reason, a bulk-import operation terminates before completion, only the current transaction (batch) is rolled back." How can I let the whole batch rollback, instead only the current transaction (batch) rolling back?
View 1 Replies
View Related
Apr 13, 2007
I'm using MS JDBC driver to connect to SQLServer 2005 and trying to perform batch insert. Here is the code i'm using:
Code Snippet
try {
// Assume we have a valid con
con.setAutoCommit(false);
// this is the simplified SQL for the purposes of this example
StringBuffer sql = new StringBuffer();
sql.append("INSERT INTO temp_batchOpt (");
sql.append("temp)");
sql.append(" VALUES (?)");
PreparedStatement insertStatement =
con.prepareStatement(sql.toString(),
SQLServerStatement.RETURN_GENERATED_KEYS);
for (int i = 0; i < 10; i++) {
insertStatement.setInt(1,3);
insertStatement.addBatch();
}
int[] r = insertStatement.executeBatch();
// the correct number of insertions are made
if(r != null)
for(int x: r)
System.out.println("inserted "+x);
SQLServerResultSet keyRS = (SQLServerResultSet)insertStatement.getGeneratedKeys();
while (keyRS.next()) {
int id = keyRS.getInt(1);
System.out.println("**filling id ="+id);
}
con.commit();
} catch (BatchUpdateException bue) {
bue.printStackTrace();
}
catch(SQLException sqle){
sqle.printStackTrace();
}
finally {
// close the connection...
}
I'm getting the following exception:
Code Snippetinserted 1
inserted 1
inserted -2
inserted 1
inserted -2
inserted 1
inserted -2
inserted 1
inserted -2
inserted 1
com.microsoft.sqlserver.jdbc.SQLServerException: The statement must be run before the generated keys are available.
at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDriverError(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerStatement.getGeneratedKeys(Unknown Source)
at com.x.U.m.Transformer.prefetchData(Transformer.java:285)
at com.x.U.m.Transformer.init(Transformer.java:51)
at com.x.U.m.XMLParse.main(XMLParse.java:215)
I can get the getGeneratedKeys() to work fine with single update (not usign batch update). Is batch + getGenerated key not supported?
TIA
View 4 Replies
View Related
May 14, 2008
Dear all,
I have a problem when I tried to create an ODBC to SQL Express from Windows 98. Is there any component that I have to install first ?
Thanks in advance.
Best regards,
Hery
View 6 Replies
View Related
Sep 9, 2015
I have a full backup scheduled at 12.00AM ET and have a batch import on 11.55PM(5 min before full backup) which takes 30min to complete .Will the backup cover the data which is being imported?
View 2 Replies
View Related
Jul 6, 2004
howto backup ODBC configure and data on windows 2000 server help me!
thanks.
View 6 Replies
View Related
Feb 7, 2007
Hi All,
I have installed windows 2003 R2 64bit on one of the system, but my devlopment team pointed out that there is no odbc driver available.
I check it for odbc driver on OS cd but i do not found any relevant files/packages, can any one tell me from where I can download the ODBC driver for windows 2003 64bit OS.
Thanks & Regards
Varian
View 6 Replies
View Related
Jul 20, 2005
I want to Insert 10000 rows at a time and commit in sql server , Isthere a way to do it if the source tables have no id fields ?What would be the most efficient method?ThanksAjay
View 1 Replies
View Related
Apr 21, 2008
Hi all-
I setup a new ODBC connection to MS SQL Server 2000 on Windows XP and keep getting the following errors when I try to
either register a new SQL Server 2000 group within Enterprise Manager or test the new ODBC connection:
Current configuration
- MS SQL Server 2000
-Windows XP
-ODBC 3.85.1117
Errors:
I. Within SQL Server 2000 Enterprise Manager
Error: SQL Server connection open
II. When I test the ODBC connection:
Microsoft SQL Server ODBC Driver Version 03.85.1117
Running connectivity tests...
Attempting connection
[Microsoft][ODBC SQL Server Driver][TCP/IP Sockets]Specified SQL server not found.
TESTS FAILED!
Now here is what has me totally confused:
I can use the command line ISQL to access the database on the server and IP is all correct and port is available.
Any tips how to get this ODBC working?
Thanks
Ben Prusinski
View 1 Replies
View Related
Sep 8, 2006
I have an Application developed on ASP, I got a few new servers 64bits, I installed microsoft WIN 2003 SR.
When I get in into the web site I receive this errors:
Microsoft OLE DB Provider for ODBC Drivers error '80004005'
[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
/ConnectToDatabase.asp, line 17
I made some obvios checks, I checked that the ODBC really exists and we move the IIS 6.0 to run in 32bits mode as I found in some page.
Thanks you.
Ahmed
View 3 Replies
View Related
Sep 24, 2015
Got this error running a query with ssms2014
on SqlServer2014
but db has Compatibiliy level 100 (sql2008)
no sql error code in message and no error found in eventviewr (sqlserver log, windows log, application log ecc)when i run that query i got this message in "messages" tab, and in results tab i got a strange result, indeed the value returned doesn't exists in table.
ex table1.field1 possible values= 2,3
it returns 1113344
we got that error thru jdbc too...that query use a lot of joins, unfortunatley i can't post it here. today got this error, so i make a copy of 1 of involved table into another db in the same instance, re run the query on the original db, and it works well.
View 2 Replies
View Related
Jun 30, 2006
Dear All:
When i try to debug the northwindoledb example with VS2005 i get the foolwing error message.
Is there a way to configure the solution to run witn WM5 emulator.
The application run with wm5 emulator when i set the plataform to Windows Mobile 2003, but i want to use the wm5 platform to debug my application with wm5 emulator.
------ Rebuild All started: Project: northwindoledb, Configuration: Debug Windows Mobile 5.0 Pocket PC SDK (ARMV4I) ------
Deleting intermediate and output files for project 'northwindoledb', configuration 'Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)'
Compiling...
Employees.cpp
northwindoledb.cpp
stdafx.cpp
Generating Code...
Compiling resources...
Linking...
coredll.lib(COREDLL.dll) : fatal error LNK1112: module machine type 'THUMB' conflicts with target machine type 'ARM'
Build log was saved at "file://d:Proyectos_VS2005Northwindoledb_WM2003_SQLEW_Windows Mobile 5.0 Pocket PC SDK (ARMV4I)DebugBuildLog.htm"
northwindoledb - 1 error(s), 0 warning(s)
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========
View 1 Replies
View Related