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

SQL Server Standard 2016 and iSeries(IBM AS400) Linked Server

$
0
0

Does SQL Server Standard 2016 support Linked Server access to an IBM iSeries(AS400)?  Our current SQL 2008 installation links via the IBM DB2 for i IBMDASQL OLE DB Provider data source.

Thank you,

Mike


OPENROWSET and Map drive access issue

$
0
0

in my open row set i use map drive but things is not working but when i use normal path like c:\CSV\testing.xlsx then no issue occur. so what is the suggestion. please guide me.

INSERT INTO OPENROWSET ('Microsoft.ACE.OLEDB.12.0','Excel 12.0;Database=M:\testing.xlsx;','SELECT * FROM [Sheet1$]')select top 10*fromEmp2

thanks

3 queries combined

$
0
0

Hi
I have a table 'tblLvBalanceonDate' where it has Empid,LeaveType,LeaveBalance,StatusonDate.

Now i want to Query;
Every Empid, what is the LeaveBalance on Date 30/9/16 if not available, last date less than 30/9/16.

I have 3 Leave type namely 2,3,6. If not possible Its ok we can query three times.

Pls suggest on this .

is it possible to find out the number of active connections for specific connection string?

$
0
0

I get the following error in uls log when running SSRS data driven subscription in SharePoint integration mode:

Throwing Microsoft.ReportingServices.ReportProcessing.ProcessingAbortedException: , Microsoft.ReportingServices.ReportProcessing.ProcessingAbortedException: 处理报表时出错。 ---> Microsoft.ReportingServices.ReportProcessing.ReportProcessingException: 无法与数据源“EIPReportsDW”建立连接。 ---> System.InvalidOperationException: 超时时间已到。超时时间已到,但是尚未从池中获取连接。出现这种情况可能是因为所有池连接均在使用,并且达到了最大池大小。 

Similar to https://social.msdn.microsoft.com/Forums/sqlserver/en-US/08347303-ad0a-446c-b944-385ac22c68f1/reporting-services-scheduled-reports-are-not-being-executed-and-success-of-fix-puzzles-me?forum=sqlreportingservices and https://social.technet.microsoft.com/Forums/windows/en-US/a05d23ad-b636-45a7-8e6f-a7317ccf1b38/systeminvalidoperationexception-timeout-expired-the-timeout-period-elapsed-prior-to-obtaining-a?forum=sqlreportingservices

According to  https://msdn.microsoft.com/en-us/library/ms254503(v=vs.110).aspx connection pool groups map to unique connection strings. When integrated security is used, connection pools map to connection strings.

My report have only two datasets to the EIPReportDW database, and the Data Driven Subscription have 11 lines of parameters from a SharePoint list to 'drive' the subscription, so, i don't think that there will be more then 100 connections (the default as i did not specify in the datasource) in the pool. 

The problem is, how can i find out how many connections were there in the pool for the connection string associated with the EIPReportDW datasource? Which performance counter shall i use?


SQL Server Native Client 11.0 installed in AWS (Redhat Linux server) but fails connection when connecting using isql or sqlcmd.

$
0
0

I installed SQL Server Native Client 11.0 and UnixODBC Driver 2.3.0 successfully in a AWS instance (Linux Redhat server). But when trying to connect through isql or sqlcmd fails to connect. Please help

I assume that DSN with the servername and instance needs to be configured in two places

1) etc/odbc.ini

[SQLServerNativeClient]
Description=Microsoft SQL Server ODBC Driver V1.0 for Linux
Driver=/usr/local/lib64/libsqlncli-11.0.so.1790.0
Trace=Yes
Server=tcp:<Server name>\<instance name>,Port number
Trusted_Connection=yes

2) in root .odbc.ini

[SQLServerNativeClient]
Description=Microsoft SQL Server ODBC Driver V1.0 for Linux
Driver=/usr/local/lib64/libsqlncli-11.0.so.1790.0
Trace=Yes
Server=tcp:<Server name>\<instance name>,Port number
Trusted_Connection=yes

Also here is the isql command

isql -v SQLServerNativeClient <sql server authentication user name> <password>

When I run isql command,

