Home Page
Articoli
Tips & Tricks
News
Forum
Archivio Forum
Blogs
Sondaggi
Rss
Video
Utenti
Chi Siamo
Contattaci
Username:
Password:
Login
Registrati ora!
Recupera Password
Home Page
Stanze Forum
SQL Server 2000/2005/2008, Express, Access, MySQL, Oracle
Sp di Sistema
venerdì 07 agosto 2009 - 15.32
Elenco Threads
Stanze Forum
Aggiungi ai Preferiti
Cerca nel forum
delama77
Profilo
| Junior Member
185
messaggi | Data Invio:
ven 7 ago 2009 - 15:32
Ciao a tutti ,
quando la sp di sistema sp_databases non mi restituisce nessun valore c'è un modo per rimediare ?
Ho la necessità di recuperare in un windows control in vb net selezionando da una lista una particolare istanza voglio popolare una ulteriore lista in cui vado a individuare tutti i db disponibili .
In alcuni casi mi restituisce la lista dei db in altri mi restituisce il vuoto pur avendo delle basi dati collegate .
C'è un modo per popolare la tabella da cui ricavi i nome dei DB???
Grazie in anticipo a tutti
Alessandra
lbenaglia
Profilo
| Guru
5.625
messaggi | Data Invio:
ven 7 ago 2009 - 15:52
>quando la sp di sistema sp_databases non mi restituisce nessun
>valore c'è un modo per rimediare ?
Dai BOL: "Requires CREATE DATABASE, or ALTER ANY DATABASE, or VIEW ANY DEFINITION permission, and must have access permission to the database".
Se ti mancano queste permission, non verrà restituito l'elenco dei db, oppure sarà parziale.
In alternativa puoi interrogare la catalog view sys.databases, ma occhio che "If the caller of sys.databases is not the owner of the database and the database is not master or tempdb, the minimum permissions required to see the corresponding row are ALTER ANY DATABASE or VIEW ANY DATABASE server-level permission, or CREATE DATABASE permission in the master database. The database to which the caller is connected can always be viewed in sys.databases".
>Grazie in anticipo a tutti
Prego.
Ciao!
--
Lorenzo Benaglia
Microsoft MVP - SQL Server
http://blogs.dotnethell.it/lorenzo/
http://italy.mvps.org
delama77
Profilo
| Junior Member
185
messaggi | Data Invio:
ven 7 ago 2009 - 17:02
>>quando la sp di sistema sp_databases non mi restituisce nessun
>>valore c'è un modo per rimediare ?
>Dai BOL: "Requires CREATE DATABASE, or ALTER ANY DATABASE, or
>VIEW ANY DEFINITION permission, and must have access permission
>to the database".
>Se ti mancano queste permission, non verrà restituito l'elenco
>dei db, oppure sarà parziale.
>
>In alternativa puoi interrogare la catalog view sys.databases,
>ma occhio che "If the caller of sys.databases is not the owner
>of the database and the database is not master or tempdb, the
>minimum permissions required to see the corresponding row are
>ALTER ANY DATABASE or VIEW ANY DATABASE server-level permission,
>or CREATE DATABASE permission in the master database. The database
>to which the caller is connected can always be viewed in sys.databases".
>
>>Grazie in anticipo a tutti
>Prego.
>
Ho risolto riesco con la sys.databases...
Ho scritto prima ancora di provare a cercare bene ....
Grazie
Alessandra
Torna su
Stanze Forum
Elenco Threads
Partecipa anche tu! Registrati!
Hai bisogno di aiuto ?
Perchè non ti registri subito?
Dopo esserti registrato potrai chiedere
aiuto sul nostro
Forum
oppure aiutare gli altri
Consulta le
Stanze
disponibili.
Registrati ora !