Quantcast
Channel: SQL Server Data Access forum
Viewing all 4164 articles
Browse latest View live

MultipleActiveResultSets=True not giving correct result in some cases while calling stored procedure from C#

$
0
0

Hi all,

    I am facing very strange issue and the issue is that when I call procedure with specified parameters from C# .Net code then it gives incorrect data but when I execute procedure directly in SQL server with same parameter then it gives different result. The result returned directly on SQL server is correct. I investigated issue and found that if I set MultipleActiveResultSets to "False" in connection string then it gives correct result on calling procedure with same parameters from C#. And one more thing that it is not happening in every case i.e If I call procedure for different values of parameter then it works fine. It happening for one specific case i.e for specific value for parameter. I have tried entity framework, ADO.NET and Dapper for calling procedure from C# but same behaviour is noticed with all of them.

I am not sure what makes setting MultipleActiveResultSets to "False" results correct data.

Thanks in advance!

Priyank



TCP Provider: Error code 0x2746 when connecting from Linux to Windows 2003/ SQL Express 10.50.6542

$
0
0

Server: Windows Server 2003 R2
Standard Edition
Service Pack 2
Microsoft SQL Server 2008 R2 (SP3-OD) (KB3144114) - 10.50.6542.0 (Intel X86)   Feb 22 2016 18:12:09   
Copyright (c) Microsoft Corporation  Express Edition on Windows NT 5.2 <X86> (Build : ) (Hypervisor)

Client:
SUSE Linux Enterprise Server 12 (x86_64)
VERSION = 12
PATCHLEVEL = 2

ODBC Driver: 
/opt/microsoft/msodbcsql/lib64/libmsodbcsql-13.1.so.9.1

Updated from the current repository for SLES12.

Failure from the SQL Trace (a connect attempt using isql):

DIAG [08001] [Microsoft][ODBC Driver 13 for SQL Server]TCP Provider: Error code 0x2746
DIAG [08001] [Microsoft][ODBC Driver 13 for SQL Server]Client unable to establish connection

Is this a problem with TLS 1.2?  Is this client/server combination supported ?

Thanks,

Gudmundur


Gudmundur Karlsson

[Microsoft][ODBC Text Driver] In the file specification '...', the Col1 option is invalid.

$
0
0

I'm trying to connect to a tab-delimited text file using the ODBC data access. I set it up using Administrative Tools - Data Sources (ODBC) from the start menu, and clicked the 'Guess' button under Define Format.

The schema it created looks like this:

[cims_output_data.txt]
ColNameHeader=True
Format=TabDelimited
MaxScanRows=0
CharacterSet=OEM
Col1=SIMNAME
Col2=TIMESTAMP
Col3=SIMTYPE
Col4=REGION
Col5=SECTOR
....etc.

It looks OK, but if I go back to Define in Administrative Tools and try to review it, I get a similar error message:

Ini File (or Registry) C:\Program Files\CIMS\schema.ini is corrupt.
Section: cims_output_data.txt, Key: Col1.

Has anyone seen this before? There is nothing on MSDN as far as I could find. I read on another forum that if you replace the label 'Col1' with 'Col' the problem is solved but it still reports that the schema is corrupt when I try to open it in Administrative Tools.

Bill.

Unable to load communication module. Driver has not been correctly installed. Client unable to establish connection

$
0
0

For some strange reason, on installation of Citrix XenApp 7.15 on Windows Server 2016.  I'm getting below error.

I have VB6 code that uses DAO to connect to SQL Server using SQL Server driver (SQLSrv32.dll).

DAO (dao360.dll)
Reference=*\G{00025E01-0000-0000-C000-000000000046}#5.0#0#..\..\Program Files (x86)\Common Files\Microsoft Shared\DAO\dao360.dll#Microsoft DAO 3.6 Object Library
---------------------------
Microsoft SQL Server Login
---------------------------
Connection failed:
SQLState: 'S1000'
SQL Server Error: 126
[Microsoft][ODBC SQL Server Driver]Unable to load communication module.  Driver has not been correctly installed.
Connection failed:
SQLState: '08001'
SQL Server Error: 0
[Microsoft][ODBC SQL Server Driver]Client unable to establish connection

I get the similar error using ADO using SQL Server driver

ADO (msado28.tlb)
Reference=*\G{2A75196C-D9EB-4129-B803-931327F72D5C}#2.8#0#..\..\Program Files (x86)\Common Files\System\ado\msado28.tlb#Microsoft ActiveX Data Objects 2.8 Library
---------------------------
DBConnect
---------------------------
Run-time error '-2147467259 (80004005)':

[Microsoft][ODBC SQL Server Driver]Unable to load communication module.  Driver has not been correctly installed.
---------------------------
OK   
---------------------------

Even after uninstall of Citrix XenApp, I get this error. 

