Solved

To Angellll : More OPENROWSET

Posted on 2001-06-08
4
1,323 Views
Last Modified: 2006-11-17
/*
Hi,
To Angellll, Thanks stacks for you previous help. Its much appreciated. I would be glad if you would try(or anyone else) to help me on point c and d

PS. All rights on the database is set to allow any commands.

The following code work fine!

-- a)
Select * FROM
  OPENROWSET('SQLOLEDB','zzz';'sa';, "SELECT * FROM ddd.dbo.AaaaA")

-- b)
Insert into
  OPENROWSET('SQLOLEDB','zzz';'sa';, 'SELECT Naam FROM ddd.dbo.AaaaA') values ("TEST")

-- The follwing....??????????
-- c)
Delete FROM
  OPENROWSET('SQLOLEDB','zzz';'sa';, "ddd.dbo.AaaaA where Naam = 'TEST'")

-- d)
Update
  OPENROWSET('SQLOLEDB','zzz';'sa';, 'ddd.dbo.AaaaA' Set Naam = "ANDRE" where Naam = "TEST")

*/
0
Comment
Question by:beneke
  • 2
4 Comments
 
LVL 142

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 6168340
What about:

Delete FROM
 OPENROWSET('SQLOLEDB','zzz';'sa';, "select * FROM ddd.dbo.AaaaA where Naam = 'TEST'")

-- d)
Update
 OPENROWSET('SQLOLEDB','zzz';'sa';, 'select * FROM ddd.dbo.AaaaA' Set Naam = "ANDRE" where Naam = "TEST")

Cheers
0
 
LVL 142

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 100 total points
ID: 6168343
or rather:

Delete FROM
OPENROWSET('SQLOLEDB','zzz';'sa';, "select * FROM ddd.dbo.AaaaA where Naam = 'TEST'")

-- d)
Update a
OPENROWSET('SQLOLEDB','zzz';'sa';, 'select * FROM ddd.dbo.AaaaA' where Naam = "TEST") as a
Set Naam = "ANDRE"

Cheers
0
 

Author Comment

by:beneke
ID: 6176464
Thanks again

Please Take Note: -- unique index

Note The Microsoft? OLE DB Provider for SQL Server supports these interfaces only on a table that has a unique index. Because of this UPDATE or DELETE statements are permitted against a remote table in another Microsoft SQL Server? only when the table has a unique index.



0
 

Expert Comment

by:SpideyMod
ID: 8341949
Force Accepted.

SpideyMod
Community Support Moderator @Experts Exchange
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Having an SQL database can be a big investment for a small company. Hardware, setup and of course, the price of software all add up to a big bill that some companies may not be able to absorb.  Luckily, there is a free version SQL Express, but does …
Everyone has problem when going to load data into Data warehouse (EDW). They all need to confirm that data quality is good but they don't no how to proceed. Microsoft has provided new task within SSIS 2008 called "Data Profiler Task". It solve th…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now