I am running an SSIS package to extract data from a source SQL Server database to our own database. The source is on a linked server. The package worked until a column size was increased on a table on the source.
If I run a query against the linked server table I get the following error:
'OLE DB provider 'SQLNCLI' for linked server 'GSC-RPT.SVR.BANKONE.NET' returned data that does not match expected data length for column '[GSC-RPT.SVR.BANKONE.NET].[Peregrine].[dbo].[scProblem].short_description'. The (maximum) expected data length is 100, while the returned data length is 160.'
I've tried deleting the links and recreating them. Nothing works. I don't understand why my database query is expecting a data length of 100. Why does it not pick up the definition of the field length from the linked server? How has it retained this expectation when I have deleted the linkage and recreated it?
I am linking to another SQL Server database to extract data into my own system. Following an increase in size on one of the columns in a table I am extracting, I am getting the following error:
'OLE DB provider 'SQLNCLI' for linked server 'gsc-rpt.svr.bankone.net' returned data that does not match expected data length for column '[gsc-rpt.svr.bankone.net].[Peregrine].[dbo].[scProblem].short_description'. The (maximum) expected data length is 100, while the returned data length is 148'
The column short_description has been increased from 100 to 1024. Writing a simple query, SELECT (max(len(short_description)) FROM dbo.Peregrine_Problem will generate the error, but if I embed the same SQL into an Excel VBA macro and connect to the server, it happily returns the result 1024. Our Access databases also link to the table on the remote server and handle the increased column size properly.
I have done everything I can think of, including deleting the linked server within SQL Server MS, and recreating it, but I can't override the setting of 100.
I have two servers, DEV and PROD. Now my DEV server works just great, I can connect to the linked server, query, etc... all is well.
So I'm setting up my PROD server and when I go to add the linked server I get:
Cannot initialize the data source object of OLE DB provider "SQLNCLI".... and Unable to complete login process due to delay in opening server connection.
Now I am running SQL Server 2005 and connecting to an SQL 2000 server.
The odd part is that this works just fine on DEV.
When I go to create the linked server I set:
Linked Server: "LinkedServerName"
Server Type: "SQL Server"
and that's it.
I go to Security and enter my DOMAINUSER.ACCOUNT and then enter the login creds for the linked server.
When I click "OK" I get the above mentioned error code.
Hello, I've a problem with a software developed in C# with the framework 2.0. This is the error I receive : The operation could not be performed because OLE DB provider "SQLNCLI" for linked server "XXX_LINKED_SERVER" was unable to begin a distributed transaction. OLE DB provider "SQLNCLI" for linked server "XXX_LINKED_SERVER" returned message "No transaction is active.". If I try directly to restart the process, it works fine. Is there someone who can help me ? This is the process 1. In C# --> Call of a Query : select from the linked server (db in sql 2005) and insert into a table SQL 2005 2. In the C# --> using (TransactionScope scope = new TransactionScope()) and insert in a table in SQL 2005 which is link server Thank in advance.
I've been assigned with finding the issue behind this error on one of our production systems:
TCP Provider: The semaphore timeout period has expired. [SQLSTATE 07008] (Error 121) OLE DB provider "SQLNCLI" for linked server "SERVER1" returned message "Communication link failure". [SQLSTATE 01000] (Error 7412). The step failed.
I've Googled the error to death, searched the forums here and at other SQL sites as well and have found nothing that points me at the cause. I've found the individual parts of the error but not the whole. Maybe I've just been looking at it too long and am missing something simple. Anyone have any ideas?
These are two linked SQL2005 64bit enterprise Win2k3 servers. The error comes when an automated daily job is run. Sometimes it happens at once, sometimes after 5 minutes, sometimes after an hour. I can see nothing wrong with the server itself or the network.
and it works fine if the database on PRIMARY is alive. however when the mirror has failed over to SECONDARY and PRIMARY is no longer available, I get the following when I try to query the database via the linked server:
OLE DB provider "SQLNCLI" for linked server "MIRROR" returned message "Login timeout expired". OLE DB provider "SQLNCLI" for linked server "MIRROR" returned message "An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections.". Msg 10061, Level 16, State 1, Line 0 TCP Provider: No connection could be made because the target machine actively refused it.
As far as I can tell, it doesn't try to contact SECONDARY at all. It seems like SQL Server is ignoring the FailoverPartner attribute.
If I switch PRIMARY and SECONDARY in the connection string (ie @provstr=N'Server=SECONDARY;FailoverPartner=PRIMARY;') then it works when SECONDARY is online, but not when the mirror has failed back to PRIMARY.
and it works fine if the database on PRIMARY is alive. however when the mirror has failed over to SECONDARY and PRIMARY is no longer available, I get the following when I try to query the database via the linked server:
OLE DB provider "SQLNCLI" for linked server "MIRROR" returned message "Login timeout expired". OLE DB provider "SQLNCLI" for linked server "MIRROR" returned message "An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections.". Msg 10061, Level 16, State 1, Line 0 TCP Provider: No connection could be made because the target machine actively refused it.
As far as I can tell, it doesn't try to contact SECONDARY at all. If I switch PRIMARY and SECONDARY in the connection string (ie @provstr=N'Server=SECONDARY;FailoverPartner=PRIMARY;') then it works when SECONDARY is online, but not when the mirror has failed back to PRIMARY.
i am try to execute a command " SELECT * FROM [SQLSERVER].[DATABASENAME].[DBO].[TABLE] ".. but i am receiving a error message
Msg 7319, Level 16, State 1, Line 19
The OLE DB provider "SQLNCLI" for linked server "SQLSERVER" returned a "NON-CLUSTERED and NOT INTEGRATED" index "MSmerge_index_1348915877" with the incorrect bookmark ordinal 0.
but when i try to check the linked server it's shows me the linked is okay.. The following command i use to check wethare the link is fine or not..
CREATE TABLE #foo
(
pingResult SYSNAME NULL
);
INSERT #foo
EXEC master..xp_cmdshell
'ping SQLSERVER;
IF EXISTS
(
SELECT 1
FROM #foo
WHERE pingResult LIKE '%TTL%'
)
BEGIN
PRINT 'Feel free to use linked server.';
END
ELSE
BEGIN
PRINT 'Linked server not available.';
END
DROP TABLE #foo;
and Following result i receive..
(13 row(s) affected)
Feel free to use linked server.
Can any One tells me where i m making mistake or how can i resolve this problem
I'm running Server 'A' and Server 'B' which are both on SQL 2005 SP2. Server B connects to Server A using the linked server functionality via the SQLNCLI provider. I am issuing an update statement from a web api in a nested transaction that uses a distrubted transaction.
However, I am receiving the following error :
Unable to start a nested transaction for OLE DB provider "SQLNCLI" for linked server "A". A nested transaction was required because the XACT_ABORT option was set to OFF. OLE DB provider "SQLNCLI" for linked server "A" returned message "Cannot start more transactions on this session.".
I've researched the issue and understand how XACT_ABORT works.
Also, I looked at the Linked Server provider options for SQLNCLI and came accross the Nested Queries option being unchecked. I checked the option and applied it to the Linked Server.
Okay, so after my long post my questions are: Do i need to restart SQL in order for this to take effect? If not, what do i need to do? I 've restarted IIS to no avail .
I just installed a SQL Server 2005 Express SP2 instance on a server with an existing SQL Server 2000 SP3 installation. (I need SQL Server 2005's INSERT from an EXEC capability). It's working great now except for one thing: I can't link any other SQL servers! I've already successfully added and queried a linked Oracle server, but attempting to add a linked SQL server gives me the following error, no matter which SQL provider I try to use:
Code Snippet "The linked server has been created but failed a connection test. Do you want to keep the linked server?" Additional information: --> An exception occured while executing a Transact-SQL statement or batch (Microsoft.SqlServer.Express.ConnectionInfo) --> Cannot create an instance of OLE DB provider "SQLNCLI" for linked server "SERVERNAME". (Microsoft SQL Server, Error: 7302)
The technical details reveal the error source as "sp_testlinkedserver".
I've scoured the net and premier support for advice on this problem, but the little I found wasn't helpful. I've tried reinstalling the SQL Native Client, but it didn't help. I've tried uninstalling SQL Server 2005 Express completely (including management studio and native client), rebooting, and reinstalling everything, with no luck. The server (obviously) does not have a firewall enabled. I've tried stopping the SQL 2000 Server installed on the system, no help. If I create a test .UDL file on the system, pointing to any of the SQL servers I'm trying to link, clicking the "Test Connection" button returns successful. I'm also able to connect to and query the servers directly from the SQL 2005 Express Management Studio. I just can't add them as linked servers.
The server is running Windows 2003 SP1, SQL Server 2000 SP3, and SQL Server 2005 Express SP2 (the default "SQLExpress" named instance). I've tried setting up SQL 2005 Express to run under the network service account and under a domain account used by the other SQL 2000 servers.
From other SQL 2000 servers, I can connect and link to the SQL Server 2005 Express instance successfully. I can also successfully add linked SQL servers in SQL Server 2000 instance installed on the same server. Only adding linked SQL servers in 2005 Express seems to be broken.
Anyone have any other suggestions? I'm totally baffled. Thank you so much for any helpful advice.
SQL 2005 9.00.3402.00 (x64) As Above really when I select * OR select a single column from the view the wrong column data is returned. in SQL Management Studio when I expand the Columns of the view it reflects the old table structure not the new table structure. I can easily fix by compiling the view again but this would mean I would have to recompile all referencing views when I make a change to table structures. I've tried various DBCC Clean Buffers & drop cache with no effect. Is there a command to recompile all views & poss stored procs in a database. Any help or explanation would be appreciated GW
I have to tables : Rank and Item Rank contains a FK named R_I_id which references Item's primary key named I_id, which is also an identity column.
I want the field R_I_id of table Rank to be updated with the value of Item's I_id when a new Item is inserted. So I wrote the following trigger :
CREATE TRIGGER [dbo].[trg_oninsertitem] ON [dbo].[Item] AFTER INSERT AS BEGIN SET NOCOUNT ON SET IMPLICIT_TRANSACTIONS OFF DECLARE @I_id INT SELECT @I_id = SCOPE_IDENTITY()
BEGIN TRANSACTION INSERT Rank(R_I_id) VALUES(@I_id) IF (@@ERROR <> 0) BEGIN PRINT 'error in trigger trg_oninsertitem' ROLLBACK TRANSACTION END COMMIT END
But when I insert a value in Item, I got the following message :
Msg 515, Level 16, State 2, Procedure trg_oninsertitem, Line 17 Cannot insert the value NULL into column 'R_T_id', table 'base.dbo.Rank'; column does not allow nulls. INSERT fails.
and I don't understand, because my trigger is fired after the value is inserted in table Item, so the field I_id should contain a new identity value, not NULL
l've 2 variables A & B from source database which i used to calculate C with the following formula, i.e.
C = 100 * A/B
In case of B = 0 (DIV BY ZERO), C should be equal to -9999.
l've set the datatype for A & B are INT, C is FLOAT at targetting database.
So l used to derived column to calculate C as, B == 0 ? -9999 : 100 * A/B
After l run the package, l realize that all my C is INTEGER rather than FLOAT.....it seems that SQL server has evaluate the wrong datatype for me....anyway to overcome this?
I have an MVC asp.net application that stores many records in a table on sql server, in its own system. Â used the system for 2 months, worked fine accessing, changing data.
Now that other users are logging in? there is cross coupling going on. Â one user gets the data from another users sql search.
In the mvc app it had used the get async method to read the ID record from the db, i set that to synchronous. Â no effect; Â the user makes their own login id but that does nt matter either.
I have an SSRS report that's being built from a stored procedure given 2 variables. The error I'm receiving is
An error has occurred during report processing. (rsProcessingAborted) Cannot read the next data row for the dataset Sheet2. (rsErrorReadingNextDataRow) Conversion failed when converting the varchar value '.5' to data type int.
This doesn't make any sense. The variable in question is being stored as a varchar. I don't do any typecasting in the stored procedure. Executing the stored proc in sql server studio works fine. In the query designer I replaced the stored procedure call with just the code for the stored procedure and it works fine as well. Switching it back to call the stored procedure throws the same error.
Our prod server is using 2008, our dev is running 2010, and I have 2013 Visual Studio. It has to do with the version of SSRS. I checked the datatype of the fieldtype and rd:TypeName was System.Int32. Changing it to System.String did nothing. Leaning even more towards the issue being SSRS itself. I even pulled the working version off of prod and it gave me the same error in Visual Studio.
Why is SSRS trying to convert a varchar to an int? It should be a double if anything or just leave it alone and not try typecasting it at all.
Im trying to insert a record in my sql server 2005 express database.The following function tries that and without an error returns true.However, no data is inserted into the database...Im not sure whether my insert statement is correct: I saw other example with syntax: insert into table values(@value1,@value2)....so not sure about thatAlso, I havent defined the parameter type (eg varchar) but I reckoned that could not make the difference....Here's my code: Function CreateNewUser(ByVal UserName As String, ByVal Password As String, _ ByVal Email As String, ByVal Gender As Integer, _ ByVal FirstName As String, ByVal LastName As String, _ ByVal CellPhone As String, ByVal Street As String, _ ByVal StreetNumber As String, ByVal StreetAddon As String, _ ByVal Zipcode As String, ByVal City As String, _ ByVal Organization As String _ ) As Boolean 'returns true with success, false with failure Dim MyConnection As SqlConnection = GetConnection() Dim bResult As Boolean Dim MyCommand As New SqlCommand("INSERT INTO tblUsers(UserName,Password,Email,Gender,FirstName,LastName,CellPhone,Street,StreetNumber,StreetAddon,Zipcode,City,Organization) VALUES(@UserName,@Password,@Email,@Gender,@FirstName,@LastName,@CellPhone,@Street,@StreetNumber,@StreetAddon,@Zipcode,@City,@Organization)", MyConnection) MyCommand.Parameters.Add(New SqlParameter("@UserName", SqlDbType.NChar, UserName)) MyCommand.Parameters.Add(New SqlParameter("@Password", Password)) MyCommand.Parameters.Add(New SqlParameter("@Email", Email)) MyCommand.Parameters.Add(New SqlParameter("@Gender", Gender)) MyCommand.Parameters.Add(New SqlParameter("@FirstName", FirstName)) MyCommand.Parameters.Add(New SqlParameter("@LastName", LastName)) MyCommand.Parameters.Add(New SqlParameter("@CellPhone", CellPhone)) MyCommand.Parameters.Add(New SqlParameter("@Street", Street)) MyCommand.Parameters.Add(New SqlParameter("@StreetNumber", StreetNumber)) MyCommand.Parameters.Add(New SqlParameter("@StreetAddon", StreetAddon)) MyCommand.Parameters.Add(New SqlParameter("@Zipcode", Zipcode)) MyCommand.Parameters.Add(New SqlParameter("@City", City)) MyCommand.Parameters.Add(New SqlParameter("@Organization", Organization)) Try MyConnection.Open() MyCommand.ExecuteNonQuery() bResult = True Catch ex As Exception bResult = False Finally MyConnection.Close() End Try Return bResult End FunctionThanks!
In brief, here is my quandary… I have a GridView on a page with some radio buttons, a couple of check boxes, some drop downs etc. And depending on what the user selects the Grid View needs to show different columns from the database… The easiest way I have found to do this is to have a separate Data Object for each “view�, i.e. each variation of the checkboxes and radio buttons (which determine which dropdowns to use for the variables) and then bind the GridView to the specific Data Source at runtime…
It seemed like a good idea at the time, but now I have over 7 different data connections cluttering up the design view, and more to come and I feel like I am missing a better way to achieve the same results…
Does anyone have some advice for a major novice?
Here’s the beginning of a large set of nested ifs, if this is the way it’s done that’s fine too, I’ll just keep creating data sources, I just get the feeling there must be an easier way to do this..
There is a column "name" common in both the tables tbcity & tbemp. Here we are not referencing or getting the column name from tbemp but still it will give the records from the table tbemp also. It is returning the number of records from tbcity multiplied by the number of records of table tbemp. if there are 10 records in table tbcity & 5 records in table tbemp then instead of returning only 10 records it is returning 50 records.Very strange...! if there is no records in table tbemp then it is returning zero records.
So please suggest me the solution and why it is behaving in such a strange manner.
I am having problem inserting data obtained from a adhoc sql query. Am I doing something wrong here (the select statement in below mentioned query works fine) Insert into customer(CustomerID, LastName, FirstName, BillingAddress, City, State, Country, Zipcode, PhoneNumber, EmailAddress) select CustomerID,(left(ContactName, charindex(' ', ContactName)-1)) as LastName, (right(ContactName, charindex(' ', reverse(ContactName))-1)) as FirstName, Address, City,Region,PostalCode,Country,Phone from Northwind.dbo.Customers
I am just doing it this way since Customer's name (both last name & first name ) are stored in a single column in Northwind database. I want to break it into two columns...The reason I am trying to get this to work is...it would be less of a work for me in inserting test data for my applicationAny help would be of great
We are using the Redistributable installer for the SQL Native client, SQLNCLI.MSI, with our solution. On MSDN here: http://msdn.microsoft.com/en-us/library/ms131334.aspx it recommends using the APPGUID keyword to specify your application product code. This is to ensure that the installer will know the dependancy between the Native Client and your application.
Unfortunately there doesn't seem to be much info around APPGUID itself. Does anyone know how that ID is generated? What the rules around it are? Or just some better definition of where it comes from?
I was trying to update a named instance of SQL Express SP1. I double clicked it and during extraction I get this error message:
The file C:Document and SettingsByersNLocal SettingsTempBSISQLEXP05TRACTsetupsqlcli.msi could not be opened.
SQL Express came bundled with another porgram so I'm thining it could be a bad cd. I also thought about reinstalling Windows Installer 3.1. Anybody experience this error?
I recently my hosting company to provide SQLNCLI provider for MS SQL2005 DB. Right now, they are only providing SQLOLEDB provider for connection.
Connection is slow and unreliable at this point using sqloledb while it was running fine with SQL 2000 db.
When I asked them for SQLNCLI, they replied...
------------------
Unfortunately we cannot install the SQLNCLI driver for MSSQL 2005 as it runs under the system context which would be a security risk to the server. I apologize for the inconvenience.
If you have any questions or require additional assistance, please do not hesitate to contact our support team anytime at
----------------------
How true is this? Will it be really risk? It doesnt make sense to me if this would be risk why microsoft even will produce it.
I have spend days trying to install SQLEXPR_ADV.EXE. I need it to run the Pinnacle Studio 10 installation fully. I have managed to switch on all the services that the set up demanded, but I keep getting stuck because the installation cannot find sqlncli.msi. I have a copy of it from the SQL site, but where do I stick it so that the installer can find it. I have tried to place it in the SQL directory in Program Files, I have placed it in the folder which is generated by the installer, I have sat it next to the Installer itself but to no avail. I have installed the msi independently nd the process says that it was successfully installed but the SQL2005 Express Installed still cannot find it. Help!
I need to be able to create a DSN through code that connects to SQL Server using SQL Native Client. I have found the following article: http://support.microsoft.com/kb/q184608/. This demonstrates most of what I need, but it does not show how to set the username and password, which is something that I need to do.
Completely new to the world of databases. I'm a designer who works primarily in Flash. In any case, I'm trying to manage an application that uses MS SQL and learn about the wonderful world of databases.
Ok, I modified a table (e.g. I added a column called "Rate") that had associated views (created by another developer). Noticed that my application went a little wonky as some of my variables within my app took on the value of the data in the "Rate" column. I checked one of the views and noticed that a column within the view (e.g. TutorID) was assuming the values in the "Rate" column. Note: The column TutorID had been blank before the change to the table. I'm completely lost as to why this is happening. Do I need to rebuild the view? Can I just reset the original view?
Thanks.
Oh yeah, I'm using SQL4X Manager J from Mac Guru (if that helps).
Hi ALL, I am getting 2 errors for the report which has graph.
1.The chart €˜Chart_ID0EDABDA€™ contains a different number of DataPoints per ChartSeries element than the number of StaticCategory elements. If the chart contains no StaticCategory, it must contain one DataPoint per ChartSeries.
2.[rsWrongNumberOfChartDataPoints] The chart €˜Chart_ID0EDABDA€™ has a ChartData element that contains a collection of 6 DataPoint element(s), which is different from the number of expected datapoints (1). The expected number of datapoints in the definition is (Max(number of static categories, 1) * Max (number of static series, 1)).
I am converting crystal reports to SSRS.Can anybody give me some info about Data points requirments and how to get rid of these errors.I am getting these 2 error almost all the SSRS reports having Graphs. Thanks .
I tried to install a sql 2005 desktop engine. This fails with the error: An installaton package for the product Microsoft SQL Server Native Client cannot be found. Try the installation again using a valid copy of the installation package €˜sqlncli.msi€™ I used a fresh, new download SQLEXPR.EXE. What shall I do?
I am running a SQL2K on a Server2K box. I have linked servers to SQL2005 Express on WinXP. I am trying to get data off of the SQL2005 DB to the central DB on SQL2K. This has been running for about a year. I am now getting an error message as follows:
Server: Msg 7356, Level 16, State 1, Line 1 OLE DB provider 'SQLNCLI' supplied inconsistent metadata for a column. Metadata information was changed at execution time. OLE DB error trace [Non-interface error: Column 'TestVarChar' (compile-time ordinal 2) of object '"WKS"."DBo"."testtable"' was reported to have changed. The exact nature of the change is unknown].
When I run the following Queries on the SQL2K box: SELECT * from WKSA400.WKS.DBo.testtable
or
SELECT * from OPENQUERY(WKSA400, 'SELECT * from WKS.DBO.testtable')
I did notice that if my testtable has only numeric fields, it works fine. It only has a problem with alphanumeric fields.
If I run 'exec sp_tables_ex WKSA400' on the SQL2K, it works fine. I get a listing of all the tables on the remote server. This tells me that my security is fine. It seems to be a conversion from the 2005 to 2000 SQL. If it had not been working for over a year, the dent in the wall the size of my head would be much smaller.
So I tried the typical IDBDataSourceAdmin:estroyDataSource() command to destroy an existing sql server 2005 express database and guess what it returned:
E_NOTIMPL (not implemented)
This leaves me in the dark on how I'm supposed to drop an existing database in SQL Native Client OLEDB. Any ideas?
// Sets properties in the Data Source and initialization property groups hr = m_pIDBProperties->SetProperties(uiNumPropsets, dbpropset); CHKHR(hr, L"Failed to set data source properties", _ExitCreate);
I just migrated a SQL7 instance into SQL2005. Use the backup and restore method. The following was the steps done :
1) Database Backup from sql7 and restore on sql2005
2) Create user on sql2005
3) Configure SQL Native client for instance
- When apps tried to access the server, they encounter the following error
Could not find server ServernameSQL7 in sys.servers. Verify that the correct server name was specified. If necessary, execute the stored procedure sp_addlinkedserver to add the server to sys.servers. - /elogs/lib/db.asp, line 70
4) As requested, i ran sp_addlinkedserver Servername. After which the apps got back with this error
OLE DB provider "SQLNCLI" for linked server "Servername" returned message "Login timeout error" - /elogs/lib/db.asp, line 70
I am unsure of how to proceed from here. Please assist.