How to copy all the privileges from one user to another

When we add a new user we often have to grant him some privileges that are the same of another previous user.

The following script generates a script to copy all the privileges from one user to another.
It needs 3 parameters :

1/ From user 
2/ To user 
3/ Service name for the connection to database. 


The latter parameter is necessary to grant the object privileges as these are granted by the owner of the objects.

Pages: 1· 2