Any attempt to reinstall MDAC is unsuccessful.

Any help is appreciated

-Nanda

SSMS 2012 - 10053 - provider: TCP Provider, error: 0 - An established connection was aborted by the software in your host machine.

$
0
0
when vpn from home i get the following SSMS 2012 message when trying to run TSQL code in query window.   i have also tried SSMS 2016 and get the same message.   i can execute small TSQL code and the query runs fine (declare variable, and select a value from a table and set it to that variable and then query the variable), its when i'm trying to modify code in a stored procedure and execute it that it fails.  i also copy code from s.p. to another query window and get the same issue.  please help.

Msg 10053, Level 20, State 0, Line 0
A transport-level error has occurred when sending the request to the server. (provider: TCP Provider, error: 0 - An established connection was aborted by the software in your host machine.)

thanks for your time
chuck Kruelle

Microsoft.Jet.OLEDB.12.0" has not been registered.

$
0
0

Hello Everyone,

I am trying to execute the foloiwng query in my 64 bit application. But i am getting this error "

Microsoft.Jet.OLEDB.12.0" has not been registered." Can anyone please tell me what should i do on this??

INSERTINTO [dbo].[AccountCard]
		(
 			AcctNum,MonthAlloc,DailyAlloc,StatCode,ProdRestrictCode,QtyRestrictCode,
			PromptSeq,ScriptSetId,Verify1LetterCode,ScriptIdVerify1,Verify1Retries,
			Verify1Data,V1InvalidateBadData,Verify2LetterCode,ScriptIdVerify2,
			Verify2Retries,Verify2Data,V2InvalidateBadData,Verify3LetterCode,
			ScriptIdVerify3,Verify3Retries,Verify3Data,V3InvalidateBadData,
			Modified,[Update],New,Discount,Deleted,ExpDate,
			K8AccessTime,K8Line2,K8Line3
		)SELECT
 		AcctNum,MonthAlloc,DailyAlloc,StatCode,ProdRestrictCode,QtyRestrictCode,
		PromptSeq,ScriptSetId,Verify1LetterCode,ScriptIdVerify1,Verify1Retries,
		Verify1Data,V1InvalidateBadData,Verify2LetterCode,ScriptIdVerify2,
		Verify2Retries,Verify2Data,V2InvalidateBadData,Verify3LetterCode,
		ScriptIdVerify3,Verify3Retries,Verify3Data,V3InvalidateBadData,
		Modified,[Update],New,Discount,Deleted,ExpDate,
		K8AccessTime,K8Line2,K8Line3FROMOPENDATASOURCE
    ('Microsoft.Jet.OLEDB.12.0','Data Source=D:\ProjectWork\P4WDatabases\Andy.mdb')...[AccountCard]
GO


Regards Anil Kumar

The OLE DB provider "Microsoft.ACE.OLEDB.12.0" has not been registered.

$
0
0

I was trying to run this query

SELECt * FROM OPENROWSET('Microsoft.ACE.OLEDB.12.0','Excel 12.0;Database=C:\Users\File.xlsx', 'SELECT * FROM [Sheet1$]');

I got this Error:
Msg 7403, Level 16, State 1, Line 1
The OLE DB provider "Microsoft.ACE.OLEDB.12.0" has not been registered.

Computer OS: win7 64 bit, excel:32bit

I have tried the solutions in these articles and doesn't work:
http://social.msdn.microsoft.com/Forums/en/transactsql/thread/108a4588-cca9-458b-b5e6-41d957f25fdd

http://social.msdn.microsoft.com/Forums/en-US/sqldataaccess/thread/20aafd3d-0219-4706-abb4-e4b35aebb18e/

I also have installed these:
http://www.microsoft.com/downloads/details.aspx?FamilyID=7554F536-8C28-4598-9B72-EF94E038C891&displaylang=en
and
http://www.microsoft.com/en-us/download/details.aspx?id=13255

However, when I use ssms to do importing, I was successfully imported data.

please help.

Import BLOB fields in Visual Fox Pro from varbinary(MAX) SQL Server with ODBC Driver 17 for SQL Server

$
0
0

Hi, 

