how to hide stored proc and tables schema

hi,(sqlserver 2005 and sqlserer 2008 r2 express)

            I have to give my database to some body he has his own server, i do not want him to see my stored porcs code and/or name , and tables schema.

           I have used encryption to that,

but i think , there is some code available on internet , which can be used to get the code from stored procs,

please tel me how i can i accomplish the task.

yours sincerely

March 27th, 2014 10:44am

Hello,

Stored procedure / user defined function can be encrypted; but with a hack you may get them decrpyted as well.

For table and views there is no such Option available.

Free Windows Admin Tool Kit Click here and download it now
March 27th, 2014 10:59am

You may also create a user group with select permission on certain tables or all tables and put him in to the group. He may see the tables & other objects like SP & functions, but cannot read anything from it.

March 27th, 2014 11:49am

You may create a view which would get/contain the info required for your client.

And create a login in your server and provide access only to the view and share the login to your client.

This way you can restrict others from seeing your procedures and other objects.

Free Windows Admin Tool Kit Click here and download it now
March 27th, 2014 11:59am

iIhave given that database backup (.bak) to some body, he has his own sqlserver instance, and a machine,

will he be able to grant/denay permissions , if yes then he can see my SP.

-- At least he will be having "sa" for his instanace .

-- Can table schema be encrypted?( I know data can be encrypted)

yours sincerly




March 28th, 2014 12:36am

iIhave given that database backup (.bak) to some body, he has his own sqlserver instance, and a machine,

will he be able to grant/denay permissions , if yes then he can see my SP.

-- At least he will be having "sa" for his instanace .

-- Can table schema be encrypted?( I know data can be encrypted)

yours sincerly





He will be able to grant,deny permissions if his login is a member of securityadmin server role
Free Windows Admin Tool Kit Click here and download it now
March 28th, 2014 1:10am

When you are giving backup file of your database to 3rd party.It means you are literally giving him everything in the database.you can't restrict him from viewing the database objects
March 28th, 2014 3:00am

Hi Rajemessage,

Instead of going though all this, why can't you can create temporary database from original database , push object and data that is required(Subset of the original database). 

Set this is as process(Job) for before transfering the database. 

Take the backup of this temporary database  and provide to the user.


Free Windows Admin Tool Kit Click here and download it now
March 28th, 2014 3:26am

However, this works perfectly if the user is the owner of the database. Look
that

Create a new SQL login "login1"
Create a user named login1 in master database
Grant CREATE DATABASE to login1
While impersonating login1, create a database called dbteste
Revoke CREATE DATABASE permission from login1
Revoke VIEW ANY DATABASE permission from PUBLIC
Register this server as login1
From the login1 session, expand database tree. Now, you should see
master, tempdb, dbteste
Grant VIEW ANY DATABASE to PUBLIC
From the login1 session, you should see all the databases

March 28th, 2014 3:35am

iIhave given that database backup (.bak) to some body, he has his own sqlserver instance, and a machine,

will he be able to grant/denay permissions , if yes then he can see my SP.

-- At least he will be having "sa" for his instanace .

-- Can table schema be encrypted?( I know data can be encrypted)

yours sincerly




Free Windows Admin Tool Kit Click here and download it now
March 28th, 2014 7:32am

before you create the backup run the following command:

deny view definition to public

create the backup, run the following command:

grant view definition to public

March 29th, 2014 12:19am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics