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

How to save database diagram in pdf without loosing quality

$
0
0

Hi Team,

Recently have created a database diagram and i need that diagram in pdf format. Also am tried copy diagram to clipboard option but am loosing quality of diagram.

Could you please anyone suggest me is their any alternate method was available (expect print option).  

In copy diagram to clipboard option, am zooming 500% otherwise am not able view in proper format. 


Thanks Bala Narasimha


Can we access the SQL server 2008,2008R2 using New OLE DB Driver(MSOLEDBSQL) for SQL Server

$
0
0

Hi,

We are using OLEDB provider(sqloledb) in our applications to connect the SQL server and now we want to use new OLE DB Driver(MSOLEDBSQL) for SQL Server.

I have a question Can we connect SQL server 2005, 2008 & 2008R2 using new OLEDB driver(MSOLEDBSQL). In the below article they are mentioned it supports  from SQL Server 2012 onward and coming to Supported Operating System is it supports with windows 7 ?

https://blogs.msdn.microsoft.com/sqlnativeclient/2017/08/15/ole-db-supportability-guidelines/

Thanks in advance.

Kiran



Duplicate column names from Oracle 11g linked server

$
0
0

I created a linked server from SQL Server Standard Edition (64-bit) connecting to Oracle 11g. The connection is successful and we dont have any problem for a month. However, today we notice that the linked server provide a duplicate column and duplicate data. Even we check the original table from Oracle 11g  the column and data is not duplicate. We are thinking there is something wrong on the linked server that we created. This is the sample data. Please help us on this thank you!

SELECT [CLIENTID]
      ,[CLIENTNAME]
      ,[CLIENTNAME]
      ,[CLIENTNAME]
      ,[CLIENTNAME]
      ,[CLIENTCOMMENT]
      ,[CLIENTCOMMENT]
      ,[CLIENTCOMMENT]
      ,[CLIENTCOMMENT]
      ,[ACTIVE]
      ,[REMOVEDATE]
      ,[REMOVEDATE]
      ,[REMOVEDATE]
      ,[REMOVEDATE]
      ,[SEC_LEVEL_EDIT]
      ,[CLIENTINFO]
      ,[CLIENTINFO]
      ,[CLIENTINFO]
      ,[CLIENTINFO]
      ,[CLIENTINFO_REMOVEDATE]
      ,[CLIENTINFO_REMOVEDATE]
      ,[CLIENTINFO_REMOVEDATE]
      ,[CLIENTINFO_REMOVEDATE]
      ,[CATEGORYID]
      ,[MAIN_COUNTRYID]
      ,[TO_EXPORT]
  FROM [CLIENTS]
GO



Can't INSERT Record

$
0
0

Having trouble INSERTING a new record. I am trying to insert record using PHP. I then get code 7202 and 3621 when I try. I am able to INSERT record from Server Management Studio.

I get a copy of this DB from a vendor and then I restore in my server to use the data. Any reason why it is looking for a linked server when I try to INSERT from outside Server Management Studio?

Connectivity issue from Local PC with SQL server on Server

$
0
0

I have installed SQL server on AWS server where I have a domain name, Active directory name, NetBIOS name, DNS server name and PC full name as well. I am trying to connect SQL server from AWS serve in my .net SqlDataAdopter. I also do have private and public IP.

When I try to connect AWS SQL with public IP along with the port number, I am able to connect with SQL server. Now I want to connect with the domain name, where I have no idea how to do this. I have seen many forums and post but all of them couldn't help me out. 

Furthermore, I have tried every possible scenario, Like providing full computer name "ComputerName.DomainName.com\SQLInstance"
"domainName\SQLInstance"
"netBiosName\SQLInstance"
"DNSServerName\SQLInstance". but nothing is working. I have also updated the Host file from system32/drivers/etc with public IP with Domain name, public IP with the full computer name, and public IP with DNS server name. 

May anyone <g class="gr_ gr_1312 gr-alert gr_gramm gr_inline_cards gr_run_anim Grammar multiReplace" data-gr-id="1312" id="1312">help</g> me out what I am missing. I am not good with Server configuration

Query causing long blocking and degrading performance

$
0
0

Hello,

Could you please help with some hints and shed some light on the below situation.

We have 2 queries which are causing issues, 

One of the blocked database maintenance job(re-indexing) which has been executing 3 days, and the maintenance job running for 2 days blocked all the queries and caused others to go in open-incomplete status.

We recycled multiple times of and Jetty. After the recycle, the response time was good, and gradually, response time got worse. This scenario repeated until we kill the two block queries.

The are two main blocks, SPID 324 blocked 218.

Query 1 :

======

SPID: 324
Duration: 3 days executing..

Blockings: 320++ spids

