SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2012 Forums
 Transact-SQL (2012)
 OpenRowSet does not delete records in Remote DB
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Geeta_chugh
Starting Member

1 Posts

Posted - 11/07/2013 :  04:27:51  Show Profile  Reply with Quote
Hi All,

I am trying to execute the following query in SQL SERVER 2012.
SELECT * FROM OPENROWSET ('SQLNCLI', 'Server=DBName;UID=newuser;PWD=newuser;', 'exec TESTDB.[dbo].[DeleteTableData]')

I am trying to delete a record from a Remote DB Server. The query gets executed without any issues, but does not delete the record. Also it does not throw an error.

SP Created:
CREATE PROCEDURE [dbo].[DeleteTableData]
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
delete from [TestDB].[dbo].[Table1] where id=1
select 1 as iREsult

END


Kindly help to resolve this issue.

Regards,
Geeta.

mattluk
Starting Member

15 Posts

Posted - 11/08/2013 :  11:58:45  Show Profile  Reply with Quote
the DB have rights to delete data in that table?
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.06 seconds. Powered By: Snitz Forums 2000