[S1T00][unixODBC][Microsoft][SQL Server Native Client 11.0]Login timeout expired
[08001][unixODBC][Microsoft][SQL Server Native Client 11.0]A network-related or instance-specific error has occurred while establishing a connection to SQL Server. Server is not found or not accessible. Check if instance name is correct and if SQL Server is configured to allow remote connections. For more information see SQL Server Books Online.
[08001][unixODBC][Microsoft][SQL Server Native Client 11.0]TCP Provider: Error code 0x6E
[ISQL]ERROR: Could not SQLConnect

Also when I ran sqlcmd command, I get this

sqlcmd -S Servername\instance-name

Below is the output when I ran 

SqlState IM002, Data source name not found, and no default driver specified

I am not sure why is not connecting. Any help would be much appreciated.



SQLSTATE = 08S02, SMux Provider Physical connection is not usable

$
0
0

A power user keeps getting this error, she's connected via client > database server. The DB server is a VM on ESXi 5.0 with a e1000 network adapter. I read an article of someone suggesting to change the nic to vmxnet3 if the VM is being hosted on ESXi 4, but we are running 5.0. We did not have a network disconnect at the time the user reported this error (14:57). About 4 other power user connect to the DB server and do not get this error (to add to the mistery). Only this one user keeps getting the error. 

Client: Windows 7 64 bit

DB Server: Win2008 R2, SQL 2008 R2 (10.50)

DB server VM on ESXi hypervisor version 5.0.0

Here's the error information:

Error Information

     Error Occurred On: 2014-05-21 14:57:57

     Error Type: Architecture Error

     Error Object Type: ds_psf_find_criteria.uf_save()

     Error Object: nvo_ext_datastore

     Error Message: Find|Criteria|Last Error:

 

SQLSTATE = 08S02

Microsoft SQL Native Client

SMux Provider: Physical connection is not usable [xFFFFFFFF].

 

No changes made to database.

 

UPDATE "dba"."find_criteria" SET "condition" = N'= %L%M%R' WHERE "criteria_id" = 455 AND "find_id" = 301

Product Information

     Product Name: Storer Information Management System

     Product Version: 5.000

     Product Build: 20140401

     Product Mode: Client

Installation Information

     Install Name: SIMSv41

     Install Directory: C:\StorerTV\SIMSv41

User Information

     User Name: cchubbuck

     User Id: 25

     Site Id: 607

     Station Id: 1224

Database Information

     Instance Name: PM-BROADWAYSQL

     Database Name: PARTICIPANTMEDIA

Security Database Information

     Instance Name: PM-BROADWAYSQL

     Database Name: SIMSSECURITY

Language Database Information

     Instance Name: PM-BROADWAYSQL

     Database Name: PARTICIPANTMEDIA

Open Window Information

     Window Name: StorerTV.SIMS.Messaging.MessageHandler [SIMSv41]

     Window Name: Storer Information Management System

     Window Name: General Search - PIVOT

     Window Name: Application Error

System Information

     Computer Name: WIN-0441

     User Id: cchubbuck

     CPU: Pentium

     OS Type: WindowsNT

     OS Version: 6.1.0

     Physical Memory: 4,294,967,295 / 4,294,967,295

     Virtual Memory: 2,147,352,576 / 1,044,283,392

     Screen: 1920 by 1080

     Colors: 4294967296

Missing index in SQL Server

$
0
0

What does missing index in SQL server mean which can e found from sys.dm_db_missing_index_groups?

An index is created if necessary. Usually an index is created on a columnif the column is used in where clause.

Then where does the missing indexes are coming from? Without a query where the index will be used? Can anyone make it clear?

Here is a link, I did not get what the output is for-

http://blog.sqlauthority.com/2011/01/03/sql-server-2008-missing-index-script-download/

Ole Automation Procedures

$
0
0

One of the application team wants us to enable "Ole Automation Procedures".  They also provided command and links.

Expected command set:

sp_configure 'show advanced options', 1; 

GO 

RECONFIGURE; 

GO 

sp_configure 'Ole Automation Procedures', 1; 

GO 

RECONFIGURE; 

GO 

Documentation: https://msdn.microsoft.com/en-us/library/ms191188.aspx

Can anyone tell me what is "Ole Automation Procedures" and why it is used for?


