Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Grant select permission in SQL tables
Message
De
17/03/2005 02:00:53
James Chan
Objectmastery Pty Ltd
Hawthorn, Australie
 
 
À
15/03/2005 04:49:29
Jon Neale
Bond International Software
Wootton Bassett, Royaume Uni
Information générale
Forum:
Visual FoxPro
Catégorie:
Client/serveur
Versions des environnements
Visual FoxPro:
VFP 8 SP1
Divers
Thread ID:
00993894
Message ID:
00996648
Vues:
16
Hi Jon,

I have sent you a private message regarding your queries.

Cheers
James

>Hi James,
>
>I'm glad that worked for you.
>
>I have a question that you may be able to help me with.
>
>I have a colleague that is looking to relocate to Australia (Melbourne area). He's interested to know,
>
>What the current work opportunities are like?
>If its possible to get contact information for IT firms in the area?
>Specific skills that are popular right now in Aus?
>
>His current skill set is VB6,VFP,ASP,HTML,JAVASCRIPT and SQL Server 2000.
>
>Please excuse the direct message regarding this but its always really interesting to know what's happening in another country.
>
>Regards
>
>Jon
>
>>It works beautifully. Thanks.
>>
>>>Try this.
>>>
>>>/* declare the variable for the current table and schema */
>>>declare @CurrTable varchar(40), @CurrSchema varchar(40)
>>>
>>>DECLARE tables_cursor CURSOR FOR
>>>SELECT TABLE_NAME, table_schema
>>>FROM INFORMATION_SCHEMA.TABLES
>>>WHERE TABLE_TYPE = 'BASE TABLE'
>>>
>>>OPEN tables_cursor
>>>
>>>-- Perform the first fetch.
>>>FETCH NEXT FROM tables_cursor
>>>
>>>-- Check @@FETCH_STATUS to see if there are any more rows to fetch.
>>>WHILE @@FETCH_STATUS = 0
>>>BEGIN
>>> -- This is executed as long as the previous fetch succeeds.
>>> -- EXEC sp_addrolemember 'db_datareader','Jon'
>>> FETCH NEXT FROM tables_cursor into @CurrTable, @CurrSchema
>>>
>>> /* grant permission, but 'grant' does not like @CurrTable */
>>> /* grant select on @CurrTable to ReadOnlyUser
>>> EXEC ('GRANT SELECT ON [' + @CurrTable + '] TO ReadOnlyUser')
>>>END
>>>
>>>CLOSE tables_cursor
>>>DEALLOCATE tables_cursor
>>>
>>>Jon
>>>
James Chan
ObjectMastery Pty Ltd
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform