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

Deleting data from a database in all table for more than 1 month

$
0
0

Hi there...Can you pls mention commands to delete last one month worth of data from a DB (SQL Server 2016 in a lab environment) as a DB is growing faster. Also suggest a best practice do that, pls let me know.


VT



[Microsoft][ODBC SQL Server Driver][DBNETLIB]SQL Server does not exist or access denied.

$
0
0

i have been trying to run an application. it was running fine few days back. but suddenly stopped to print the certificates created in the application.

so i tried to reinstall the crystal report and sql server and all the needed dll's for the application. but now when i try to start the application it doesnt even get started. it gives the following error-------

Error1- "[Microsoft][ODBC SQL Server Driver][DBNETLIB]SQL Server does not exist or access denied."

Error2- ""Run-time error '3709': The connection cannot be used to perform this operation.It is either closed or invalid in this context.

PLease suggest some way to make it correct.


Create process

$
0
0
We had a ransomware attack and need to recreate several months of new contact records (backup negligence on my part).  

Would it be possible to create a process that would create, link and possibly fast file new contact record from email received.  The email address which is our default search is in body not in header.

If possible, can a novice who has written a few processes do it?  Is it appropriate to ask for referrals on forum?

ODBC issue 18452 Login Failed from untrusted Domain

$
0
0

Hi,

I work on Workgroup environment and ODBC connection to server hosting MS Sql 2012 was working fine, now I get error 18452. I use windows Authentication for connection. 

Seeing MS Sql Server log, the connection from workstation is done with its local credentials and not server credential. I can access my server folders and also Stored credentials in Stored Usernames and Password using  rundll32.exe keymgr.dll, KRShowKeyMgr

How can I make ODBC use stored windows credentials for server rather than local workstation credentials

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

$
0
0

I have sql server in backend (server name B) & front end i am executing (Server A) though SQL management studio 2017 (SQL server is 2016 64 bit), i have installed access database engine 2013 & 2016 64 bit along with ms office 64 bit.

Still i see the error "

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

" could someone assist how to fix this.


Ganapathy

Cannot alter the login 'sa', because it does not exist or you do not have permission.

$
0
0
Msg 15247, Level 16, State 1, Line 3
User does not have permission to perform this action.
Msg 15247, Level 16, State 1, Procedure sp_addsrvrolemember, Line 29
User does not have permission to perform this action.
Msg 15151, Level 16, State 1, Line 2
Cannot alter the login 'sa', because it does not exist or you do not have permission.

Having problems using sqlcmd

$
0
0

Hi and thanks in advance for the help

I am using sqlcmd  to update a table from a SQL server 8 R2 to a SQL server 2012

I am receiving the following error

sqlcmd: error: Microsoft SQL server native client 10.0: unable to complete login process due to delay in opening server connection

The SQL 2012 has native client 11 and SQL R2 has native client 10 drivers

I installed the SQL native 10 drivers in the SQL 2012 server to see if that address the issue but after installation it is not accessible from the SQL server configuration manager

Any ideas

Thanks rio

sale for last 10 month sales

$
0
0
I have a Transaction table where i get all my sale Invoice record entry and Credit Invoice(which we get return after sale).
columns as ItemNo,Item DEsc,TransType(Sale-inv or Credit-inv)
Now i need last 10 month sales(Each month in one column with itemNo,description) for the particular item.

        Sale Dt      TypeItem NoItem DescTRansType                                                 Quantity
17/08/2014    CASH263513C100CAP-OIL FILTERSale-INV 1
17/08/2014    CASH924512K500LAMP ASSY-RR REFLEX LHSale-INV1
17/08/2014    CASH583023QA10MESH ASSY-FR BUMPER CTRSale-INV1
18/09/2014    CASH583023QA10PAD KIT-RR DISC BRAKECred-INV2
18/08/2014    CASH988503W000BLADE ASSY-RR WIPERCred-INV1
18/08/2014    CASH273012B010COIL ASSY-IGNITIONCred-INV1
18/08/2014    CASH263304X000OIL FILTERSale-INV1
19/08/2014    CASH281132G000FILTER-AIR CLEANERSale-INV1
19/08/2014     CASH971332B010FILTER-AIR CLEANERSale-INV1
ItemItem Desc                                                                                                    Aug                                   Sep
263513C100CAP-OIL FILTER1 
924512K500LAMP ASSY-RR REFLEX LH1 
583023QA10MESH ASSY-FR BUMPER CTR12
988503W000PAD KIT-RR DISC BRAKE1 
273012B010BLADE ASSY-RR WIPER1 
263304X000COIL ASSY-IGNITION1 
281132G000OIL FILTER1 
971332B010FILTER-AIR CLEANER1 


SYED


SAME QUERY BRINGS DIFFERENT RESULT BETWEEN MSDAORA AND ORACLE PROVIDER OLE DB

$
0
0

Dear All,

I have one view in oracle which gives no result, and it is correct!!!

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

SELECT DOCID, CUS.tracode,LEE.LEENAME,SDT.dotcode,SLD.docnumber,SLD.docenimerosisdate
FROM SLD,
      CUS,       LEE,       SDT
