>>>>I created a VFP 5.0 front-end application for a MS SQL Server database. My application currently has code that deletes all the records in a table and the appends new data to this table. Using SQL DELETE is slow and creates a large log file. I created a SQL Server stored procudure as the System Administrator that truncates the table. This is very fast and does not effect the log. My problem is this: even though I granted user rights to execute the stored procedure, the procedure fails stating that only the database owner or SA can truncate a table. Is there anyway around this?
>>>
>>>
>>>Jeff,
>>>
>>>You can make each user impersonate the DBO by giving each login an Alias (of the DBO's login).
>>>
>>>Valerie
>>
>>Thanks Valerie, but I don't think that would work. The DBO is the SA.
>>
>>Jeff
>
>Change the DBO to some other login ID -- look at the Administrator's Companion index: Owners, database, changing. It referenced page 276 in my copy. I had to do exactly the same thing!
>
>Referring to Scot's response -- I don't see DBO as being a bad thing, of course I also don't let the users know what their SQL Server login id's are!! Keeps 'em out of the back-end without going through my app.
>
>Valerie
Hi Valerie,
Thanks for all your help! What I ended up doing was creating a new userID and then I was able to alias the new userid to the dbo by issuing the command:
sp_addalis NewUserID, DBO
This created a DBO alias for the new userid for my database. Now I will create code in my VFP front-end that will prompt the user for the NewUserID and password only when I need to run the truncate table code.
Jeff
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement