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

Linked server to SSAS in opens catalogue in many minutes.

$
0
0

I am migrating SQL Server 2012 instance from machine A to another B. The instance has linked server to SSAS instance (running on machine C). When I expand SSAS linked server from machine A, it shows table list in 5 seconds but if I expand same linked server from machine B, it takes minutes to list tables.

I have tallied MSOLAP provider and linked server properties and all the parameters are matching.

Please inform me what can be wrong and how should I troubleshoot it?

Thanks!

 

 

How to get only month from hire_date from employees table?

$
0
0

Hello Friends

I have employees table with hire_date. I want to get employees who joined in the month of January.  

How can I write query for this?  Your help is highly appreciated.

Thanks in advance.




Mohamed_Rafi

Date related queries

$
0
0

Hello Friends

I am trying to query to get date of the first salary of the employees and experience of the employees.

SELECT FIRST_NAME, HIRE_DATE, LAST_DAY(HIRE_DATE)+1 FROM EMPLOYEES
SELECT FIRST_NAME, HIRE_DATE, FLOOR((SYSDATE-HIRE_DATE)/365)FROM EMPLOYEES

the above query doesn't work.  Your help is highly appreciated.


Mohamed_Rafi

Double insert in audit trail - VBA calling SQL Server procedure

$
0
0

I have a MS Access 2010 front end calling a SQL Server back end using VBA to call a stored procedure.

The VBA code is:

Sub ExecuteQuery(sQuery As String, oConnection As ADODB.Connection, oRS As ADODB.Recordset)

Dim oCommand As New ADODB.Command

    oCommand.CommandText = sQuery
    oCommand.CommandType = adCmdUnknown

    Set oConnection = GetNewConnection
    oCommand.ActiveConnection = oConnection

    DebugPrint "Send this query to the database for execution:" & vbNewLine & sQuery
    
    Set oRS = oCommand.Execute

The DebugPrint is a custom vba sub to write to both the immediate window and to a file.

The file output show the execute only occurring once.

11:49:48 AM Send this query to the database for execution:
execute GETEBTransactions '0000038692'

The stored procedure includes a call to a second proc to insert a record into an audit trail table.

The audit trail table is showing that every time VBA calls the stored procedure, the audit trail gets 2 records roughly one second apart.

What could be causing the first proc to be called twice?  And how can I eliminate that?

Limit to Size of SQL Database and how to gain full control for access

$
0
0
I've been using a program called AutoCaller that uses SSMS for a database.  Last week I was no longer able to save any new data to the SQL database.  The database is about five years old and at 10.5 GB . Is there a limit to the size of the SQL database?  If so, have a reached that threshold?  Can it be expanded further?  A 2nd question, with my user login I am unable to create a new database or even view properties of my existing database.  What permissions would my IT department need to give to my user account to give me full control over the software?  Our IT department does not use SSMS, so they are unable to help me with these basic questions.  Thanks for any guidance provided. 

Microsoft SQL Server, Error: 53

$
0
0

Windows Server 2003 R2, SQL Server 2005 with SP4.  SQL Server Service is running, using TCP/IP only (Surface Area Configuration). Network Configuration - Shared Memory and TCP/IP are enabled. SQL Server Browser is disabled. I could login to SQL Server and connect to databases. Everything was fine.  But after restarted a server, I can not login... give me an error.  What can I check?  Strange things... I can not connect to SQL Server on the server SQL Server 2005 is on the OS.  But users *can* use/connec to the database from web applications.  Is the server wrong somewhere? Some more info, example, C drive (OS, SQL Server and system databases...), K and L drive (SAN for user databases and log files)  Please give me advice. 

Cannot connect to [servername]

A network-related or instance specific error occured 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: Name Pipes Provider, error: 40 - Could not open a connection on SQL Server) (Microsoft SQL Server, Error : 53)

Temporal History Table across Linked Server no ROWS returned

$
0
0

Hi SQL Experts,

I have a SQL linked server SQL server to SQL Server.  Security for the connection is "Be made using the Login's current security context'

I am able to execute 

SELECT        

PARENT.*
FROM  [DB].[dbo].[tablename] AS PARENT 
INNER JOIN
          [DB].[History].[tablename] AS HIST ON HIST.primarykey = PARENT.primarykey
  WHERE  (HIST.SysEndTime >= CAST('2019-06-04 18:34:44' AS DATE ) )

This returns 3 rows as expected.

I execute the same statement through the linked server object.

SELECT         

PARENT.*
FROM  [LINKEDSERVER].[DB].[dbo].[tablename] AS PARENT 
INNER JOIN
          [LINKEDSERVER].[DB].[History].[tablename] AS HIST ON HIST.primarykey = PARENT.primarykey
  WHERE  (HIST.SysEndTime >= CAST('2019-06-04 18:34:44' AS DATE ) )

No rows are returned.

I have also tried using OPENQUERY to execute the SQL across the Linked Server, no rows returned.

The problem is that I can not see any rows in the History table when I query it across the Linked Server object.