(@P0 bigint,@P1 int,@P2 datetime2) 
SELECT this_.depositid as depositid52_0_, 
this_.version as version52_0_, 
this_.createdate as createdate52_0_, 
this_.lastmodifydate as lastmodi4_52_0_, 
this_.stateCode as stateCode52_0_, 
this_.autoclosestate as autoclos6_52_0_, 
this_.subStateCode as subState7_52_0_, 
this_.siteid as siteid52_0_, 
this_.reasoncode as reasoncode52_0_, 
this_.startdepseqnum as startde10_52_0_, 
this_.depositnumber as deposit11_52_0_, 
this_.type as type52_0_, 
this_.bankid as bankid52_0_, 
this_.timezoneid as timezoneid52_0_, 
this_.customerid as customerid52_0_, 
this_.locationid as locationid52_0_, 
this_.userfield1 as userfield17_52_0_, 
this_.userfield2 as userfield18_52_0_, 
this_.userfield3 as userfield19_52_0_, 
this_.resourcename as resourc20_52_0_, 
this_.achcompanyname as achcomp21_52_0_, 
this_.accountnumber as account22_52_0_, 
this_.routingtransit as routing23_52_0_, 
this_.accountdescription as account24_52_0_, 
this_.originalexpectedamount as origina25_52_0_, 
this_.expectedamount as expecte26_52_0_, 
this_.expectedcount as expecte27_52_0_, 
this_.itemtotalstatecode as itemtot28_52_0_, 
this_.itemtotalid as itemtot29_52_0_, 
this_.bankaccountid as bankacc30_52_0_, 
this_.userid as userid52_0_, 
this_.itemtotalversion as itemtot32_52_0_, 
this_.ScannedOfExpectedCount as Scanned33_52_0_, 
this_.notes as notes52_0_, 
this_.amountchangeditemcount as amountc35_52_0_, 
this_.source as source52_0_, 
this_.itemtotalapproveruserid as itemtot37_52_0_, 
this_.itemtotalapprovaltime as itemtot38_52_0_, 
this_.creatoruserid as creator39_52_0_, 
this_.partyid as partyid52_0_, 
this_.depositclassid as deposit41_52_0_, 
this_.credittotal as creditt42_52_0_, 
this_.debittotal as debittotal52_0_, 
this_.accountcurrency as account44_52_0_, 
this_.depositdate as deposit45_52_0_, 
this_.captureworktype as capture46_52_0_ 
FROM dbo.depositList this_ 
WHERE this_.locationid in 

SELECT Location_.id as y0_ 
FROM dbo.pcwlocation Location_ 
WHERE Location_.customerid=@P0 

AND this_.stateCode<>@P1 
AND this_.lastmodifydate>=@P2

Query 2:  

=======

SPID: 218

Duration: 2 days executing…

Blockings: 200++ spids

ALTER INDEX [ix1_pcwbankaccount] ON [dbo].[pcwbankaccount] REBUILD PARTITION = ALL WITH ( PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, IGNORE_DUP_KEY = OFF, ONLINE = ON, SORT_IN_TEMPDB = OFF )




Kenny ShareNlearn



ubquery returned more than 1 value.

$
0
0

Can I get help on one error to resolve. 
I'm receiving following error while pulling data.

Msg 512, Level 16, State 1, Line 1
Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression.

Some strange SQL Errors after upgrading to SQL Server Express 2017

$
0
0

Hello everyone.  I have a project that was built using SQL Server 2001 and I recently upgraded to SQL Server 2017.  I realize that is a big jump.

After the upgrade, I have noticed some strange SQL errors and haven't been able to figure out where the issue lies.  I haven't found anything online that would indicate that SQL itself has changed from what I was writing previously, and the threads I've read where people were discussing these issues don't seem to discuss causes that would apply here...

For starters, here is the first error I'm getting:

Exception: System.Data.SqlClient.SqlException (0x80131904): Invalid column name 'Name'.
   at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
   at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
   at System.Data.SqlClient.SqlDataReader.TryConsumeMetaData()
   at System.Data.SqlClient.SqlDataReader.get_MetaData()
   at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString, Boolean isInternal, Boolean forDescribeParameterEncryption, Boolean shouldCacheForAlwaysEncrypted)
   at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, Boolean inRetry, SqlDataReader ds, Boolean describeParameterEncryptionRequest)
   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry)
   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
   at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method)
   at System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
   at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
   at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String srcTable)
   at PD1.UContactList.GridBW_DoWork(Object sender, DoWorkEventArgs e)
ClientConnectionId:537a9e7e-6f69-4c8e-bbd4-b0138540dc27
Error Number:207,State:1,Class:16

And here is my SQL:

SELECT Leads.ID, Leads.LeadType, Leads.LeadType AS [SalesType], Leads.Company, Leads.FName, Leads.LName, COALESCE(NULLIF(Leads.Company, '') + ' - ', '') + COALESCE(Leads.FName, '') + ' ' + COALESCE(Leads.LName, '') AS[Name], Leads.WPhone, Leads.MPhone, Leads.OPhone, Leads.OPhoneNote, Leads.Fax, Leads.Address1, Leads.Address2, Leads.City, Leads.State, Leads.Zip, Leads.EMail, Leads.Website, Leads.Notes, Leads.WritesFor, Leads.OfficeStaff, Leads.SalesRoute, Leads.SalesStop, Leads.SalesRating, Leads.MarketCategory, Leads.SalesActivity, Leads.DateCreated, Leads.CreatedBy, Leads.ChangeLog, StaffCreator.FName + ' ' + StaffCreator.LName AS[CreatorName] FROM Leads LEFT OUTER JOIN Staff AS StaffCreator ON StaffCreator.ID = Leads.CreatedBy WHERE Leads.Company like '%searchterm%' OR Leads.FName like '%searchterm%' OR Leads.LName like '%searchterm%' OR Leads.FName + ' ' + Leads.LName like '%searchterm%' OR Leads.LName + ', ' + Leads.FName like '%searchterm, %' OR Leads.Address1 like '%searchterm%' OR Leads.Address2 like '%searchterm%' OR Leads.City like '%searchterm%' OR Leads.Zip like '%searchterm%' OR Leads.WPhone = 'searchterm' OR Leads.MPhone = 'searchterm' OR Leads.OPhone = 'searchterm' OR Leads.Fax = 'searchterm' OR Leads.EMail = 'searchterm' OR Leads.LeadType = 'searchterm' OR Leads.WritesFor like '%searchterm%' GROUP BY Leads.ID, Leads.LeadType, Leads.Company, Leads.FName, Leads.LName, Leads.WPhone, Leads.MPhone, Leads.OPhone, Leads.OPhoneNote, Leads.Fax, Leads.EMail, Leads.Address1, Leads.Address2, Leads.City, Leads.State, Leads.Zip, Leads.EMail, Leads.Website, Leads.Notes, Leads.WritesFor, Leads.OfficeStaff, Leads.SalesRoute, Leads.SalesStop, Leads.SalesRating, Leads.MarketCategory, Leads.SalesActivity, Leads.DateCreated, Leads.CreatedBy, Leads.ChangeLog, StaffCreator.FName, StaffCreator.LName ORDER BY Leads.Name Desc

As you can see, the Name column does exist...

The second error I'm getting is:

Exception: System.Data.SqlClient.SqlException (0x80131904): The multi-part identifier "Schedule.StartTime" could not be bound. at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady) at System.Data.SqlClient.SqlDataReader.TryConsumeMetaData() at System.Data.SqlClient.SqlDataReader.get_MetaData() at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString, Boolean isInternal, Boolean forDescribeParameterEncryption, Boolean shouldCacheForAlwaysEncrypted) at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, Boolean inRetry, SqlDataReader ds, Boolean describeParameterEncryptionRequest) at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry) at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method) at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method) at System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String srcTable) at PD1.FMain_Customers_Schedule.LoadConflictingAppointments() ClientConnectionId:5c7d09c5-7c17-40d7-93ae-437a2ad61465 Error Number:4104,State:1,Class:16

And the SQL is:

SELECT TOP 1 Schedule.ID AS SID, Schedule.Subject, Schedule.StartTime, Schedule.EndTime FROM Schedule WHERE Schedule.LaborID = '8' AND ('8/15/2018 12:05:01 PM' BETWEEN Schedule.StartTime AND Schedule.EndTime OR '8/15/2018 12:55:00 PM' BETWEEN Schedule.StartTime AND Schedule.EndTime) ORDER BY Schedule.StartTime Asc

So, you can see that Schedule.StartTime is there...?

Does anyone happen to know what might be causing these issues? They seem to be connected, but I'm not sure. Discussion online centered around these fields not being there, but I can assure you that they are and this SQL has worked for quite some time which wouldn't have happened if they weren't there. Is there a symantec change that I am unaware of perhaps?

Other SQL scripts are working, but not all...

Thank you again for your help!


SQL Server 6.03.9600.17415 vs Newer SQL drivers e.g. Microsoft® SQL Server® 2012 Native Client - QFE

$
0
0

Does the old SQL server Driver potentially perform a lot slower than the more modern drivers like Microsoft® SQL Server® 2012 Native Client - QFE  Version 11.

Could that cause application slowdown.  Or is there likely no performance difference connecting to SQL 2012 Sql server.

Kind regards,

Peter

New odbc data source not displaying sql tables to link to access

$
0
0
When creating a new ODBC data source with  ODB Driver 13 for sql server, when I get to the point of selecting the tables to link, there are no table names is the list. Just things like "INFORMATION_SCHEMA.CHECK_CONSTRAINTS" AND "sys.all_columns". Prior to today I was able to also see the list of tables to select. I cannot think of anything I have done or changed to cause this.

jperry

Encryption not working when using OLEDB or MSOLEDB drivers via ADO.net.

$
0
0

We are attempting to get off of using the native sql client and start using the recommended MSOLESQLDB driver. After trying to get encryption working with no success, I started trying some alternatives to verify i could encrypt my connection:

With the following config settings and using both the native sql client and odbc client via ADO.net, or using the sql management console I was able to connect encrypted:

--NATIVE SQL DRIVER

    <add name="conn" connectionString="Data Source=xxxxxx; 
         initial catalog=xxxxxx; 
         Integrated Security=SSPI; 
         Application Name=Test; 
         Encrypt=yes;
         TrustServerCertificate=true; 
         DataTypeCompatibility=80;"/>

--LATEST ODBC Driver

<add name="conn" connectionString="Server=xxxxxx; 
         initial catalog=xxxxxx; 
         Integrated Security=SSPI; 
         APP=MyTest; 
         Driver={ODBC Driver 17 for SQL Server}; 
         Encrypt=yes;
         Trusted_Connection=Yes;
         TrustServerCertificate=yes;
         DataTypeCompatibility=80;" />

When I use the latest MSOLEDBSQL driver or even the older OLEDB driver, the connection is fine but connection is not encrypted:

--LATEST MS OLE DRIVER

    <add name="conn" connectionString="Data Source=xxxxxx; 
         initial catalog=xxxxxx; 
         Integrated Security=SSPI; 
         Application Name=Test; 
         Provider=MSOLEDBSQL; 
         Encrypt=yes;
         TrustServerCertificate=true; 
         DataTypeCompatibility=80;"/>

I could set the Encrypt value to any invalid value i.e. xyz and it still connected fine, but not encrypted, which led me to believe this property is simply being ignored. I decompiled the ADO.net dlls and could not find any reference to the Encrypt or TrustServerCertificate properties in the OLE libraries. 

For further verification, I threw together a c++ app that uses the new ole sdk so i could bypass the ado libraries and the encryption works fine. So it appears that OLE encryption via the use of ADO libraries is not supported. This is surprising to me, given the fact that MS is going to stop providing support for Native sql client and urges devs to move to the new MSOLEDB driver. 



cannot implement Trusted Connection Linking Access tables to SQL Server

$
0
0
I have successfully linked Access front end to Sql Server tables using SQL Authentication. When I set an ODBC data source using ODBC Driver 13 for Sql Server using a Trusted Connection I get "No credentials available in the security package" and "Cannot generate SSPI context" errors. I am using Access 2016 and Sql Server 2017 Express.

jperry

Test ODBC connectivity without a password?

$
0
0

I have a remote site that is connected to our database through a firewall. I would like the techs to be able to test the ODBC connection without giving them the database password. I would have them ping the SQL Server but ping is disabled through the firewall. Is there anyway to test the integrity of the users ODBC connection without a password? I was hoping for a *simple* DOS command. I was looking at Odbcte32.exe (MDAC V2.8) but that didn't help.

BTW, does the ODBC test connection use ping as part of the test does anyone know?

Long running sql Query causing blocking issue when running re-index batch and degrading DB performance

$
0
0

Hello,

Could you please help with some hints and shed some light on the below situation.

We have 2 queries which are causing issues, 

One of the blocked database maintenance job(re-indexing) which has been executing 3 days, and the maintenance job running for 2 days blocked all the queries and caused others to go in open-incomplete status.

We recycled multiple times of and Jetty. After the recycle, the response time was good, and gradually, response time got worse. This scenario repeated until we kill the two block queries.

The are two main blocks, SPID 324 blocked 218.

Query 1 :

======

SPID: 324
Duration: 3 days executing..

Blockings: 320++ spids

(@P0 bigint,@P1 int,@P2 datetime2) 
SELECT this_.depositid as depositid52_0_, 
this_.version as version52_0_, 
this_.createdate as createdate52_0_, 
this_.lastmodifydate as lastmodi4_52_0_, 
this_.stateCode as stateCode52_0_, 
this_.autoclosestate as autoclos6_52_0_, 
this_.subStateCode as subState7_52_0_, 
this_.siteid as siteid52_0_, 
this_.reasoncode as reasoncode52_0_, 
this_.startdepseqnum as startde10_52_0_, 
this_.depositnumber as deposit11_52_0_, 
this_.type as type52_0_, 
this_.bankid as bankid52_0_, 
this_.timezoneid as timezoneid52_0_, 
this_.customerid as customerid52_0_, 
this_.locationid as locationid52_0_, 
this_.userfield1 as userfield17_52_0_, 
this_.userfield2 as userfield18_52_0_, 
this_.userfield3 as userfield19_52_0_, 
this_.resourcename as resourc20_52_0_, 
this_.achcompanyname as achcomp21_52_0_, 
this_.accountnumber as account22_52_0_, 
this_.routingtransit as routing23_52_0_, 
this_.accountdescription as account24_52_0_, 
this_.originalexpectedamount as origina25_52_0_, 
this_.expectedamount as expecte26_52_0_, 
this_.expectedcount as expecte27_52_0_, 
this_.itemtotalstatecode as itemtot28_52_0_, 
this_.itemtotalid as itemtot29_52_0_, 
this_.bankaccountid as bankacc30_52_0_, 
this_.userid as userid52_0_, 
this_.itemtotalversion as itemtot32_52_0_, 
this_.ScannedOfExpectedCount as Scanned33_52_0_, 
this_.notes as notes52_0_, 
this_.amountchangeditemcount as amountc35_52_0_, 
this_.source as source52_0_, 
this_.itemtotalapproveruserid as itemtot37_52_0_, 
this_.itemtotalapprovaltime as itemtot38_52_0_, 
this_.creatoruserid as creator39_52_0_, 
this_.partyid as partyid52_0_, 
this_.depositclassid as deposit41_52_0_, 
this_.credittotal as creditt42_52_0_, 
this_.debittotal as debittotal52_0_, 
this_.accountcurrency as account44_52_0_, 
this_.depositdate as deposit45_52_0_, 
this_.captureworktype as capture46_52_0_ 
FROM dbo.depositList this_ 
WHERE this_.locationid in 