In VFP I found a statement ( cursorsetprop("Mapbinary", .T., 0) to transform the varbinary(MAX) fields from SQL Server in BLOB fields in VFP. The command is ok with {SQL Server} driver.

But with other drivers did not work. 

Can somebody help? It is interesting to use {ODBC Driver 17 for SQL Server} for this operation.

Thanks




Need help on SQL CALs

$
0
0

I have a 3 tier architecture Application -> API  -> BAL -> DAL

This application is a web based application to be used on premise with an on Premise MS SQL Server.

I am planning to mount it on MS Server 2016 Essentials OS with SQL Server STD. This application will be used by 10 users.

My application is the only way of interacting with the SQL Server.


Want to know how many SQL CALs do I need to get or it will work with only 1 SQL CAL.

Request you to be very specific as already confused by other blogs. Please let me know if any other details required

-- Pravin K.



SQL Server Management Studio loses access to database

$
0
0

I worked all day yesterday on my project which is SQL Server plus a Windows Console C# application that works with SQL Server. I turned the computer off and this morning I cannot make a connection. SSMS gives me this error message:

TITLE: Connect to Server
------------------------------
Cannot connect to ..
------------------------------
ADDITIONAL INFORMATION:

A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server) (Microsoft SQL Server, Error: 2)

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft%20SQL%20Server&EvtSrc=MSSQLServer&EvtID=2&LinkId=20476
------------------------------
The system cannot find the file specified
------------------------------
BUTTONS:
OK
------------------------------

That link is a lie. It is a commercial MS website. Such things have happened before many times and the last time I had to do with it was 5 days ago.

Horrible MS.

- MyCatAlex


Catastrophic Failure, MSDASQL, Linked Servers and MySQL

$
0
0
When executing a query which joins against a large resultset from a linked server, SQL Server reports the following error:
Msg 7399, Level 16, State 1, Line 1
The OLE DB provider "MSDASQL" for linked server "foo" reported an error. The provider reported an unexpected catastrophic failure.
Msg 7303, Level 16, State 1, Line 1
Cannot initialize the data source object of OLE DB provider "MSDASQL" for linked server "foo".

This is using SQL Server 2005 with SP2, and MyODBC version 3.51.16 (although previous versions also seem to have the same behavior).

Once the error occurs any subsequent query against the linked server (even something as simple as select top 3 * From foo...users) fails with the same error message. Queries using the OpenQuery syntax also fail with this error.

I've tried to determine if there are some error logs that might give me more insight into what's going on, but the above events don't seem to log to the ODBC trace logs. And I can't seem to figure out a way to trace the MSDASQL (i.e., oledb) events.

I initially thought there might be a problem with the MySQL myODBC driver, but the ODBC layer itself does not seem to have a problem. But the following steps indicate otherwise:
1. Create a new Linked Server to MySQL. Same error as above
2. Execute a query against the ODBC DSN directly, using a shell program. This works fine

I'm trying to clearly identify if the problem is with the MySQL driver or with the MSDASQL provider. It would appear that the latter is at fault, given the error message, and the lack of any ODBC logging.

Would anyone have any insights about what might be going on here, and if there is any possible resolution?

Connection issues running SSIS package from new 2014 database to old 2000 database

$
0
0

Hi,

We have recently moved an old SQL2K db on a Win2003 server to SQL Server 2014 on Windows Server 2012. Since the move we are having a problem running an SSIS package that historically ran fine on the older infra. The package connects from our live db server to a Win2003 SQL2K server (I will call this SQL2K server "Report server" for clarity)  and runs a select statement and then transfers that data into a table in our live database.

The issue we have is that the job is usually failing - although sometimes it does not.

We have been getting errors such as:

-  "[DBNETLIB][ConnectionWrite (send()).]General network error. Check your network documentation."
- "The attempt to add a row to the Data Flow task buffer failed with error code 0xC004702"
Also - logged on the report server is the following error:"A fatal error occurred while reading the input stream from the network. The session terminated (input error: 10054, output error:0. Error 4014, severity 20, State 11"

As the report server is used by many other users and systems and we are not aware of the same issue being encountered by them, plus the fact this started only after we migrated our live database to our new server, we assume it is an issue interacting with our new live db server.

What we have tried

1) We had a network trace done that shows Live db server sends a request to reporting server for path \sql\query and gets the Error: STATUS_OBJECT_NAME_NOT_FOUND message followed by the tree disconnect and logoff messages. In the next sequence, the live db server sends a SYN to the reporting server on port 1433, but the reporting server sends an immediate RST (reset) and connection is terminated. The suggestion is this is an software issue

2) Changed the MS SQL Server Agent account from an old admin user to Local System Account. This seemed to solve the problem, but then the next day the job failed again

Other ideas

1) The error message STATUS_OBJECT_NAME_NOT_FOUND when googled seems to suggest something to do with SMB. On this new server, we have disabled SMB v1 and I thought this may be connected as the reporting server is running on Win2003. However I can find nothing online suggesting that SQL Server uses SMB for querying between servers and our security team do not want us switching SMB v1 on.

2) I have read a fair bit about TCP Chimney and RSS issues that relate to one of the error messages above. The suggestion from these articles is to try switching these off on our Win2003 reporting server as potentially the network adaptor is not supporting them properly. However, as the reporting server is a production server used by many users who have no issues running queries, it seems strange TCP Chimney/RSS would impact only our server. We are also nervous of switching this off when the server is so widely used as there could be impacts on other users

