Solved

To Angellll : More OPENROWSET

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

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

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

In this article we will learn how to fix  “Cannot install SQL Server 2014 Service Pack 2: Unable to install windows installer msi file” error ?
In the first part of this tutorial we will cover the prerequisites for installing SQL Server vNext on Linux.
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
Via a live example, show how to setup several different housekeeping processes for a SQL Server.

634 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