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

SQL Server 2016 ODBC Connection Errors Occurring Intermittently: Need assistance with a solution

$
0
0

We have an application in a WS 2016 connecting to a SQL 2016 Server through ODBC Driver 11 for SQL Server version 2014.120.5543.11.  We are experiencing intermittent errors that are disrupting production.

Message example 1:       

Database Exception in CHtmlPage_Process::OpenPage() with tag OpenEx  

    The connection is broken and recovery is not possible. The client driver attempted to recover the connection one or more times and all attempts failed. Increase the value of ConnectRetryCount to increase the number of recovery attempts.
Communication link failure.

Message example 2:

       Database Exception in ExecuteSQL for 'SET XACT_ABORT OFF'. Error: The connection is broken and recovery is not possible. The client driver attempted to recover the connection one or more times and all attempts failed. Increase the value of ConnectRetryCount to increase the number of recovery attempts.
Communication link failure

We have tried ODBC SQL Server Native Client 11.0 version 2011.110.6518.00 as well.  The same error occurs.

Both drivers are set to Pool connections with a Timeout of 60.  

The programmers assure me they are using proper transaction control procedures. 

In this same environment the JDBC and IIS connections are remaining open in a sleeping status.  Sometimes over 150.

We are stumped and need some Microsoft technical guidance on settings to change or whether or not there is a known defect with the Drivers, SQL Server 2016, or WS 2016.

We appreciate your help.



LDF File size is growing fast

$
0
0

Hello,

Backup Policy: Daily Full backup, Every 8 hours Differential Backup and every 2 hours transaction log backup.

We are taking transaction log backup still size of the LDF file is growing fast. To avoid this can we shrink LDF file once in a month ?

Is it recommended or best practice to shrink the LDF file once in month to reduce the size LDF file ?

There is any impact on backup policy? When we take database backup is there any impact on LDF file size(ldf file size is grow) of that database ?

Please give your opinion on this.

Performance Tuning

$
0
0

Hello,

We are facing performance issue sometime. We identified that when there are lot of sessions is active we face the performance problem(CPU utilization goes to 100%).

There is no benchmark is set on SQL Server. Can you please help me to set up the benchmark for SQL Server ? Please tell me the process for set up benchmark ? 

We are using SQL Server 2014 with 4 core processor 16GB RAM Windows Server 2012 R2.

What should be change for this SQL query to work?

$
0
0

I do have the following query:

SELECT * FROM TRegistrationList, TProfiles WHERE
IDAutoNumber = @IDAutoNumber AND UserName = TUserName AND TFirstPlace <> 0
AND UserName = (SELECT UserName FROM (SELECT UserName,
DENSE_RANK() OVER (ORDER BY TFirstPlace DESC,TSecondCumulativeVotes DESC,
TThirdCumulativeVotes DESC) AS Rnk FROM TRegistrationList
WHERE IDAutoNumber = @IDAutoNumber AND TFirstVotes <> 0 )t WHERE Rnk = 1 )


This query work and return all values when only one record is found. When it found more than one the following error is display:

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

What should I change for query to work when one record or more are return? Thanks to all.



Connection error

$
0
0

SQL Newbie level.
SQL Server 2016 Express loaded on MS Essentials 2012R2

Had SQL 2014 Express running previously before ransomware attack.

Reformatted and loaded clean.
Then tried to load SQL2014 but failed.
Tried 2016 failed.
Logged in as Admin and got SQL 2016 to load.
Logged back in as user with admin rights.
Created a new user called ERP and attached backups from previous SQL 2008R2 database.
Had to drop ERP user and map security and owner rights.
Opened up ports 1422 in firewall for TCP/IP and program.

Connected database and it opens but when I run any Crystal reports it asks for the ERP password every time. So changed ODBC to use sa login. Works except for 3 reports.

What must I do to get SQL to connect with a user name I create other than sa.
What would restrict security on ERP user? Can this be fixed.


Missing DAO's when trying to install SSMAforAccess_7.8.0

$
0
0

Hi Forum Developors

I previously had this chat with the technical support in Azure

while trying to install SSMA for Access Setup.

  

https://docs.microsoft.com/en-us/sql/ssma/access/installing-sql-server-migration-assistant-for-access-accesstosql?view=sql-server-2017#prerequisites
I downloaded the prerequisites, microsoft net, but i already have it installed

so when i tried rerunning the SSMAforAccess_7.8.0, it says there are missing DAO's... so unsure what to do next
since the 1008 version the DAOs are all packaged with the access runtime. 

i then tried to download the access runtime https://www.microsoft.com/en-us/download/confirmation.aspx?id=54920

if i ran the 64 version, it co