How to remove Table (Heap) Fragmentation

$
0
0

I used below query to find Table (Heap) & Index fragmentation. How can I remove Table (Heap) Fragmentation?

SELECT dbschemas.[name] as 'Schema',
dbtables.[name] as 'Table',
dbindexes.[name] as 'Index',
 indexstats.index_type_desc as 'Heap/Index Type',
indexstats.avg_fragmentation_in_percent as 'Fragmentation %',
indexstats.page_count,
indexstats.forwarded_record_count
FROM sys.dm_db_index_physical_stats (DB_ID(), NULL, NULL, NULL, NULL) AS indexstats
INNER JOIN sys.tables dbtables on dbtables.[object_id] = indexstats.[object_id]
INNER JOIN sys.schemas dbschemas on dbtables.[schema_id] = dbschemas.[schema_id]
INNER JOIN sys.indexes AS dbindexes ON dbindexes.[object_id] = indexstats.[object_id]
AND indexstats.index_id = dbindexes.index_id
WHERE indexstats.database_id = DB_ID()
ORDER BY indexstats.avg_fragmentation_in_percent desc;

I have a ODBC DSN Question

$
0
0

I'm using a ODBC driver to connect to a online accountancy database.

When I use the default DSN i can sync trough ODBC. But I need to sync with different DB's 
So I use different DSN's, when I try to connect to the secified DB it tells me Connection with server OK.

But the process stops because there are errors.

MySql Unable to connect to any of the specified MySql hosts Error

$
0
0

Hi,

I am working on a project. I am trying to connect my database which is on 1and1 with C#. But I get errors. I have add a screenshot. How can I solve that? Could someıne help me? Also I am going to add my C# codes.

Codes:

class database
    {
        string ctcn;

        public void Connect()
        {

            MySqlConnectionStringBuilder csb = new MySqlConnectionStringBuilder();

            csb.UserID = "user_name";
            csb.Password = "password";
            csb.Database = "database_name";
            csb.Server = "database_name.db.1and1.com";
            csb.Port = 3306;

            ctcn = csb.ToString();
        }

        public void technicianSave(string name)
        {
            Connect();

            using (MySqlConnection connection = new MySqlConnection(ctcn))
            {
                connection.Open();
                MySqlCommand cmd = new MySqlCommand("INSERT INTO TechnicianDetails (TechnicianName) VALUES (@Name)");
                cmd.CommandType = CommandType.Text;
                cmd.Connection = connection;
                cmd.Parameters.AddWithValue("@Name", name);

                cmd.ExecuteNonQuery();
                connection.Close();
            }
        }
}

I got error atconnection.Open();

Thank you.

OleDbException: "[DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access denied

$
0
0

The last couple of days I receive complaints about connection loss from the website to the database.

In the event viewer a lot of errors.

