Click here to Skip to main content
11,720,364 members (79,544 online)
Rate this: bad
good
Please Sign up or sign in to vote.
See more: SQL-Server
i created a stored procedure like this
create PROCEDURE [dbo].[GetUsersWithProtection]
	-- Add the parameters for the stored procedure here
WITH Encryption,
     EXECUTE AS OWNER
AS
BEGIN
	-- SET NOCOUNT ON added to prevent extra result sets from
	-- interfering with SELECT statements.
	SET NOCOUNT ON;
 
    -- Insert statements for procedure here
		SELECT * from Table_Users
END

but you can open it with This Link or many other applications

so my question is how can i protect a stored procedure ?
thank you
Posted 22-Nov-12 3:36am

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Normally grants are used to protect your database assets.
http://msdn.microsoft.com/en-us/library/ms187965.aspx[^]

Good luck!
  Permalink  
Comments
Sina asefi at 22-Nov-12 11:31am
   
First Thank you for your response

my Store procedure name is : GetUsersWithProtection

and i did use from this code :

CREATE ROLE newrole ;
GRANT EXECUTE ON GetUsersWithProtectionTO newrole ;

but you can see it again
what's my problem ?
thank you

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 2,029
1 OriginalGriff 844
2 F-ES Sitecore 640
3 Maciej Los 609
4 Richard MacCutchan 540


Advertise | Privacy | Mobile
Web02 | 2.8.150901.1 | Last Updated 22 Nov 2012
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100