I get a full set of records from the Temporal Table

Does anyone know why the permissions on the History table are different  across a Linked Server Object?

Does anyone know how to get around the permissions problem?

Thanks.

Cannot connect after changing Internet provider

$
0
0

I'm having a hard time trying to fix my connection to server after changing our ISP i cannot access my Payroll System, i follow the last setting on the router in port fort forwarding, but nothings happen, though i can access the log-in form but whenever i'll try to login the error occurred


 

SQL Server 2016

$
0
0

Having following issue :  Databases were migrated to the new SQL Server 2016 from SQL Server 2008.. Now when trying to establish connections getting error messages : 

[Microsoft SQL Server native Client 11.0]:  Cleant unable to establish connection
[Microsoft SQL Server native Client 11.0]: TCP Provider: An existing connection was forcibly closed by remote host

I am using test.udl file with the following contents:

[oledb]
; Everything after this line is an OLE DB initstring
Provider=SQLNCLI11.1;Persist Security Info=False;User ID=TDW_USER;Initial Catalog="";Data Source=ITSUSRAWSP08046;Initial File Name="";Server SPN="" 

I checked, on that laptop .NET Framework 4.7.2.  (version 1803: 461814 ), dbnetlib.dll seems latest 10.0.16299.15 (modifies 9/29/2017).  There is no setting in ..... SCHANNEL\Protocols.. 

If I take this test.udl file onto my laptop that I used for development, so it has VS2019, SSMS.. but mentioned before setting exactly the same ... I do not have any problem to get connected to the same server...  in the same time if on the laptop where connection is not working I would put old server name .. then it works...  If I can connected on my laptop then it seems like it is client side issue.. what should I check in order to have connection working on the other laptop..   both laptops are windows 10

Thanks,

Greg



How to get a return variable from oracle of type SYS_REFCURSOR in SQL using Linkdserver

$
0
0

Hi everyone, I'm new to SQL, I need to use a trace variable from an Oracle procedure using the LinkedServer.

My Oracle Procedur is:

 procedure LotesEntidade(p_IdCli in number, p_cur OUT SYS_REFCURSOR) is
  
  BEGIN
    open p_cur for
    
      select en.fantasia, en.cgc from entidade en;
    
  END;

My call in SQL is:

DECLARE 
@Id int,
@p_cur cursor

set @Id = 118

EXEC ('BEGIN pk_lf_faturamento.LotesEntidade(?,?);end;',@Id, @p_cur OUTPUT) at LINKSILTTESTE;

Follow the error below:

he variable '@p_cur' is a cursor variable, but it is used in a place where a cursor variable is not valid.

Please, help me...


Visual Studio 2008 project

$
0
0

I have an old visual studio .sln and my PC was reset (PC Reset) about a year ago and I lost a lot of files. But my solution is still here. Problem is when I tried to reinstall sql express, it stated it may not run well with windows 10. So I stumbled onto the Sql server 2017 which I downloaded. Now my project will no longer show my database and I can't see how to connect the new sql to my old website.

Do I have to just scrub my old website because it was built with old software? I need to update it but cannot deploy it now until I make sure its running correctly.

SQL Server Connection Through a web service

$
0
0

Hello 

We will be connecting to sql server via web service . 

Do we have any connection limitations ? We will be uploading documents at random times and multiple time from different desktops . The min transactions are 11000.


Thanks


usher A


Upper case and Lower Case

$
0
0

Hello Friends

How do I convert first letter of each name to upper case and rest to lower case?  As an example,  JOHN MAXWELL should read as John Maxwell.

In oracle there is a function called INITCAP, how do I do this in SQL Server?

Your help is highly appreciated.

Thanks in advance.



Mohamed_Rafi

Named Pipes Provider: Could not open a connection to SQL Server [53].

$
0
0

 

hi all,

trying to set up linked server but it thows error listed above.

 

 

Thanks,

N P

restoring a .bak file

$
0
0

Hello:

I want to paste a .bak database file I just downloaded from my server into my backup SQL file folder so I can view it in SQL Server Mgt. Studio. Problem is I'm not sure which one to use? I downloaded the database to try to find some information in it (lost email and pw info). I uploaded a recent version of my VS project that was migrated to the VS 2019 version. Project was originally created in VS 2008 version and old version of SQL. So Not sure what is being used on the host website.

I have four folders for SQL Server in my c:/program files:

MSSQL11.MSSQL2012
MSSQL13.SQLEXPRESS
MSSQL14.MSSQLSERVER
MSSQL14.SQLEXPRESS

All have backup folders.

Any advice? Thank you in advance on what to try.


Can't edit files through FTP anymore. Stuck, please help!

$
0
0

Hi there!

So I'm trying to edit files from my website using FTP (FileZilla) and since today I'm getting an error. I am capable of logging into the server from my Hosting party and see the files. But when I try to edit the files I'm getting an error: he file "functions.php" cannot be opened. The associated programs (C:\Users\kerim\AppData\Local\atom\atom.exe) could not be found. Please check your filetype associations.