SELECT Location_.id as y0_ 
FROM dbo.pcwlocation Location_ 
WHERE Location_.customerid=@P0 

AND this_.stateCode<>@P1 
AND this_.lastmodifydate>=@P2

Query 2:  

=======

SPID: 218

Duration: 2 days executing…

Blockings: 200++ spids

ALTER INDEX [ix1_pcwbankaccount] ON [dbo].[pcwbankaccount] REBUILD PARTITION = ALL WITH ( PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, IGNORE_DUP_KEY = OFF, ONLINE = ON, SORT_IN_TEMPDB = OFF )




Kenny ShareNlearn




New ADODB from Win 10 (1803) too slow

$
0
0

Hello

Some time ago I updated my Windows 10 Pro to 1803 build.

Today I detected than my tests, created on VBScript and ADODB work very slow.

For compare

1. At computer (Intel 2670QM) with Win7 (msado15.dll 6.1.7601.24023, cscript.exe 5.8.9600.19003) my tests execute within 80 sec.

2. At computer (Intel 6950X) with Win10 1803 (msado15.dll 10.0.17134.1, vbscript.dll 5.812.10240.16384) my tests execute within 1080 sec.

Windows.old (at computer with Win10) contains:
 - vbscript.dll - 5.812.10240.16384
 - msado15.dll - 10.0.16299.248

Early (before update to build 1803) my tests worked as expected - very fast (~80 sec)

The problem locates in cycle:

 for i=1 to c_recordN cmd(0)=base_ID+i call cmd.execute()
 next 'i

Where "cmd" it is "ADODB.Command" object.

I not sure, but seem the problem in "Execute" method.

Where I may find the informations about changes in new msado15.dll 10.0.17134.1?

Thanks,

Dmitry Kovalenko

www.ibprovider.com


Transaction Update/Insert table Locked

$
0
0

Hi ,

SQL Procedure getting slow and locked during multiple transaction as update and insertion happens based on condition on same table using merge method.

three merge method is used to update and insertion against three tables and there is parent and child relation from csv file as source.

kindly share if merge is not best solution.


Create XEvents session via ODBC?

$
0
0

I'm using ODBC from Python (via pyodbc) to connect to SQL Server.  I want to create an Extended Events session via TSQL.  This fails, with the message:

 ('42000', '[42000] [Microsoft][SQL Server Native Client 11.0][SQL Server]DROP EVENT SESSION statement cannot be used inside a user transaction. (574) (SQLExecDirectW)')

