Solved

To Angellll : More OPENROWSET

Posted on 2001-06-08
4
1,325 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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
I have a large data set and a SSIS package. How can I load this file in multi threading?
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 to return specific rows and columns, with various degrees of sorting and limits in place.

785 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