mplained i had the 32 installed, and vice versa... now we already have office 365 access installed
now with some office products the interop package can get corrupt and needs reinstallation. It includes the DAO as well (https://blogs.msdn.microsoft.com/dataaccesstechnologies/2011/08/05/ssma-5-0-for-access-and-the-dao-requirement/ has some details if you are interested) go ahead and see if that package will install properly. you can get it here - 
here we are - https://www.microsoft.com/en-us/download/details.aspx?displaylang=en&id=18346


the 2007 should include the 12.0 DAO if i recall correctly
we might need to install the 2007 runtime too if you havent already (its here - https://www.microsoft.com/en-us/download/details.aspx?displaylang=en&id=4438)

Then reboot for it to index those new libraries; 

if that does not work i think it might be best to reach out to a specialist on the tool on our forums. let me grab a link for you
here we go - https://social.msdn.microsoft.com/Forums/en-US/home?forum=ssdsgetstarted&filter=alltypes&sort=lastpostdesc
if you do end up posting there just chat back in and give us the link. From there we can make sure that you get an answer

Any assistance is appreciated.

Thank you.

Simon

BID trace SQLBindParameter Value

$
0
0

Hi 

We have a legacy application this is written in C++ which is making ODBC calls and we are having weird ODBC cast errors during SQLPrepare and Invalid precision value during the SQLbindparameter function. We do not have access to source code and very difficult to reproduce the error. We are using ODBC Driver 13 for SQL server (13.1) for SQL 2016. 

ODBC trace log did not reveal much since the SQLBindparameter function calls provide the pointer address rather than actual value that was to the parameter. 

So I am now trying to collect the BID trace for ODBC so far I am unable to see the parameter values ?

example: 

{SQLHSTMT}, StatementText: &quot;SELECT [Test] ,[value],[date],[amount] FROM [Test].[dbo].[Table] where test =?&quot;, TextLength: -3

enter_01 &lt;SQLBindParameter|API|ODBC|DM&gt; 47#{STMT} StatementHandle: 0000017D7C632350{SQLHSTMT}, ParameterNumber: 1, InputOutputType: 1{SQL_PARAMIO}, ValueType: -8{SQL_CTYPE}, ParameterType: 12{SQL_TYPE}, ColumnSize: 8, DecimalDigits: 0, ParameterValuePtr: 0000017D7C4A74B8, BufferLength: 16, StrLen_or_IndPtr: 0000017D7C4A74B0

When I looked at the SQL Bind it still does provide me the parameter value and how can I get the parameter value?


SQL Script for total daily transaction?

$
0
0

How to find the count of daily transactions from the SQL database?


Disconnect connections from SQL Server through Kill command

$
0
0

Hi all,

Currently I am reviewing an ASP.NET web application where the developers have not taken care to remove/dispose database connections properly. Rather I could observe in the production environment where some one has created a job/batch program which removes processId using "Kill SPid command from backend. In what I understand here, they run a stored procedure which check all ll idle connections which are not used. I believe this is called as Orphaned connections.

Now, my question here. All .NET managed data access components will have connection handles which are left in orphaned state. Does it mean, I have connection leaks problem? 

Please validate my understandings and share knowledge.

Thank you
Saravanakumar

Windows authentication mode, based on JDBC program can connect to other Windows accounts

$
0
0

I have two Windows accounts: NETWORK SERVICE (built-in account), AD account;
In Window authentication mode, the AD account has been added as the login account of SQLServer;

My JAVA process runs on NETWORK SERVICE. Can I use the AD account to connect to the database via JDBC?

I look forward to your reply. thank.

not able to delete the records using linked server.

$
0
0

User  able to perform the Delete operation directly in servername123, but user is not able to perform Delete operation on servername123 through some other servers and getting below error.He has read and write permissions on DB,but still he is getting below issue.

The delete permission was denied on the object 'table name',database 'dbname',schema dbo

Stored procedure fails always fails, but exact copy of it always succeeds

$
0
0

Environment

  • Python: 3.6.6 x64 and 3.7.0 x64
  • pyodbc: 4.0.22 and 4.0.23
  • OS: Mac High Sierra and Windows Server 2016
  • DB: SQL Server
  • driver: ODBC SQL 17 2.0.0 and 2.0.1

Issue

This is a very strange issue. Basically, I have a stored procedure and whenever I execute it using pyodbc I get the following error:
pyodbc.Error: ('HY000', 'The driver did not supply an error!')

If I execute it using SQL Operations Studio OR using SQL Server Management Studio 17, it works fine. Even stranger, if I create the stored procedure with a different name and the exact same SQL it works! I'm completely stumped and not convinced it is a pyodbc problem but may, instead, be an ODBC SQL problem.

The code that executes it looks like the following:
cursor.execute('EXEC p_build_analytics_model ?', import_id)

Apologies that I can't provide minimal working example because the SP is quite complex and removing some of the code does seem to eliminate the problem. What doesn't make sense to me is why renaming it would allow it to succeed!

Here are all the things I have tried:

  • Dropping and recreating the stored procedure (didn't help)
  • Using CALL syntax instead of EXEC (didn't help)
  • Hardcoding the parameter value instead of passing it (didn't help)
  • Removing some of the SQL statements within the SP (through trial and error I was able to remove statements until it worked, but haven't figured out exactly which statements are the root cause yet because it is a very long procedure)
  • Creating the stored procedure with a different name (this works, but it makes me nervous!)

Looking at the ODBC trace the error returned from the server is:

DIAG [42000] [Microsoft][ODBC Driver 17 for SQL Server][SQL Server]The server failed to resume the transaction. Desc:7700000001. (3971)

DIAG [01000] [Microsoft][ODBC Driver 17 for SQL Server][SQL Server]The transaction active in this session has been committed or aborted by another session. (3926)

However, I looked through all of the stored procedures on that DB in detail and there is no reference to that procedure except where it is named, i.e. no other procedures call that procedure. Further, this is on a testing database that only I have access to and I ran this test in isolation many times with the same result. I can always call the original SP named p_build_analytics_model and it fails, but calling an exact duplicate with the name p_build_analytics_model_temp always succeeds.

Has anyone else observed this or do you have any suggestions how to resolve?

Duplicate post

CREATE VIEWS ON REMOTE DATABASE

$
0
0

Hi All,

Would like create views on remote database ,please find the below my environment

1.DB1 (Have tables tb1,tb2)

2.DB2 (Create the views for the above DB1 tables ,means that create views  from remote tables  like tb1view,tb2 view)

3.give row level security on views like we have 3 companies data and would like to create 3 DB roles like cmp1,cmp2 and cmp3 and map the company_1 users to CMP1 roles so that users who are belongs  company_1 to see company_1  data and not able to see other company data.

But, unable to create the views on DB2 with dbo.tb1 , I can able to create DB1.dbo.tb1 so that unable to apply the schema binding. 


What is the difference between System.Data.SqlClient, System.Data.OledbClient and System.Data.OdbcClient for accessing sql data.

$
0
0
I would like to know what will be the difference between the sqlclient or oledbclient or odbcclient for accessing data from SQL Server relational database. I would like to point my question in the performance direction.

Problems with OraOLEDB.Oracle

$
0
0

Good day everyone....

I have installed the OraOLEDB.Oracle Provider on 3 different servers, and have made a link server on all three.

On two of the machines, I am successful in retrieving data from the Oracle database.  But, on the third machine, I receive this error:

Server: Msg 7399, Level 16, State 1, Line 1
The OLE DB provider "OraOLEDB.Oracle" for linked server "employee_prod" reported an error. The provider did not give any information about the error.
Server: Msg 7303, Level 16, State 1, Line 1
Cannot initialize the data source object of OLE DB provider "OraOLEDB.Oracle" for linked server "tims2_prod".

On the machine which is generating the error, I can use SQL*Plus to connect to the remote database.  I can also connect to the database using the "ODBC Data Source Administrator" when I create a system DSN.  It would appear that the driver is installed and working correctly, but SQL Server can not access it.

I have also uninstalled/installed serveral times.

All of our servers are running W2003 Standard X64 with SQL Server 2005 Standard 64-bit Edition.

Does anyone have any suggestions?

SQLXML 2.0 driver 32 bit needs to be installed on a 64 bit new machine

$
0
0

We are supposed to install SQLXML 2.0 32-bit to one of our new 64-bit app server which will have legacy apps that will access to new SQL Servers (2017)

One option that contains 32 bit SQLXML 2.0 is installing SQL Server 2000 Client Tools on a new app server Windows 2016 - which is kind of a dumb idea.

Does anybody know if there is an old stand-alone 32 bit SQLXML 2.0 package from Microsoft somewhere?

Merci

Cornelia

row level security on remote views

$
0
0

Hi All

all tables exist on DB1 databases and needs to be deployed the views on DB2 database. provide the row level security on views by DB roles . 

Facing issue like below

1. The server principal S-1-9-3-853939384-1286931471-2133699492-1464102660 is not able to access the database  under the current security context.

2. unable to create views with schema binding. 

Please help on this.

ODBC drivers missing for Access,excel,oracle etc when trying to create any new system/user DSN through ODBC data source administrator

$
0
0
When i am trying to create any new System/User DSN drivers corresponding to all the databases except SQL server is not showing up in the wizard in ODBC data source administrator. I am using windows 7 , 64 bit machine

How to establish connection between visual C++ and MS SQLDB

$
0
0

Hi guys,

I am trying to write a Windows Form Application in Visual Studio 2017 regarding a database. I have created a local database file and also added a SQL query file which intent to add one row in this database. I have experience with C++ before, so the Windows form part is not so difficult to me.

But now, I don't know how to establish the Connection between the C++ program and the database. There are some examples in Internet but only in C# or VB which doesn't help so much. Can anyone help me a bit or give me a hint which direction should i go..

Thnaks in Advance!


Viewing all 4164 articles
Browse latest View live