Exception information: 
    Exception type: OleDbException 
    Exception message: [DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access denied. 


This only occurs for a couple of minutes and the problem seems to disappear.

What can cause these connectivity issues?

Wide disparity in SQL 2014 queries run from different workstations

$
0
0

I’ve run into an inexplicable problem with query execution times on my LAN. All of the workstations are Windows 10, but one of them can pull run an ODBC query out of an Access application (all machines are running the same version of Access and the identical application) much faster than the others. All of them are on the same network in the same building with 1Gbps network cards. The problem has to be on the SQL-2014 server … all of the machines show no CPU activity while the query is being run.

The query takes 3 seconds to run on the server itself. These are the times I encounter when running it from the workstation application:

Why is the server returning the query results so much faster to the second machine than the other two? Is there any way that I can get the other two to match it?

Windows authentication works by default with SQL Server, when empty username/password are passed

$
0
0

I'm implementing Windows Authentication feature with SQL Server, for my project and faced this strange problem. In the connection string, i have added a new parameter "Trusted_Connection" and if we have to enable windows authentication feature i'm setting it as 'yes' otherwise setting it explicitly 'no'. (Even it should be by default 'no') The feature was working fine until i tried passing a empty username and password in the connection string.

Driver={SQL Server};Server=localhost;Database=test;UID=;PWD=;Trusted_Connection=no

Strangely, this established a connection with the database and it seems to use the windows user authentication.Tested by running from some other user who don't have required permissions and it failed.

The API used to connect to the sql server is:

SQLDriverConnect(hDbc, NULL, ConnStr, SQL_NTS, NULL, 0, NULL, SQL_DRIVER_COMPLETE)

Is this expected behaviour of this API? If so, is there any link where i could get this info?

Thanks in advance.

i can&#39;t connect my 2nd pc to sql server 2000 data base in windows 7 platform

$
0
0

i have two pc which run windows7. one name server another acer. i have a data base software which run on server pc.

i need to access this data base from acer pc, but i can't do this. please help me anyone


Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding. Source: .Net SqlClient Data Provider

$
0
0

Hello,

We have website on windows 2008 R2 SP1 that connecting to the SQL 2008 R2 SP3

Intermittently users cannot generate the report (which will send the query to the database to run).

The web server reports below error:

Exception information: 
    Exception type: SqlException 
    Exception message: Timeout expired.  The timeout period elapsed prior to completion of the operation or the server is not responding. 

<u1:p></u1:p>

It works for several days, then it failed, then after the weekend, it works again on Monday, then it failed again couple days later.

I have no glue how to troubleshoot this intermittently problem.  On SQL server, "Remote query timeout = 600 seconds".  When running the query directly using the Visual Studio, it tooks only 8 seconds to run it.  So, not sure the error message timeout means  the query time out or connection time out.  Or does it also mean that the data didn't reach the web server in a timely manner?

Don't see error/warning on the SQL server at the reported date/time problem happened

I googled and found this blog, it mentioned about the timeout value in the web.config, but developer said the timeout defined in web.config is for the web request timeout.

Can anyone shed some light?  It looks like i am hitting into the wall now.  I know during all those time the problem happened on and off, servers didn't have any changes.

Are tere any SQL Server drivers that have been tested on AIX? JDBC or ODBC?

$
0
0

We have a number of Sybase ASE instances running on AIX 6.x and would like to be able to run scripts\programs on the AIX box than can reach out to SQL Server databases and pull information that can be acted upon during AIX batch sessions. If any one has tried this, I would love to hear about both positive and negative experiences.

Thanks,

Ian.

Connection to SQL Server using Windows Authentication from an application started as service

$
0
0

I have a requirement as below:

1) MSSQL server is running with Windows and SQL Server Authentication mode in a server say 'HOST1'

2) The application which needs to connect with the SQL Server is started as a service in say 'HOST2'.

3) As the service manager starts applications as the user "NT Authority\system", i'm unable to connect with the SQL Server in 'HOST1'.

4) I have the option of manually changing the user account using which the services are launched. That is,

    Right click service -> properties -> Log On -> Choose 'This Account' -> Provide a user which has permission to connect with SQL Server in 'HOST1'

5) But the problem is, there will be hundreds of services, running in hundreds of hosts. Hence modifying the user manually for all services is not possible in my case.

Please let me know the ways in which i could achieve this.

All access to sql server slows to a crawl when running a certain query

$
0
0

I wondering if anyone knows what might be wrong with my installation or what to check to improve my situation:

When I run a query that is a fuzzy join from a table with maybe 1000 records to a table with maybe 43000 records, it slows all other access to every database in the server to a crawl. The join is something like this:

insert into Table1
select field1, field2
from tableA a inner join tableB b
on a.field3 like '%' + b.field4 + '%'

and yes I would expect that to be a rather inefficient that would take a fair amount of time, but I don't understand why it slows down access to everything else including read/writes from access applications.

of course, in trying to troubleshoot this, it doesn't appear to do this slowing every time the query is run, but when it does do it, it seems that query runs several times longer that usual to boot. For instance, one time it takes 10 minutes, but another time it takes 2 hours..

Anyone got any ideas for me?

for reference, I am running SQL server 2014 with 56 GB of RAM, and 2 cores at 2 GHz

Regarding the Hop On Hop issue in SQL Server?

$
0
0

Hi,

Could some body please provide me the steps how can I create a Hop on Hop issue in sql server?

How to resolve the same issue?

Thank you

sris

Viewing all 4164 articles
Browse latest View live


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