I am currently working with SQL Server 2008 R2, and I only have READ
access to several tables that store production data.
I find that in many cases it would be very nice if I could run something like the following and get the total number of entries that were affected:
USE DB GO BEGIN TRANSACTION UPDATE Person SET pType = 'retailer' WHERE pTrackId = 20 AND pWebId LIKE 'rtlr%'; ROLLBACK TRANSACTION
However, seeing that I do not have UPDATE
permission, I cannot successfully run this script without receiving:
Msg 229, Level 14, State 5, Line 5 The UPDATE permission was denied on the object 'Person', database 'DB', schema 'dbo'.
My questions:
- Is it possible to configure my account in SQL Server so that if I want to run an
UPDATE
script, it will be automatically completed by a rollback transaction (so that in fact the data will not be affected)
I know that I can make a copy of this data and run my script for a local SSMS instance, but I am wondering if there is a way to accomplish this.
source share