(The first action in the TSQL script is to drop any existing session; if there wasn't an existing session it fails with the CREATE EVENT SESSION.)

But the ODBC driver apparently automatically creates a transaction, so its not obvious (to me) how to send the TSQL via ODBC without having a transaction.  

Any suggestions?

Connection Timeout and ODBC Native Client

$
0
0

I use ODBC SQL Native Client to connect to SQL Server.

When I call SQLDriverConnect to connect to an SQL Server instance and  server is down, the function takes 20+ seconds to return. I want to be able to detect it sooner, lets say after 3 secs, but there is no connection timeout property like there is in .NET SqlClient or OLEDB using Native Client.

I tried using SQL_ATTR_LOGIN_TIMEOUT but it is not implemented in SQL Native Client. I also tried to enable asynchronous mode for connecting using SQLSetConnectAttrand SQL_ATTR_ASYNC_ENABLE but still the delay is the same. The login doesn't seem to happen asynchronously.

Is there any way using ODBC and Native Client to detect that the server is down, or get a login timeout sooner? Maybe some configuration in the registry or the server? My application cannot wait for so long when there is a problem. I am using also ODBC Connection pooling and I use SQLDriverConnect very often.

Thank you,

Dimitris

SAP MII not able to connect MS SQL SERVER 2016

$
0
0

Hi,

We are using a SAP MII application and have recently migrated from MS SQL 2008R2 to MS SQL 2016.

But, after migrating we found that the SAP MII is not able to connect the new DB as the JDBC version was very old (JDBC v1.2) so we updated the SAPSQL JDBC driver to v4.0.

After doing this still the SAP MII is not able to connect to MS  SQL 2016. Also the earlier setup (.i.e SAP MII connecting to Ms SQL 2008R2) is not working now. The JDK version installed on SAP system is JDKv6.

Note:We are able to connect to both MS SQL 2008R2 and MS SQL 2016 using SSMS

Can someone help us in resolving this issue?

Below is the Log which is extracted from the SAP MII system:

 ----------------------------------------------------------------------

Unable to get a connection from the pool
[EXCEPTION]
com.microsoft.sqlserver.jdbc.SQLServerException: The driver could not establish a secure connection to SQL Server by using Secure Sockets Layer (SSL) encryption. Error: "java.lang.ArrayIndexOutOfBoundsException: 64".
at com.microsoft.sqlserver.jdbc.SQLServerConnection.terminate(SQLServerConnection.java:1352)
at com.microsoft.sqlserver.jdbc.TDSChannel.enableSSL(IOBuffer.java:1533)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.connectHelper(SQLServerConnection.java:1042)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.login(SQLServerConnection.java:817)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.connect(SQLServerConnection.java:700)
at com.microsoft.sqlserver.jdbc.SQLServerDriver.connect(SQLServerDriver.java:842)
at com.sap.xmii.Illuminator.tools.database.ConnectionPool.getConnection(ConnectionPool.java:356)
at com.sap.xmii.Illuminator.tools.database.ConnectionPool.createConnectionObject(ConnectionPool.java:332)
at com.sap.xmii.Illuminator.tools.database.ConnectionPool.getConnectionObject(ConnectionPool.java:193)
at com.sap.xmii.Illuminator.tools.database.ConnectionHolder.getConnection(ConnectionHolder.java:89)
at com.sap.xmii.Illuminator.server.ConnectorStatus.<init>(ConnectorStatus.java:41)
at com.sap.xmii.Illuminator.connectors.IDBC.IDBC.getStatus(IDBC.java:50)
at com.sap.xmii.ejb.dataservers.DataServerBean.getServerStatusMap(DataServerBean.java:221)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.sap.engine.services.ejb3.runtime.impl.RequestInvocationContext.proceedFinal(RequestInvocationContext.java:47)
at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:166)
at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext$InvocationContextImpl.proceed(AbstractInvocationContext.java:131)
at com.sap.xmii.ejb.common.AdministrationInterceptor.wrapRuntimeExceptions(AdministrationInterceptor.java:46)
at com.sap.xmii.ejb.common.AdministrationInterceptor.assertHasPermission(AdministrationInterceptor.java:34)
at sun.reflect.GeneratedMethodAccessor525.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.sap.engine.services.ejb3.runtime.impl.Interceptors_Application.invoke(Interceptors_Application.java:53)
at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:179)
at com.sap.engine.services.ejb3.runtime.impl.Interceptors_StatesTransition.invoke(Interceptors_StatesTransition.java:19)
at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:179)
at com.sap.engine.services.ejb3.runtime.impl.Interceptors_Resource.invoke(Interceptors_Resource.java:50)
at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:179)
at com.sap.engine.services.ejb3.runtime.impl.Interceptors_Transaction.doWorkWithAttribute(Interceptors_Transaction.java:37)
at com.sap.engine.services.ejb3.runtime.impl.Interceptors_Transaction.invoke(Interceptors_Transaction.java:21)
at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:179)
at com.sap.engine.services.ejb3.runtime.impl.Interceptors_MethodRetry.invoke(Interceptors_MethodRetry.java:46)
at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:179)
at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:191)
at com.sap.engine.services.ejb3.runtime.impl.Interceptors_StatelessInstanceGetter.invoke(Interceptors_StatelessInstanceGetter.java:23)
at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:179)
at com.sap.engine.services.ejb3.runtime.impl.Interceptors_SecurityCheck.invoke(Interceptors_SecurityCheck.java:25)
at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:179)
at com.sap.engine.services.ejb3.runtime.impl.Interceptors_ExceptionTracer.invoke(Interceptors_ExceptionTracer.java:17)
at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:179)
at com.sap.engine.services.ejb3.runtime.impl.DefaultInvocationChainsManager.startChain(DefaultInvocationChainsManager.java:138)
at com.sap.engine.services.ejb3.runtime.impl.DefaultEJBProxyInvocationHandler.invoke(DefaultEJBProxyInvocationHandler.java:164)
at $Proxy606.getServerStatusMap(Unknown Source)
at com.sap.xapps.xmii.ui.admin.dataservices.dataservercomp.DataServerController.populateServerStatus(DataServerController.java:347)
at com.sap.xapps.xmii.ui.admin.dataservices.dataservercomp.wdp.InternalDataServerController.populateServerStatus(InternalDataServerController.java:263)
at com.sap.xapps.xmii.ui.admin.dataservices.dataservercomp.DataServersView.wdDoModifyView(DataServersView.java:302)
at com.sap.xapps.xmii.ui.admin.dataservices.dataservercomp.wdp.InternalDataServersView.wdDoModifyView(InternalDataServersView.java:1712)
at com.sap.tc.webdynpro.progmodel.generation.DelegatingView.doModifyView(DelegatingView.java:94)
at com.sap.tc.webdynpro.progmodel.view.View.modifyView(View.java:746)
at com.sap.tc.webdynpro.progmodel.window.ViewController.modifyView(ViewController.java:254)
at com.sap.tc.webdynpro.clientserver.cal.ClientComponent.doModifyView(ClientComponent.java:432)
at com.sap.tc.webdynpro.clientserver.cal.ClientComponent.doModifyView(ClientComponent.java:438)
at com.sap.tc.webdynpro.clientserver.phases.ModifyViewPhase.execute(ModifyViewPhase.java:69)
at com.sap.tc.webdynpro.clientserver.window.WindowPhaseModel.processRequestPartly(WindowPhaseModel.java:162)
at com.sap.tc.webdynpro.clientserver.window.WindowPhaseModel.doProcessRequest(WindowPhaseModel.java:110)
at com.sap.tc.webdynpro.clientserver.window.WindowPhaseModel.processRequest(WindowPhaseModel.java:97)
at com.sap.tc.webdynpro.clientserver.window.WebDynproWindow.processRequest(WebDynproWindow.java:515)
at com.sap.tc.webdynpro.clientserver.cal.AbstractClient.executeTasks(AbstractClient.java:58)
at com.sap.tc.webdynpro.clientserver.cal.ClientApplication.doExecute(ClientApplication.java:1671)
at com.sap.tc.webdynpro.clientserver.cal.ClientApplication.doProcessing(ClientApplication.java:1485)
at com.sap.tc.webdynpro.clientserver.session.ApplicationSession.doApplicationProcessingStandalone(ApplicationSession.java:908)
at com.sap.tc.webdynpro.clientserver.session.ApplicationSession.doApplicationProcessing(ApplicationSession.java:880)
at com.sap.tc.webdynpro.clientserver.session.ApplicationSession.doProcessing(ApplicationSession.java:357)
at com.sap.tc.webdynpro.clientserver.session.RequestManager.doProcessing(RequestManager.java:326)
at com.sap.tc.webdynpro.serverimpl.core.AbstractDispatcherServlet.doContent(AbstractDispatcherServlet.java:87)
at com.sap.tc.webdynpro.serverimpl.wdc.DispatcherServlet.doContent(DispatcherServlet.java:89)
at com.sap.tc.webdynpro.serverimpl.core.AbstractDispatcherServlet.doPost(AbstractDispatcherServlet.java:62)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:754)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
at com.sap.engine.services.servlets_jsp.server.Invokable.invoke(Invokable.java:152)
at com.sap.engine.services.servlets_jsp.server.runtime.RequestDispatcherImpl.doWork(RequestDispatcherImpl.java:367)
at com.sap.engine.services.servlets_jsp.server.runtime.RequestDispatcherImpl.forward(RequestDispatcherImpl.java:490)
at com.sap.tc.webdynpro.serverimpl.wdc.ForwardServlet.doPost(ForwardServlet.java:73)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:754)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
at com.sap.engine.services.servlets_jsp.server.Invokable.invoke(Invokable.java:152)
at com.sap.engine.services.servlets_jsp.server.Invokable.invoke(Invokable.java:38)
at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:457)
at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:210)
at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:441)
at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:430)
at com.sap.engine.services.servlets_jsp.filters.DSRWebContainerFilter.process(DSRWebContainerFilter.java:38)
at com.sap.engine.services.httpserver.chain.AbstractChain.process(AbstractChain.java:78)
at com.sap.engine.services.servlets_jsp.filters.ServletSelector.process(ServletSelector.java:81)
at com.sap.engine.services.httpserver.chain.AbstractChain.process(AbstractChain.java:78)
at com.sap.engine.services.servlets_jsp.filters.ApplicationSelector.process(ApplicationSelector.java:278)
at com.sap.engine.services.httpserver.chain.AbstractChain.process(AbstractChain.java:78)
at com.sap.engine.services.httpserver.filters.WebContainerInvoker.process(WebContainerInvoker.java:81)
at com.sap.engine.services.httpserver.chain.HostFilter.process(HostFilter.java:9)
at com.sap.engine.services.httpserver.chain.AbstractChain.process(AbstractChain.java:78)
at com.sap.engine.services.httpserver.filters.ResponseLogWriter.process(ResponseLogWriter.java:60)
at com.sap.engine.services.httpserver.chain.HostFilter.process(HostFilter.java:9)
at com.sap.engine.services.httpserver.chain.AbstractChain.process(AbstractChain.java:78)
at com.sap.engine.services.httpserver.filters.DefineHostFilter.process(DefineHostFilter.java:27)
at com.sap.engine.services.httpserver.chain.ServerFilter.process(ServerFilter.java:12)
at com.sap.engine.services.httpserver.chain.AbstractChain.process(AbstractChain.java:78)
at com.sap.engine.services.httpserver.filters.MonitoringFilter.process(MonitoringFilter.java:29)
at com.sap.engine.services.httpserver.chain.ServerFilter.process(ServerFilter.java:12)
at com.sap.engine.services.httpserver.chain.AbstractChain.process(AbstractChain.java:78)
at com.sap.engine.services.httpserver.filters.SessionSizeFilter.process(SessionSizeFilter.java:26)
at com.sap.engine.services.httpserver.chain.ServerFilter.process(ServerFilter.java:12)
at com.sap.engine.services.httpserver.chain.AbstractChain.process(AbstractChain.java:78)
at com.sap.engine.services.httpserver.filters.MemoryStatisticFilter.process(MemoryStatisticFilter.java:57)
at com.sap.engine.services.httpserver.chain.ServerFilter.process(ServerFilter.java:12)
at com.sap.engine.services.httpserver.chain.AbstractChain.process(AbstractChain.java:78)
at com.sap.engine.services.httpserver.filters.DSRHttpFilter.process(DSRHttpFilter.java:43)
at com.sap.engine.services.httpserver.chain.ServerFilter.process(ServerFilter.java:12)
at com.sap.engine.services.httpserver.chain.AbstractChain.process(AbstractChain.java:78)
at com.sap.engine.services.httpserver.server.Processor.chainedRequest(Processor.java:475)
at com.sap.engine.services.httpserver.server.Processor$FCAProcessorThread.process(Processor.java:269)
at com.sap.engine.services.httpserver.server.rcm.RequestProcessorThread.run(RequestProcessorThread.java:56)
at com.sap.engine.core.thread.execution.Executable.run(Executable.java:122)
at com.sap.engine.core.thread.execution.Executable.run(Executable.java:101)
at com.sap.engine.core.thread.execution.CentralExecutor$SingleThread.run(CentralExecutor.java:328)
Caused by: javax.net.ssl.SSLException: java.lang.ArrayIndexOutOfBoundsException: 64
at com.sun.net.ssl.internal.ssl.Alerts.getSSLException(Alerts.java:190)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1731)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1692)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.handleException(SSLSocketImpl.java:1675)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1204)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1181)
at com.microsoft.sqlserver.jdbc.TDSChannel.enableSSL(IOBuffer.java:1483)
... 115 more
Caused by: java.lang.ArrayIndexOutOfBoundsException: 64
at com.sun.crypto.provider.TlsPrfGenerator.expand(DashoA13*..)
at com.sun.crypto.provider.TlsPrfGenerator.doPRF(DashoA13*..)
at com.sun.crypto.provider.TlsPrfGenerator.doPRF(DashoA13*..)
at com.sun.crypto.provider.TlsMasterSecretGenerator.engineGenerateKey(DashoA13*..)
at javax.crypto.KeyGenerator.generateKey(DashoA13*..)
at com.sun.net.ssl.internal.ssl.Handshaker.calculateMasterSecret(Handshaker.java:753)
at com.sun.net.ssl.internal.ssl.Handshaker.calculateKeys(Handshaker.java:716)
at com.sun.net.ssl.internal.ssl.ClientHandshaker.serverHelloDone(ClientHandshaker.java:870)
at com.sun.net.ssl.internal.ssl.ClientHandshaker.processMessage(ClientHandshaker.java:238)
at com.sun.net.ssl.internal.ssl.Handshaker.processLoop(Handshaker.java:593)
at com.sun.net.ssl.internal.ssl.Handshaker.process_record(Handshaker.java:529)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:925)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1170)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1197)
... 117 more

 Error occurred while creating a database connection
