Solved

To Angellll : More OPENROWSET

Posted on 2001-06-08
4
1,328 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 143

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 143

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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
A Stored Procedure in Microsoft SQL Server is a powerful feature that it can be used to execute the Data Manipulation Language (DML) or Data Definition Language (DDL). Depending on business requirements, a single Stored Procedure can return differe…
Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

710 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