|
-
Nov 16th, 2006, 05:37 AM
#1
Thread Starter
Member
return dartabase name
hi
im trying to find a function that returns the name of the database im using ..
for example, im using northwind in sql server. i want to return northwind, dbo and all databases on my local server (their names). shall i make several connections or just connecting to one is enough ! hope thats clear enough .. thnx much.
-
Nov 16th, 2006, 06:17 AM
#2
Re: return dartabase name
I don't have access to SQL Server at the moment but try
Code:
select name from sys.databases
that maybe version specific, there are usually views which do the same thing but are garunteed to be version independent.
-
Nov 16th, 2006, 06:27 AM
#3
Re: return dartabase name
If you have access to Master Database then you can use this query
PHP Code:
Select NAME From master..sysdatabases
Use [code] source code here[/code] tags when you post source code.
My Articles
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|