WHERE CUS.traid=SLD.traid
AND   LEE.leeid=CUS.leeid
AND   SLD.dotid=SDT.dotid AND   SDT.dotcode in ('ΕΤΔ','ΗΕΤΙΙ','ΕΤΙΙ', 'ΕΠΚ', 'ΗΕΠΚ')

AND   SLD.docenimerosisdate >='02/02/2018'
AND TRACODE IN ('09751','14698','05074','05044','05182','15656','05097')
AND SLD.pmtidpayment NOT IN ( 133,119)

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

when I run this from Oracle it is ok.

when I run this from SQL Server 2008 ( win2k3 server ) MSDAORA result is OK

when I run this from SQL Server 2008 ( win2k8 server ) Oralce Ole DB result is NOT OK.

I realize that the problem is the date format . But I can not change the date in oracle because it wont run

Is there any idea how to solve the problem

Thanks in advancefor your help

sql server 2012 row level security table on db1 and views another DB

$
0
0

Would like to provide sql server 2012 row level security ,all table on DB1 and views another DB2 to accomplish this 

.we are planning among of one below ,finally we decided to go with 3rd one but it is not possible since we don't have chaise to change the Database owner unless this option will not work.   

1. Setting the first database as TRUSTWORTHY and granting its owner AUTHENTICATE in the second database.

1<sup>st</sup> option not preferred since The users in ‘db_owner’ database role can include themselves in System Administrators server role and take control of the server.

2. Signing the objects with a certificate: 2<sup>nd</sup> option not preferred since don’t work on views.

3. Enabling the cross database ownership chaining.

We would preferred the3rd option but we don’t have choice to change the Database owner since it will break the existing application functionality

SO can you please suggest what is the best possible solution according to my requirement


Bcp out fails when using -q (quoted identifier)

$
0
0

Hi all,

When I use Bcp tool to export table's data, without -q it works fine, but when I try to export with -q, it fails with message "Login failed for user".

For example

bcp database.schema.table out table.dat -n -q -T -S serverinstance 

Could you please help me to understand why it does that, or is it a bug?

I'm using Ms SQL server 2012

Thanks in advance


KB4284815 for Server 2012 R2 breaks SQL Server Express 2012 data access

$
0
0

After updating my Server 2012 R2 host with KB4284815 (June 2018 cumulative update), it broke the ability for applications to communicate to SQL Server Express 2012 which is installed on that server. The error received was "[DBNETLIB] ConnectionOpen [Connect()] SQL Server Does not exist or access denied. 

Remote desktop access to the server was also broken. SQL Server Management Studio could not access any databases from domain connected workstations that previously could access the databases. 

The access connection is using Microsoft OLE DB Provider for SQL Server, Windows NT Integrated Security. This can be tested using a UDL file which also fails to be able to access a database when the Test Connection button is clicked in the Data Link 
Properties dialog.

The KB was uninstalled, server 2012 rebooted and things are functioning again. Can anyone comment if they have seen this problem and what is the cause? Is the KB patch defective? 



Deploying Microsoft OLE DB Driver for SQL Server through Intune

$
0
0

I have been trying to deploy Microsoft OLE DB Driver for SQL Server through Intune but fails all the time. I have used several parameters for a silent installation. The last parameter I have tried was

/qn IACCEPTMSOLEDBSQLLICENSETERMS=YES

based on this link:

https://docs.microsoft.com/en-us/sql/connect/oledb/applications/installing-oledb-driver-for-sql-server?view=sql-server-2017

I would appreciate any support!!


Encryption of Sensitive Data

$
0
0

Hi Team,

My requirement to encrypt the sensitive data (like SSN, dob etc..,). What is the best way to do this? either we can follow "Always encrypted" option which is only available in SQL Server 2016. OR column level encryption using symteric keys and certificate which is available in earlier to 2016 version . And my SQL Server version is 2014.

Please suggest me, with which i can go with? and also tell me, what are all the Pros and Cons when we deployed to Production server.

awaiting your reply

Regards

Sagar

Database Access Trouble

$
0
0

Hello. I have an SQL Server DB which I access either through a Management Studio 2017 or a C# application. The application is nominally a Console application because I need console for debug but it has a Windows.Form as a GUI. A lot of C# code is needed to perform many functions, shuffling the field values in the above mentioned database tables.

I have a wireless keyboard and a mouse. I noticed a few weeks ago that when I type in a character, sometimes many more identical characters appear added to the first one, so it is like a chain. I attributed it to my mouse thinking it was defective. I threw the keyboard and the mouse out and bought new ones at Best Buy, out local store. The problem of multiplying characters did not go away, it continues, it gives me a weird feeling, and I now attribute it to Windows 10 OS.

Occasionally my source code begins to shake and I shut everything down. A few hours ago after one of such shakedowns I lost access to my most important database in both C# code and SQL MS. Now I can see that database listed like this (in Management Studio):

ComeAndGetThr (Recovery Pending).