So first of all I tried to contact my hosting party to ask what's wrong. They told me that I'm getting the error because of Windows OS and that they can't help me. I've updated Windows OS in the last days and I don't know what is causing this problem. It is disrupting my workflow so I could really use some help ASAP. I hope you can tell me what is going wrong and how I can solve this problem :).

Greetings from Amsterdam, Kerim

Kerberos Setting Help On IIS Server

$
0
0

We are creating an web application and using Active directory for authentication of users access.

We are unable to access the sql server and getting the below error :

Authentication Type:Negotiate
IsAnonymous :False
Will flow true AuthenticatedUserSid
ImpersonationLevel: Impersonation
w3wp.exe Error: 0 : SQL Error : Error while reading SQL database.
Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON'.
   at System.Data.SqlClient.SqlInternalConnection.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.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
   at System.Data.SqlClient.SqlInternalConnectionTds.CompleteLogin(Boolean enlistOK)
   at System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, SecureString newSecurePassword, Boolean ignoreSniOpenTimeout, TimeoutTimer timeout, Boolean withFailover)
   at System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(ServerInfo serverInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString connectionOptions, SqlCredential credential, TimeoutTimer timeout)
   at System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(TimeoutTimer timeout, SqlConnectionString connectionOptions, SqlCredential credential, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance)
   at System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, SqlCredential credential, Object providerInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString userConnectionOptions, SessionData reconnectSessionData)
   at System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, DbConnectionPoolKey poolKey, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection, DbConnectionOptions userOptions)
   at System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnectionPool pool, DbConnection owningObject, DbConnectionOptions options, DbConnectionPoolKey poolKey, DbConnectionOptions userOptions)
   at System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection)
   at System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection)
   at System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, UInt32 waitForMultipleObjectsTimeout, Boolean allowCreate, Boolean onlyOneCheckConnection, DbConnectionOptions userOptions, DbConnectionInternal& connection)
   at System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal& connection)
   at System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal& connection)
   at System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions)
   at System.Data.ProviderBase.DbConnectionClosed.TryOpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions)
   at System.Data.SqlClient.SqlConnection.TryOpenInner(TaskCompletionSource`1 retry)
   at System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource`1 retry)


Request you all please provide resolution to this.


SQl Server 2014: MARS Enabled. Can Get multiple result sets when using SQL Native Client 11.0 but NOT with SQL Server

$
0
0

Hi,

I hope this is the correct forum to post this.  I did not see any similar questions.

I am running old C++ code built in VS2017.  Currently we are using SQL Native Client 11.0 with MARS turned on in 

SQLSetConnectAttr(m_hdbc, SQL_COPT_SS_MARS_ENABLED, (SQLPOINTER)SQL_MARS_ENABLED_YES, SQL_IS_UINTEGER);

This works fine.  We now want to switch from SQL Native Client 11. 0 to SQL Server because we find it is faster on the cloud.  When I try to run (with the exact same code) using SQL Server,  I always get the exception "connection is busy with results from another hstmt".

Any ideas?  

Thanks in advance for your help!

Alex


A Enterline

error while .csv import to MS SQL Server 2014

$
0
0

Hi,

I've got an issue here while importing a .csv file to MS SQL Server 2014: I want to transfer data from an Ecxel worksheet (MS Excel 2010) to an SQL database. The worksheet consists of 2 tables, so I safed them separately to 2 .csv files. Import of the first was easy as pie, no troubles here. But unlike the second file: although identical in structure and from the same source, it always brought only an error (original in German, my translation: 'Error 0xc02020a1: 1-data flow task: error during data conversion.' and later 'Error 0xc0047038: 1-data flow task: SSIS-Errorcode 'DTS_E_PRIMEOUTPUTFAILED'.' After that, I end up with column names, but no data. In the preview everything looked fine, but no matter what separator I try or which program, I always get the same error. Even changing the codepade won't help, although the first error points to that.

Any ideas where I can look for an solution?

With kind regards, Markus

[SOLVED]error while .csv import to MS SQL Server 2014

$
0
0

Hi,

I've got an issue here while importing a .csv file to MS SQL Server 2014: I want to transfer data from an Ecxel worksheet (MS Excel 2010) to an SQL database. The worksheet consists of 2 tables, so I safed them separately to 2 .csv files. Import of the first was easy as pie, no troubles here. But unlike the second file: although identical in structure and from the same source, it always brought only an error (original in German, my translation: 'Error 0xc02020a1: 1-data flow task: error during data conversion.' and later 'Error 0xc0047038: 1-data flow task: SSIS-Errorcode 'DTS_E_PRIMEOUTPUTFAILED'.' After that, I end up with column names, but no data. In the preview everything looked fine, but no matter what separator I try or which program, I always get the same error. Even changing the codepade won't help, although the first error points to that.

Any ideas where I can look for an solution?

With kind regards, Markus


Viewing all 4164 articles
Browse latest View live


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