I cannot find anything really online that discusses our symptoms based on moving a db from SQL Server 2000 to 2014 and then having these issue querying another server. My question is, does anyone have any idea what in 2014 could be causing this issue that we never saw with 2000? Any suggestions welcome!

Thanks

create view in sql

$
0
0

I want to save this view.

createor replace view v_emp(eno number)asselect*from emp where(emp_id =@Parameter1);

but I can bypass just to run the view! I can't save.

Unable to connect to Unicode Databases in SQL 2016 using pymssql and pyodbc module

$
0
0

I was trying to connect to one of my database using pymssql module in python having the name test_यूनिकोड_डेटाबेस_123. But I am getting an error while connection :

'ascii' codec can't encode characters in position 4-10: ordinal not in range(128)

Below is my code:

db_name ='test_यूनिकोड_डेटाबेस_123'

pymssql.connect(self.server, self.user, self.password, self.db_name, charset='utf8')

and with pyodbc i am using below string to connect:

cnxn = pyodbc.connect(Trusted_Connection='Yes',DRIVER='{SQL Server}',SERVER='169.17.12.13',DATABASE=db_name,UID='QA\Administrator',PWD='Admin123',Charset='utf-8')

I tried doing db_name.encode('utf8') but no luck. Then I included the charset='utf8' option to pymssql connect statement still haven't got any luck in connection. Can someone please help me?

Python version is 2.7 and SQL Server 2016.

Can't find the Microsoft website with tutorials

$
0
0
Some time ago I found a website containing a tutorial concerning examples of connecting to SQL Server using C# and don't remember the address. I remember that on the same site there were tutorials with PHP and MSSQL on Linux. I also remember that it consisted of few pages, named "1", "2" and so on (in circles).

Linked Server Error 7303

$
0
0
I created several linked servers up on a SQL Server 2008r2. The servers it was linking to were 2 x 2008r2 and one 2005 (sp3). The odd thing was that when clicked test connection it had a liccle think then came back with following error: TITLE: Microsoft SQL Server Management Studio ------------------------------ The test connection to the linked server failed. ------------------------------ ADDITIONAL INFORMATION: An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo) ------------------------------ Cannot initialize the data source object of OLE DB provider "SQLNCLI10" for linked server. OLE DB provider "SQLNCLI10" for linked server returned message "Unable to complete login process due to delay in opening server connection". (Microsoft SQL Server, Error: 7303) For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=10.50.2550&EvtSrc=MSSQLServer&EvtID=7303&LinkId=20476 However, when closed error and re-tried 'Test Connection' button it worked! Got the test connection succeeded message. This was happening on 3 out of 5 of the linked servers. With it mentioning timeout I thought it might be something to do wuith the remote connections 'Remote query timeout' value. It was set to default of 600 (seconds!) so I upped to 1000 and suddenly the Test connection button worked every time! This doesn't make any sense to me. If it was 600 milisecs I could understand but it's not, it's seconds - 600 seconds is 10 mins! The error was coming back within 20 seconds so why is linked server connection failing on 600 but working when change it to 1000?

Can't DELETE\INSERT with OLE DB provider "MSDASQL" for linked server

$
0
0

Hi ,

A problem perform delete  with linked server , I tried with and without OpenQuery and no success

 I've a db owner permissions on the server. it's err Msg. 7345 if thats help

How to resolve this issue ???

I'm using SQL2005 sp3

the error :

User did not have sufficient permission to delete the row.

 

delete from OPENQUERY(MainExplanationDB, 'select * from  tblGlobalCounter')

 

The OLE DB provider "MSDASQL" for linked server "MainExplanationDB" could not delete from table

Could not activate or scan all of the log files for database

$
0
0

Hi,

I encountered an error when I open my application. Can you help me guys.please

"Could not activate or scan all of the log files for database"

Crystal Reports and SQL Server

$
0
0

Hello:

I developed a basic report in SAP Crystal Reports. This report uses ODBC/RDO system DSN to connect to SQL Server. When I do a preview, it is working correctly. However, when I deploy it, I get the below error:

System.Runtime.InteropServices.COMException (0x80047E48): Logon failed.
Details: 28000:[Microsoft][ODBC SQL Server Driver][SQL Server]Login failed for user 'servername$'.

Servername$ is the server from where crystal report is being invoked.

What could be causing this issue? I have a system DSN in the production with the same name as in development.

Thanks!

Headers not seen after exporting database table to csv

$
0
0

Hi Experts ,

I have tried to export the SQL Server 2012 Database table to CSV, but it is not showing the headers.

The command I have used is, 

 exec FIMU_POCTest..xp_cmdshell 'bcp FIMU_POCTest..SE_Case_Detailes_Tbl out "D:\DBExtract\CaseDetalsTableExtract.csv" -c -t, -T -S  -U  -P '

Could u please help me in this?


sajitha

Viewing all 4164 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>