MS SQL Server View Linked Into MSAccess Is Not Updateable Recordset
Jul 29, 2004Hi All,
How can I link a view into MS Access from MS Sql Server, that I can update as a tabble.
Thanks
Laszlo
Hi All,
How can I link a view into MS Access from MS Sql Server, that I can update as a tabble.
Thanks
Laszlo
Hi
I have a linked server to MSAccess DB and, when I try to select record from a table that have a column
with a bad date formatted (with year less than 1753) I receive the message:
.... conversion error from DBTYPE_DBTIMESTAMP to datetime....
My scope is set to NULL this bad values from Sql Server ...
I first try with something like
UPDATE LNK_SVR...TABLE SET FLD=NULL WHERE ISDATE(FLD)=0
But I receive the same error... perheaps the provider generate the error before an Sql Server evaluation ...
So I think to a passthrought query:
exec sp_serveroption @server='LNK_SVR',@optname='rpc out',@optvalue='true'
exec LNK_SVR...sp_executesql 'update table set FLD=NULL WHERE YEAR(FLD)<1753'
But I receive the folowing message ....
Messaggio 7213, livello 16, stato 1, riga 1
Il provider non è riuscito a passare parametri di stored procedure remota al server remoto 'LNK_SVR. Verificare che il numero, l'ordine e il valore dei parametri passati siano corretti.
Any suggestion is appreciate.
Thanks in advance
Matteo
Mds
Hi,
I have a msaccess linked server that I use to execute sql 2000 stored procedures from a front end in adp (access data project) format without any problem, if it is used on the same machine where the sql server resides (with any user logged on). In any other machine on the local network where I also need to use it, I get an ole/db error message saying that the microsoft jet database engine can not open the file because it's allready opened exclusivly or because it do not has permissions. I created the linked server with both UNC and normal path with the same result.
Thank's for all the help/clues you can give me.
Hello-
I have a view that used to be updateable (except for a few fields, but that is fine). When I use the results of a CASE statement as one of the field values, the entire view is not updateable. The view is pasted below. Does anyone know how to keep my view updateable and, somehow, add this new field? Thank you.
-Eric
SELECT
DATEPART(yy, Orders.NextShipDate) AS year,
DATEPART(mm, Orders.NextShipDate) AS month,
DATEPART(dd, Orders.NextShipDate) AS day,
People.LastName,
People.FirstName,
Customers.CustomerID,
Orders.NextShipDate,
Customers.Custom,
Orders.AllocationTemp,
Orders.ShippingTemp,
Orders.HorseName,
Orders.PriorShipDate,
Customers.Username,
Customers.Password,
Orders.OrderID,
Orders.Deleted,
Orders.Deadbeat
FROM
People
INNER JOIN Customers
INNER JOIN Orders
ON Customers.CustomerID = Orders.CustomerID
ON People.PeopleID = Customers.PeopleID
WHERE
(CONVERT(DATETIME, CONVERT(CHAR(10), Orders.NextShipDate, 101)) <= DATEADD(d, 7, CURRENT_TIMESTAMP)) AND (Orders.Deleted = 0) AND
(Orders.Deadbeat = 0) AND
(Customers.Deleted = 0) AND
(Customers.Pending = 0) AND
(Orders.OrderID NOT IN
(SELECT Orders.OrderID
FROM Items INNER JOIN Products ON Items.ProductID = Products.ProductID INNER JOIN Orders ON Items.OrderID = Orders.OrderID
WHERE
(Items.Dose = 0) AND
(Products.IsPharmaceutical = 1) AND
(CONVERT(DATETIME, CONVERT(CHAR(10), Items.Created, 101)) > DATEADD(d, - 5, CURRENT_TIMESTAMP)) AND
(Items.Deleted = 0))) AND
EXISTS (SELECT ItemID FROM Items WHERE Items.OrderID = Orders.OrderID AND Deleted = 0)
I could have swore I posted this earlier today, but it must not have went through...anyway here goes again.
Is there any way to tell if a view is updateable (updates the underlying table(s))?
Thanks,
Van
I have a view that combines several tables, and lastly one column that is determined by a subquery.
i.e.
CREATE VIEW [View]
AS
SELECT
[TableA].*,
[TableB].*,
(SELECT TOP 1 [Column] FROM [TableC] ORDER BY [Column2])
AS [SpecialColumn]
FROM [TableA] INNER JOIN [TableB]
ON [TableA].[ColumnID] = [TableB].[ColumnID]
I have made INSTEAD OF UPDATE and INSTEAD OF INSERT triggers for this view that will then allow you to modify [View], and it will handle everything, adding/modifying the data in the three [TableX] tables accordingly.
In SQL Management Studio, the following code works fine, and is what is expected...
UPDATE [View] SET [SpecialColumn] = 1 WHERE [ColumnID] = @DesiredID
This will call my instead of trigger and update my special column accordingly exactly how I want it to.
Now, the problem lies in the application layer running on top of the database and how it accesses the view. Any call from the application to update [SpecialColumn] returns an OleDB error stating that [SpecialColumn] can not be modified. I assume that sql server is identifying the column as some sort of a derived column that normally wouldn't be able to be updated, and OleDB is restricting the column to just read only. Is there some way to override that in my view to say that the column is not read-only? Is this an OleDB restriction that can't be handled in the database/view itself?
I've also tried creating a stored procedure that called the exact same
UPDATE [View]
SET [SpecialColumn] = @param2
WHERE [ColumnID] = @param1
and it also works within management studio, but still gives a similar OleDB error about how the stored procedure attempts to update a derived column that can not be modified.
I have a solution where my stored procedure calls the exact same code as the instead of triggers to update the underlying tables of the view manually, however, I'm not asking for a solution like this to my problem, because this works fine, I simply am not happy having to do band-aid workarounds and am wondering if this is a common problem in front-ends and whether it can be handled on the database layer.
Can someone help me parsing this ms-access PIVOT sql-statement to ams-sql-server sql-statement?Many thanks in advanceTRANSFORM Count(KlantenStops.id) AS AantalVanidSELECT KlantenStops.Uitvoerder, KlantenStops.KlantFROM KlantenStopsGROUP BY KlantenStops.Uitvoerder, KlantenStops.KlantPIVOT DatePart("m",leverdatum,1,0) In("1","2","3","4","5","6","7","8","9","10","11","12");
View 3 Replies View RelatedCould someone help me by answering the questions below?What's a cursor?What's difference between Query and View?Is a RecordSet just part of a table? Can it be part of a query of view?If the content in a table changed, is it necessary for a old recordset torenew itself by do "Requery()"?Thanks for your help!
View 4 Replies View RelatedHi,I have created a linked server to oracle, which works fine.But when I try and create a view joining the SQL table with the linked Oracle table, it only returns the primary key field in the Oracle table and nothing else.Anyone know why?ThanksN.B. I'm using SQL Server 2005 btw.
View 2 Replies View RelatedHii have created a new database and a new linked server that points to anAccessDB using an ODBC DSN.Now inside that new sql db i have create i need to created a new view soi open EM went to views and paste the followingselect * from openquery (AccessLinkedServer,'select * from mytable')i press run and i see the data ok .but when i try to save the view i getthe followingODBC error: [Microsoft][ODBC SQL Server Driver][SQL Server]The operationcould not be performed because the OLE DB provider 'MSDASQL' was unableto begin a distributed transaction.[Microsoft][ODBC SQL Server Driver][SQL Server][OLE/DB provider returnedmessage: [DataDirect][ODBC dBase driver]Optional feature notimplemented.][Microsoft][ODBC SQL Server Driver][SQL Server]OLE DB error trace[OLE/DB Provider 'MSDASQL' ITransactionJoi JoinTransaction returned0x8004d00a].*** Sent via Developersdex http://www.developersdex.com ***
View 1 Replies View Related
I am working with Two Server €˜X€™ and €˜Z€™
In €˜X€™ server, I have a linked server named €˜CustSrv€™ which is connecting to €˜Z€™ server
In the €˜Z€™ server I have a Database named €˜SalesDB€™
I have a view name vw_CusgtomerData in my €˜X€™ server which is selecting data from SALESDB..Customer_Tbl from the €˜Z€™ server through that linked server (€˜CustSrv€™)
The View is simple selecting data from Customer_Tbl from SalesDB
SELECT * FROM CustSrv.SalesDB.dbo.CUSTOMER_Tbl
[Note here using * for all columns?? Is it ok for performance aspects]
Now I have some Application which are using that view through some stored procedure.Few of them passing some parameters like Cust_Id etc
Now my query is that.. Am I fulfilling all performance issues?
Or
What is the suggestive way to fetch data from that remote (Linked Server) server to get good performance benefit?
In my opinion we can fetch data 4 different way from that linked server€¦
A.SELECT * FROM CustSrv.SalesDB.dbo.CUSTOMER_Tbl
B.exec GetCustomerData 65
[Sp_GetCustomerData is a Storedprocedure which is passing a parameter 65 that is Customer_ID and the procedure is selecting data from the view vw_CusgtomerData]
C.SELECT cu_customer_id, cu_customer_name FROM vw_CusgtomerData ORDER BY cu_customer_name
Or
SELECT * FROM vw_CusgtomerData where Customer_ID=65
D.select * FROM OPENQUERY
(CustSrv,'SELECT Customer_ID,cu_customer_name FROM SalesDB.dbo. CUSTOMER_Tbl ORDER BY cu_customer_name ')
Am I bypass the concept of view and fetch data directly in the stored procedure through the linked server ??
I am trying to check if a view exists on a linked server using sys.views. I tried to fully qualify it but that produces an error telling me the below, which both the database name is correct as well as the server name. Is it possible to obtain a list of views from a linked server connection? Msg 7314, Level 16, State 1, Line 321 The OLE DB provider "SQLNCLI10" for linked server "alpha" does not contain the table ""salesdata"."sys"."views"". The table either does not exist or the current user does not have permissions on that table.
SQL Server 2008 is the server I want to query from and sql server 2000 is the server I want to query even if I try to use this syntax it still produces the above said error
Code:
select
count(*)
from
alpha.salesdata.INFORMATION_SCHEMA.VIEWS
I also tried to qualify the views by using the below and still same error
Code:
select
count(*)
from
alpha.salesdata.INFORMATION_SCHEMA.VIEWS
where
table_schema = 'dbo'
Can i refresh view through linked server? I have full rights to modify the view?
Ex:ABC.MNC_DB.dbo.sp_refreshview 'view_ABC'
Hi there,I'm pretty new to SQL and am having some porblems with a linked server.I have a table on a SQL server which stores employee information.I also have a view on a linked server which stores the same information.What I would like to happen is, whenever the view changes on the linkedserver I want the information to be changed in the table on my server.I've been trying to write a trigger to do this, but have had noluck so far.Can anyone help me?ThanksSimon--Posted via http://dbforums.com
View 1 Replies View RelatedHellow,
This is the siuation:
I have on server A SQL 2005
on server B i have SQL 2000
I want to create in a database on server A a view which uses a linked server to get data from server B.
The linked server works fine.
But when I want to execute the creation of that view i get this error:
OLE DB provider "SQLNCLI" for linked server "BI_AX_LINK" returned message "Unspecified error".
OLE DB provider "SQLNCLI" for linked server "BI_AX_LINK" returned message "The stored procedure required to complete this operation could not be found on the server. Please contact your system administrator.".
Msg 7311, Level 16, State 2, Procedure VW_ASSETTABLE, Line 1
Cannot obtain the schema rowset "DBSCHEMA_TABLES_INFO" for OLE DB provider "SQLNCLI" for linked server "BI_AX_LINK". The provider supports the interface, but returns a failure code when it is used.
I have checked and the collations between the to databases are the same.
Anyone an idea on who to do such thing?
The rights that i have an server B or not that much.
Thanx for the info
Cannot see the Colums in the "design view" of Queries. All i see when i want to design a new query is *columns
This happens in only one database, in other databases using same server i can see the colums and can tick them to view then in the query.
In enterprise manager i see all the columns.
Using SQL 2000 and MSAccess 2000
A recent SharePoint upgrade has rendered several views obsolete. I am redefining them so that our upper level executive reports show valid data.(yes, I know that doing anything to sharepoint could cause MS to deny support, having said that, this is something I've inherited and need to fix, pronto) The old view was created like so:
USE [AHMC]
GO
/****** Object: View [dbo].[vwSurgicalVolumes] Script Date: 09/04/2015 09:28:03 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE VIEW [dbo].[vwSurgicalVolumes] AS
SELECT
[code]....
As I said, this view is used in a report showing surgical minutes.SharePoint is now on a new server, which is linked differently (distributed?) I've used OPENQUERY to get my 'new' query to work;
SELECT *
FROM OPENQUERY ([PORTALWEBDB], 'SELECT
--AllLists
AL.tp_ID AS ALtpID
,AL.tp_WebID as altpwebid
,AL.tp_Title AS ALTitle
[code]....
My data (ie surgical minutes, etc) seems to be in the XML column, AUD.tp_ColumnSet . So I need to parse it out and convert it to INT to maintain consistency with the previous view. How do I do this within the context of the view definition?Here is a representation of the new and old view data copied to excel :
<datetime1>2014-08-14T04:00:00</datetime1><float1>2.000000000000000e+000</float1><float2>4.190000000000000e+002</float2><float3>1.600000000000000e+001</float3><float4>8.110000000000000e+002</float4><sql_variant1 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:sqltypes="http://schemas.microsoft.com/sqlserver/2004/sqltypes"
[Code] ....
can't format it to make it look decent. InHouseCases =2, InHouseMinutes=419, OutPatientCases =16, OutPatientMinutes=1230. This corresponds to the new data I can see in the XML column; 2.000000000000000e+000 is indeed 2 and 4.190000000000000e_002 is indeed 419.
hopefully, someone has already solved this problem
I have been assigned an application that maps data from access databases into a view in Sql Server 2005. A vb6 application does a select on the view. The recordset is then modified by the application, and eventually, the original tables will be updated with the new data. Some of the fields in the view are the result of calculations ( i.e. adding multiple varchar fields together to produce one complex varchar result ). Any of the fields that are calculated in the manner previously described have the adFldUnknownUpdatable bit set in the attributes of the recordset, and consequently, you get a -2147217887 error ( multiple-step operation .... ) when you try to change the value of the field in the recordset. Does anyone know how to get around this problem?
When I include a field from my SQL Server database, which has it's Allow Nulls value checked, in the data source of any type of control with it's Enable Editing property check, I then can not edit the record! If I remove the Allow Nulls field I can then edit it! What am I missing here?
View 1 Replies View RelatedWe have many users with a mobile application running SQL Mobile and using merge replication to get data back to the SQL 2008 R2 database. This has worked very well for many years.
We now have a requirement to have this data reported on using Reporting Services. This is where it gets messy.
Due to a limitation of Report Builder(see this blog) we cannot provide access to users for creating their own reports. The report database is remote from the host and there is no VPN.
We hit upon the idea of creating an almost identical publication but the articles as read-only. It was only after this was done that we started having trouble with our existing mobile users.
It seems that a published article is EITHER Bi-directional OR Read-only even if they are in separate publications.
I then thought of using Transactional Publication but this too is blocked on creation with "automatic identity range support is useful only for publications that allow updating subscribers"(Merge and Transactional publication are mutually exclusive)
So in the final analysis is there a way for me to have merge replication AND some other form of SQL replication/data transfer that can have the same data transmitted readonly to a separate full SQL server database?
I'm using MSAccess 2k as a front end to a SQL Server 2k database.
I have a user set up in SQL Server to be database owner for a specific database.
Using NT authentication.
Using ADO.
The MSAccess application executes a store procedure on the SQL Server that (1) deletes a tables if it exists, (2) creates and populates a table (the owner shows up in Enterprise Manager as the user name) and then (3) uses the table (read) in a join to do some other processing.
The (1) delete works fine.
The (2) table is created and populated fine.
On (3) the Select (inner join) to do the aditional processing I get an error message that the table name used is an invalid object.
Workaround.
If I create the table as sa separately and in the store procedure, instead of deleting, creating and populating the table I merely truncate the table and then repopulate it, everything works fine.
I would prefer to not have the table sitting around the database all the time.
Anyway, I'd like to figure out why the table is causing a problem.
Any ideas?
Thanks.
Hi,
I am getting below error when exporting data from SQL Server 2005 to MS Access.
[DTS.Pipeline] Error: SSIS Error Code DTS_E_PROCESSINPUTFAILED. The ProcessInput method on component "OLE DB Destination" (1706) failed with error code 0xC0202009. The identified component returned an error from the ProcessInput method. The error is specific to the component, but the error is fatal and will cause the Data Flow task to stop running. There may be error messages posted before this with more information about the failure.
Its direct mapping from OLE DB Source (SQL Server 2005) to OLE DB Dest (MS-Access Database)
Help from anyone. Plz its urgent.
Regards,
hi,
I have MS Access Database (test.mdb), and i have a table called tblEmployee in that.
How to query the table from SQL Server Query Analyser?
Thanks in advance
qAnand
Migration from MsAccess to Sql-Server.
Problem:
Ing_ID = nz(me.Ing_AutoNr,0)
me.openform "MyForm",,,"ID = " & Ing_ID
This work in MsAccess with new records but this doesn't work in Sql-Server. How can I solve this?
Hi,
I Need to make a script or task that programmatically export data from SQL Server to Access File , and how to call the script from the .NET?
I need to switch from MS Access to SQL Server for my database. To set
up a development environment I downloaded the free Microsoft SQL Server
Express (February CTP version). I installed the required .NET Framework
v2, and then SQLExpress. The install was done using all the defaults,
and was done successfully. I also downloaded and installed the SQL
Express Manager Tool.
The SQL Server was installed on the same machine as my VS.NET
development environment. The SQL Server process is now running, and I
can connect to the server using the SQL Express Manager Tool. This
allows me to view and query the sample databases, but not much else.
To convert my Access .MDB database to SQL Server, I am trying to use
the MS Access Upsizing Wizard. The version of Access I am using is
Access 2002 on a Windows XP-Professional system. The problem is that
Access cannot get a connection to the SQL Server. I tried using the
default server name "(local)" and "Use Trusted Connection", but I
receive the following error:
Connection failed:
SQLState: '01000'
SQL Server Error: 2
[Microsoft][ODBC SQL Server Driver[]Shared Memory]ConnectionOpen (Connect()).
Connection failed:
SQLState: '08001'
SQL Server Error: 17
[Microsoft][ODBC SQL Server Driver[]Shared Memory]SQL Server does not exist or access denied.
Curiously, I get this exact same error message even if the SQL service
is stopped. So I'm pretty sure the problem is that it is not finding
the SQL server, and not a security issue.
In order to connect to the SQL server using the SQL Server Manager
Tool, you have to provide the actual instance name for the server
"COMPNAMESQLExpress". So I tried using this server name in the Access
Upsizing Wizard, but this returns the same error message as above
except the first SQL Server Error is 53. I also tried using a Login ID
and password (using the Windows administrator ID and password, and also
the "sa" ID and password) to no avail.
I am at wits end, and can't figure out why Access can't find the SQL Server. Any ideas would be appreciated.
Thanks.
hi,
i export datas from sql server 2000 to Ms Access. but few tables only not expot. and error has come "the microsoft jet data base engine cannot find the input or Query "<t.n>" make sure it exists and that its name is spelled correctly.
but tables are live in sql server 2000.
Please give solution as soon
I previously posted re. this, but thought I'd try again with a summary offacts.I have an Access 2000 MDB with a SQL Server 7 back end. There is a view thatis linked to the database via ODBC and has been in place for several yearswithout any performance problems.Recently I added a couple of fields to the output of the view, and it becamevery slow when scrolling. When just opened in the database window, thelinked view takes about a second to scroll down one screen. When opened inthe form (in Continuous Form view), it takes about 2-3 seconds. It used toscroll just about instantaneously.I tried removing the few fields I added to restore the view to its previousform, but it had no effect. The view was still much slower than it had been.The total number of records returned from the view is about 1300, so it'snot a large number of records. The view has about 25 fields.I found that when I link the view in the MDB without specifying a uniqueindex, it scrolls very quickly -- almost instantaneously. But when I specifythe unique index, it is slow. Since the view needs to be edited, it needsthe unique index defined.As noted, it's been in place for years, with a unique index defined, yetwithout the slowness. Any ideas as to what might have caused this and whatmight be done would be appreciated. I've included the SQL for the viewbelow.Thanks,NeilSQL FOR MAIN VIEW:SELECT INVTRY.[Index], INVTRY.TITLE, INVTRY.AUTHILL1,INVTRY.attFirstEdition, INVTRY.attSigned,ISNULL(INVTRY.attSignedPD, ' ') SignedCond, INVTRY.YRPUB,INVTRY.PRICE, INVTRY.Web, INVTRY.Status,INVTRY.WebStatusPending, INVTRY.ActivateDate,INVTRY.DeactivateDate, INVTRY.WebAddedBatchID,INVTRY.AllowDuplicate, INVTRY.WebAction,INVTRY.WebActionPending, INVTRY.DateModified,INVTRY.DateWebActionApplied, INVTRY.JIT, INVTRY.MImage,INVTRY.HImage, INVTRY.AdCode,CASE WHEN INVTRY.WebAddedBatchID IS NOT NULLTHEN - 1 ELSE 0 END AS OnWebFROM vwInventory_Dupes INNER JOIN(WebStatus INNER JOIN(INVTRY INNER JOINtabStatus ON INVTRY.Status = tabStatus.Status) ONWebStatus.WebStatus = INVTRY.Web) ON(vwInventory_Dupes.YearPub = INVTRY.YRPUB) AND(vwInventory_Dupes.SignedCond = ISNULL(INVTRY.attSignedPD,' ')) AND (vwInventory_Dupes.Signed = INVTRY.attSigned) AND(vwInventory_Dupes.FirstEd = INVTRY.attFirstEdition) AND(vwInventory_Dupes.Author = INVTRY.AUTHILL1) AND(vwInventory_Dupes.TITLE = INVTRY.TITLE)WHERE (((tabStatus.ForWeb) = 1) AND ((WebStatus.IncludeDupe)= 1))SQL FOR vwInventory_Dupes:SELECT INVTRY.TITLE, INVTRY.AUTHILL1 Author,Cast(attFirstEdition AS tinyint) FirstEd,Cast(attSigned AS tinyint) Signed,ISNULL(INVTRY.attSignedPD, ' ') SignedCond,INVTRY.YRPUB YearPubFROM WebStatus INNER JOIN(INVTRY INNER JOINtabStatus ON INVTRY.Status = tabStatus.Status) ONWebStatus.WebStatus = INVTRY.WebWHERE (((tabStatus.ForWeb) = 1) AND ((WebStatus.IncludeDupe)= 1))GROUP BY INVTRY.TITLE, INVTRY.AUTHILL1,Cast(attFirstEdition AS tinyint), Cast(attSigned AS tinyint),ISNULL(INVTRY.attSignedPD, ' '), INVTRY.YRPUBHAVING (((COUNT(INVTRY.[INDEX])) > 1))
View 12 Replies View RelatedHi all,is there any tool which is capable to convert query initially written formsaccess database to query for mssql server.I have tons of queries which contains iif, trim and similar functions whichshould be converted to case, ltrim(rtrim(, etc. etc.Does anyone know for tool which could do that automatically?Thanks in advance,Anabella
View 1 Replies View RelatedHey everyone. I've linke an access database and I am able to query the tables like so:
SELECT *
FROM QFinity...tblEmployees
I can do that to all the tables, however, I'd like to create a view to this linked database. Is this possible? I have a more complex query I'd like to run:
SELECT dbo_evaluations.eval_id, dbo_evaluations.quality_date, dbo_eval_questions.status
FROM QFinity...dbo_evaluations INNER JOIN dbo_eval_questions ON dbo_evaluations.eval_id = dbo_eval_questions.eval_id;
I get the error "Msg 208, Level 16, State 1, Line 1
Invalid object name 'dbo_evaluations'."
I'm afraid I've reached the limit of my know how concerning sql server 2005... I think I read that I need to create a view? But I can't figure out how to do that.
Thanks for any help!
Dave
Windows XP, Office XP
I have an Access 2000 MDB file with a SQL 7 back end. I have a main tablewith 50,000 records; and I have a selections table with 50,000 records foreach machine that uses the database (about 25-50). This allows each user tohave their own set of selections.The selections table has three fields: ID (int), Sel (bit), MachName(varchar). ID and MachName comprise the primary key.I have a view that combines the main table and the entries for theselections table for the current machine (SQL below). The view works finewhen opened in EM and QA. And if I create a pass-through query from myAccess MDB file, the results are displayed fine.However, if I link the view to the Access MDB file, I get "#Deleted" inevery field of every record (which seems to indicate that the records werethere and then they were gone). However, if I hard-code the machine nameinto the same view instead of using HOST_NAME and then relink the view tothe MDB file, the linked view opens fine. Only when I use HOST_NAME as aparameter in the view is there a problem with it.Anyone have any idea what's going on here, or have heard of any issues withHOST_NAME and ODBC linked objects? SQL for the view is below.Thanks!NeilSELECT INVTRY.*, InvtrySelections.Sel, InvtrySelections.MachNameFROM dbo.INVTRY INNER JOINdbo.InvtrySelections ONdbo.INVTRY.ID = dbo.InvtrySelections.IDWHERE (dbo.InvtrySelections.MachName = HOST_NAME())
View 20 Replies View RelatedGreetings,I have 3 servers all running SQL Server 2000 - 8.00.818. Lets callthem parent, child1, and child 2.On parent, I create a view called item as follows:CREATE view Item asselect * from child1.dbchild1.dbo.Item union allselect * from child2.DBChild2.dbo.ItemOn child1 and child2, I have a table "item" with a column named "id"datatype uniqueidentifier (and many other columns). There is anon-clustered index created over column "id".When I connect to the parent server and select from the viewSelect id, col1, col2, …. From item where id =‘280A33E0-5B61-4194-B242-0E184C46BB59'The query is distributed to the children "correctly" (meaning itexecutes entirely (including the where clause) on the children serverand one row is returned to the parent).However, when I select based on a list of idsSelect id, col1, col2, …. From item where id in(‘280A33E0-5B61-4194-B242-0E184C46BB59',‘376FA839-B48A-4599-BC67-25C6820FE105')the plan shows that the entire contents of both children item tables(millions of rows each) are pulled from the children to the parent,and THEN the where criteria is applied.Oddly enough, if I put the list of id's I want into a temp tableselect * from #bv1id------------------------------------280A33E0-5B61-4194-B242-0E184C46BB59376FA839-B48A-4599-BC67-25C6820FE105and thenSelect id, col1, col2, …. From item where id in (select * from #bv1)the query executes with the where criteria applied on the childrendatabases saving millions of rows being copied back to the parentserver.So, I have a hack that works (using the temp table) for this case, butI really don't understand the root cause. After reading online books,in a way I am confused why ANY of the processing is done on thechildren servers. I quote:================================================Remote Query ExecutionSQL Server attempts to delegate as much of the evaluation of adistributed query to the SQL Command Provider as possible. An SQLquery that accesses only the remote tables stored in the provider'sdata source is extracted from the original distributed query andexecuted against the provider. This reduces the number of rowsreturned from the provider and allows the provider to use its indexesin evaluating the query.Considerations that affect how much of the original distributed querygets delegated to the SQL Command Provider include:•The dialect level supported by the SQL Command ProviderSQL Server delegates operations only if they are supported by thespecific dialect level. The dialect levels from highest to lowest are:SQL Server, SQL-92 Entry level, ODBC core, and Jet. The higher thedialect level, the more operations SQL Server can delegate to theprovider.Note The SQL Server dialect level is used when the providercorresponds to a SQL Server linked server.Each dialect level is a superset of the lower levels. Therefore, if anoperation is delegated to a particular level, then Queries involvingthe following are never delegated to a provider and are always it isalso delegated to all higher levels.evaluated locally:•bit•uniqueidentifier================================================This suggests to me that any query having where criteria applied to adatatype uniqueidentifier will have the where criteria applied AFTERdata is returned from the linked server.Any ideas on the root problem, and a better solution to get the queryand all the where criteria applied on the remoted linked server?Thanks,Bernie
View 5 Replies View RelatedHi ,
On my Desktop i registered Production Server in Enterprise Manager
on that Server if i go to SecurityLinked Servers
There is another Server is already mapped, when i am trying to see the Tables under that one of the
Linked Server i am getting the Error message saying that
"Error 17 SQL Server does not exist or access denied"
if i went to Production Server location and if i try to see the tables i am able to see properly, no problems
why i am not able to see from my Desk top
i am using the sa user while mapping the Production Server on my DESKTOP using (ENTERPRISE MANAGER)
And i check the Client Network Utility in the Alias using Named Pipe only, i changed to TCP/IP still same problem
What might the Problem how can i see the Tables in Linked Server from my DESKTOP
Thanks