It's been pending already for a few hours. I am scared. I tried to wait, but how long can you wait? I tried to restart the machine, no effect. I really hate Win10. I have a home edition. It is packed with advertisement and I don't feel it is stable. My database is located on this very machine: C:\Program Files\Microsoft SQL Server\MSSQL13.MSSQLSERVER\MSSQL\DATA\

I do backup the database by simply copying the whole directory to an external disk drive with 5 TB of memory. But last time I backed it up right after the massive shakeup happened. I have no idea what it did to my tables. We always have good ideas a posteriory. So, now I am thinking about a failover cluster, etc. I have Community editions of both SQL Server and Visual Studio

What shall I do? Please help.

Thanks, - MyCatAlex


Why does attempting to connect to an unresolvable hostname result into a timeout?

$
0
0

When I use SQL Server Management Studio to connect to an unresolvable hostname (typing error or other mistake) it results into waiting the entire connection timeout (by default 30 s). However this seems to be unnecessary. since resolving the name takes much less time (e.g. I set the connection timeout to 1 s and this result to the same error below:

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: TCP Provider, error: 0 - No such host is known.)

So my question is: why doesn't the data access library fail much earlier when the hostname resolver returns a negative result?

I did some tests with the code below in LinqPad which resulted to the following numbers:

Timeout: 1 s, Runtime: 2278 ms
Timeout: 2 s, Runtime: 2279 ms
Timeout: 5 s, Runtime: 7117 ms
Timeout: 10 s, Runtime: 9788 ms

void Main()
{
	TestConnection("dummy", 1);
	TestConnection("dummy", 2);
	TestConnection("dummy", 5);
	TestConnection("dummy", 10);
}

public void TestConnection(string dataSource = "dummy", int connectTimeout = 30)
{
	var csb = new SqlConnectionStringBuilder() { DataSource = dataSource, ConnectTimeout = connectTimeout, NetworkLibrary = "dbmssocn" };
	var c = new SqlConnection(csb.ToString());
	var s = new Stopwatch();
	s.Start();

	try
	{
		c.Open();
		c.Close();
	}
	catch (Exception ex)
	{
		if (!ex.Message.Contains("No such host is known"))
		{
			Console.WriteLine(ex.Message);
		}
	}

	s.Stop();
	Console.WriteLine($"Timeout: {c.ConnectionTimeout} s, Runtime: {s.ElapsedMilliseconds} ms");
}



SQL Linked Server to Informix connests but

$
0
0

Hi,

I have created a linked server in SQL2008 which tests fine but when I use it e.g: -

select*fromOpenquery(Sentinel,'Select * from Customer'

I get the following error: -

Msg 7399, Level 16, State 1, Line 1

The OLE DB provider "Ifxoledbc" for linked server "Sentinel" reported an error. The provider did not give any information about the error.

Msg 7330, Level 16, State 2, Line 1

Cannot fetch a row from OLE DB provider "Ifxoledbc" for linked server "Sentinel".

AdventureWorksDW2016_EXT.bak question

Announcement: Microsoft OLE DB Driver for SQL Server (MSOLEDBSQL) Released

$
0
0

A new OLE DB driver, Microsoft OLE DB Driver for SQL Server (MSOLEDBSQL), has been released. This new driver includes the support for the latest TLS 1.2 standards and is backwards compatible with SQL Server Native Client 11 (SQLNCLI11).

Download: https://www.microsoft.com/en-us/download/details.aspx?id=56730

Microsoft SQLNCLi team blog announcement: https://blogs.msdn.microsoft.com/sqlnativeclient/2018/03/30/released-microsoft-ole-db-driver-for-sql-server/


Dan Guzman, Data Platform MVP, http://www.dbdelta.com

SQL Native Client, OLEDB Depreciation? And Recommendation to use ODBC?

$
0
0

Dear Microsoft,

In late 2011, Microsoft made an announcement that it is trying to align ODBC for non-relational data access on a blog post here. Later in early 2013 some ODBC drivers were introduced too as per this blog post here.

However, there seems to be no other communication about SQL Server Native Client  or Microsoft SQL Server OLE DB drivers retiring is found apart from those two blog posts above. All MSDN , Technet and SQL Server Books online have no mention of OLEDB or Native client retiring, discontinuing  or even being as depreciated feature. And here is link that points to Microsoft SQL Server official pages, with no mention of intention to depreciate OLEDB or Native Client.

Being data developer, We use SQL Server & SSIS a lot and it keeps me puzzled, Shall I continue to use SQL OLEDB or Shall I move to ODBC? In the meanwhile, it is evident Microsoft is reluctant fix many performance/other issues with ODBC, these issues can be tracked on Microsoft Connect 1  2 .

Now my question is:

  • What is the guideline (ODBC vs OLEDB or SQL Native Client) going forward to Data Developers?, please make it official and state more clearly.
  • Is it true that OLEDB or SQL Native Client are being depreciated? If so from which edition of SQL Server?
  • If so when is end of life for OLEDB or SQL Native Client? It is true Microsoft has already stopped releasing updates for these?

Please, please please respond, I tried Bing and Google they are not answering as wellL

Viewing all 4164 articles
Browse latest View live


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