[EXCEPTION]
com.sap.xmii.Illuminator.system.CommunicationException: Error occurred while creating a database connection
at com.sap.xmii.Illuminator.connectors.IDBC.IDBC.doProcessRequest(IDBC.java:81)
at com.sap.xmii.Illuminator.connectors.AbstractConnector.processRequest(AbstractConnector.java:83)
at com.sap.xmii.Illuminator.server.QueryEngine.run(QueryEngine.java:49)
at com.sap.xmii.Illuminator.services.handlers.IlluminatorService.processRequest(IlluminatorService.java:82)
at com.sap.xmii.Illuminator.services.ServiceManager.run(ServiceManager.java:69)
at com.sap.xmii.servlet.Illuminator.service(Illuminator.java:68)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
at com.sap.xmii.servlet.ServletRunner.run(ServletRunner.java:80)
at com.sap.xmii.common.threading.RequestCaller$1.run(RequestCaller.java:57)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:396)
at com.sap.xmii.common.threading.RequestCaller.call(RequestCaller.java:51)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:722)

Regards,

SKD

ODBC Driver 17.2.0.1 does not work on Server 2016 - Driver's SQLAllocHandle on SQL_HANDLE_ENV failed

$
0
0
just upgraded my odbc driver from msodbcsql_17.1.0.1_x64.msi to msodbcsql_17.2.0.1_x64.msi on a Server 2016 Standard.
Using the odbcad32.exe  gui i am no longer able to create a new connection using the updated driver. The dialog simply does not appear.
When i test my connections an error dialog appears telling me:
Microsoft ODBC Driver Manager: Driver's SQLAllocHandle on SQL_HANDLE_ENV failed
Reverting to 17.1.0.1 works again.
Anyone with the same issue?
Viewing all 4164 articles
Browse latest View live


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