Showing posts with label proc. Show all posts
Showing posts with label proc. Show all posts

Thursday, March 29, 2012

attach db in stored proc

Hi all,
I want a nonpriviliged owner to attach a specific database. I put the attach
command in a stored proc. How do I grant priviliges to that stored proc so
the user can exec it?
Thanks
FrankNo can do. Only users with symin or dbcreator server role can invoke
sp_attach_db.
-oj
"Frank" <frank@.frank.com> wrote in message
news:42668e6b$0$98488$e4fe514c@.news.xs4all.nl...
> Hi all,
> I want a nonpriviliged owner to attach a specific database. I put the
> attach command in a stored proc. How do I grant priviliges to that stored
> proc so the user can exec it?
> Thanks
> Frank
>sql

Monday, March 19, 2012

assigning values to parameters dynamically

i using a bound data grid which is using a stored proc. The stored proc needs the ClientID "if logged in" there is no form or control on the page outside of the loginstatus. I am wanting to pass theMembership.GetUser.ProviderUserKey.ToString() to the asp:parameter but I cant get it to work.

So How do I pass a variable to a stored proc parameter using a bound data grid.

I this its very strange that this cant be dont and there are a raft of reason why you wold want to do this with out the need to pass it to a form control.

please help

jim

Add the parameter to you parameters collection as a normal asp:parameter, then hook up to the data-source control's Inserting/Updating evnet (I assume you use a data-source control with the grid) and use the event argument to get access to the command object's parameters collection (if you use SqlDataSource), or the InputParameters if you use the ObjectDataSource.|||Or alternatively, when the user authenticates, store their id in a session variable, then anywhere in your app you can add it as a session parameter.