By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
428,997 Members | 1,657 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 428,997 IT Pros & Developers. It's quick & easy.

protecting functions from view it

P: n/a
Hello,
I wrote some complicated functions (and stored procedures) in database
at my work. System administrator (and every db user) can view codes
(in Enterprise Manager for eg.). My employer needs periodic modifying
of code and so I'm required to do it. But I can loose my job :)
because users are able to modify code (althout they ware too lazy to
create it by themselves).

Is this possible to protect functions from view it?

[please, don't mind my english]
Dec 22 '06 #1
Share this Question
Share on Google+
5 Replies


P: n/a
Pulpet (xy**@op.pl) writes:
I wrote some complicated functions (and stored procedures) in database
at my work. System administrator (and every db user) can view codes
(in Enterprise Manager for eg.). My employer needs periodic modifying
of code and so I'm required to do it. But I can loose my job :)
because users are able to modify code (althout they ware too lazy to
create it by themselves).

Is this possible to protect functions from view it?
I don't really know why you would prevent people from viewing your code,
least of all if they are in the same company.

But you should of course have all your code under version control, and
use the database as the storage for your code.
--
Erland Sommarskog, SQL Server MVP, es****@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pro...ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinf...ons/books.mspx
Dec 22 '06 #2

P: n/a
Dnia Fri, 22 Dec 2006 11:24:54 +0000 (UTC) grupowicz Erland Sommarskog
<es****@sommarskog.sewrote:
>I don't really know why you would prevent people from viewing your code,
least of all if they are in the same company.
It's a too long story. I have some reasons to do this.
>But you should of course have all your code under version control, and
use the database as the storage for your code.
Thanks for answer.

PS.I don't know about version control (I'm not a developer).
At other newsgroup user wloochacz send me answer:
FUNCTION < function_option ::= { ENCRYPTION | SCHEMABINDING }
and I used clause: with encryption
which is enough for me :)

Thanks
Dec 22 '06 #3

P: n/a

"Erland Sommarskog" <es****@sommarskog.sewrote in message
news:Xn**********************@127.0.0.1...
Pulpet (xy**@op.pl) writes:
>I wrote some complicated functions (and stored procedures) in database
at my work. System administrator (and every db user) can view codes
(in Enterprise Manager for eg.). My employer needs periodic modifying
of code and so I'm required to do it. But I can loose my job :)
because users are able to modify code (althout they ware too lazy to
create it by themselves).

Is this possible to protect functions from view it?

I don't really know why you would prevent people from viewing your code,
least of all if they are in the same company.

But you should of course have all your code under version control, and
use the database as the storage for your code.
Also, it sounds like the viewing isn't the problem, it's the users able to
modify the code.

Simple answer, make sure they don't have rights to make such changes.

Generally as a first pass, I try to lock users down to db_datareader and if
necessary db_datawriter.

That may solve your problem.

>

--
Erland Sommarskog, SQL Server MVP, es****@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pro...ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinf...ons/books.mspx

Dec 22 '06 #4

P: n/a
Pulpet (xy**@op.pl) writes:
PS.I don't know about version control (I'm not a developer).
At other newsgroup user wloochacz send me answer:
FUNCTION < function_option ::= { ENCRYPTION | SCHEMABINDING }
and I used clause: with encryption
which is enough for me :)
Then I hope you really have your code stored somewhere else, because else
you will not be able to retrieve it.

Well, there is code to reverse the so-called encryption; it's really only
obfustication.

--
Erland Sommarskog, SQL Server MVP, es****@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pro...ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinf...ons/books.mspx
Dec 22 '06 #5

P: n/a
> My employer needs periodic modifying of code and so I'm required to do it. But I can lose my job :) because users are able to modify code. <<

Can you make the procedures table-driven? Then let the users change
the tables and not the procedure code itself. You will need a
front-end and procedure to le them make these changes.

Dec 23 '06 #6

This discussion thread is closed

Replies have been disabled for this discussion.