-
Get MSSQL field flags with PHP
Hello,
I'm currently developing a new database abstraction script. But there are some problems with MSSQL and field flags. How is it possible to get all the information about a field flag (like in MYSQL, e.g. "not_null primary_key auto_increment...")?
And my second question: Is it possible to list all the user defined databases?
Thank you for your answers!
-
You can look at the text of system stored procedure sp_help to see how MS get these info.
For your table, run this in query analyzer
sp_help yourtable
To get a list of user databases query sysdatabases all databases except master, model, msdb and tempdb are user databases.
-
sysdatabases table is located in master database
select * from master.dbo.sysdatabases where dbid>4
or
select * from master.dbo.sysdatabases where name not in ('master','msdb','tempdb','model')
-
Ok, thank you for yuor help. So my 2nd question is cleared. But with "sp_help tablename" (1st question) I don't get any details about primary keys, index etc.
-
It does display it in SQL2K, I don't have a SQL 70 to verify it. Did you scroll the result window down?.
If it does not then there is no primary key defined.
-
I've tested with MSSQL 2003 Beta. But there is no forum for it, thats why I posted here.
-
SQL server 7 and SQL Server 2000 displays all the PK and IDx info.
May be your table doesnt have any PK or FKs.
You have yukon Beta?
-
Don't know what you mean with yukon beta. I have the official beta version from Microsoft (developer program) because I need that version for my content management system "Contentpapst" which has a database abstraction layer.
-
Oh I see.
I have a obsessive compulsive behaviour of finding YUKON. For me any Beta release looks like YUKON.
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
|
|