Get ready for BLACK FRIDAY shopping starting in

Forums

This topic is locked

SQL madness

Posted 25 Jul 2002 06:21:06
1
has voted
25 Jul 2002 06:21:06 aegis kleais posted:
I'm creating an ASP application where I can remotely alter the DB Structure of my SQL7 db without having to reimport the db everytime.

So far, I provide a textbox in which I write the SQL statement there. It is converted into a command and executed just fine. My problem is this: Is it possible through SQL commands/ASP to retrieve the structure of a database? ie,

Database Name : [database_name]

[table_name]
---[field_name] datatype : [data_type]
---[field_name] datatype : [data_type]
---[field_name] datatype : [data_type]

[table2_name]
---[field_name] datatype : [data_type]
---[field_name] datatype : [data_type]
---[field_name] datatype : [data_type]

[table3_name]
---[field_name] datatype : [data_type]
---[field_name] datatype : [data_type]
---[field_name] datatype : [data_type]

This would be great, cause I'd be able to see the DB and it's info so I could make changes/etc in case I was using the wrong spelling of a field name or what have you.

I notice that SQL databases have many other tables in them (that are present even when you make a new database) but I don't see any that list all user-created tables. oeastwick? vfaric? You guys know what I'm gettin at here? anyone?


Aegis Kleais
New Media Web Developer
(DWMX : IIS5.1 : SQL2K : WXP : ASP[VB/JS])

Replies

Replied 25 Jul 2002 10:58:22
25 Jul 2002 10:58:22 Viktor Farcic replied:
Take a look at: www.farcic.com/products/products.asp?mnuID=45
It may be what you're looking for. You can use it as it is or take a look at the code and see how to retrieve the structure of a table or view. If you have any problems using it, send me a mail to:

P.S. The site isn't done yet and most of content isn't available.

Viktor Farcic
www.farcic.com
TalkZone Manager
Replied 25 Jul 2002 19:53:51
25 Jul 2002 19:53:51 aegis kleais replied:
Got the program up and running, thx, but looking into the code; I know it's a step or 2 too advanced for me right now. Schemas and what have you; lol; it'll be a while before I get there. But it does exactly what I'm looking for.

The only thing I saw wrong was that when you click for a table's properties, characters that use, say, varchar, you have "length" displayed as "lenght" Otherwise, that proggie kicks arse.

Aegis Kleais
New Media Web Developer
(DWMX : IIS5.1 : SQL2K : WXP : ASP[VB/JS])
Replied 26 Jul 2002 02:04:45
26 Jul 2002 02:04:45 Viktor Farcic replied:
Thanks for the tip. My english needs a little bit of polishing.

<BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote>
The only thing I saw wrong was that when you click for a table's properties, characters that use, say, varchar, you have "length" displayed as "lenght" Otherwise, that proggie kicks arse.
<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>

Viktor Farcic
www.farcic.com
TalkZone Manager

Reply to this topic