Solved

To Angellll : More OPENROWSET

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

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

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

Nowadays, some of developer are too much worried about data. Who is using data, who is updating it etc. etc. Because, data is more costlier in term of money and information. So security of data is focusing concern in days. Lets' understand the Au…
Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
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.
Via a live example, show how to shrink a transaction log file down to a reasonable size.

920 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

14 Experts available now in Live!

Get 1:1 Help Now