October 7, 2013 at 3:47 am
HI Experts,
I am search for coding criteria I need create a stored procedure with execute as and along with encryption. How can I use the same ? My main motive is to create proc with execute as a user also at the same time I need to encrypt the same from other users seeing the code.
The below query is getting errors, kindly some one help.
Create procedure testproc
with execute as 'user' and with encryption
as truncate table some table
Thanks
Mj
October 7, 2013 at 8:14 am
MJ-1115929 (10/7/2013)
HI Experts,I am search for coding criteria I need create a stored procedure with execute as and along with encryption. How can I use the same ? My main motive is to create proc with execute as a user also at the same time I need to encrypt the same from other users seeing the code.
The below query is getting errors, kindly some one help.
Create procedure testproc
with execute as 'user' and with encryption
as truncate table some table
Thanks
Mj
Personally I wouldn't bother with using the encryption portion. It is trivial to break the encryption.
_______________________________________________________________
Need help? Help us help you.
Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.
Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.
Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/
November 4, 2015 at 6:41 pm
Hello,
I know this is old but I happen to be looking for the same answer. However, I saw no one posted anything to resolve the issue. So, I actually looked at the MSDN page for CREATE PROCEDURE and what do you know, there it was.. 🙂 Answer: You place both 'execute as ..' and 'Encryption' after the WITH and separated by a comma.
EXAMPLE:
CREATE PROCEDURE Schema.ProcedureName
@Param1 NVARCHAR(50)
WITH EXECUTE AS OWNER, ENCRYPTION
November 5, 2015 at 9:17 am
fullyunknown (11/4/2015)
Hello,I know this is old but I happen to be looking for the same answer. However, I saw no one posted anything to resolve the issue. So, I actually looked at the MSDN page for CREATE PROCEDURE and what do you know, there it was.. 🙂 Answer: You place both 'execute as ..' and 'Encryption' after the WITH and separated by a comma.
EXAMPLE:
CREATE PROCEDURE Schema.ProcedureName
@Param1 NVARCHAR(50)
WITH EXECUTE AS OWNER, ENCRYPTION
But why bother using ENCRYPTION at all? It is really pretty much pointless. It is super simple to crack it. There are dozens and dozens of example of simply removing the encryption and returning the original code in plain text with little effort.
_______________________________________________________________
Need help? Help us help you.
Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.
Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.
Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply