Home All Groups Group Topic Archive Search About

How to store schema of my tables in Database

Author
8 Jul 2005 6:07 PM
J-T
Is there a way to store th schema of my database objects somewhere in
Database?

Thanks

Author
8 Jul 2005 6:11 PM
Anith Sen
It is already in your system tables. Are you looking to maintain your own
catalog?

--
Anith
Author
8 Jul 2005 6:15 PM
J-T
I'd like to have my DDL stored in somewhere so I can extract it
programmatically?
Thanks
Show quote
"Anith Sen" <an***@bizdatasolutions.com> wrote in message
news:uNrqzi%23gFHA.320@TK2MSFTNGP09.phx.gbl...
> It is already in your system tables. Are you looking to maintain your own
> catalog?
>
> --
> Anith
>
Author
8 Jul 2005 6:23 PM
Aaron Bertrand [SQL Server MVP]
> I'd like to have my DDL stored in somewhere so I can extract it
> programmatically?

You can generate the DDL yourself with a query, against the very views we've
already told you about.

But if you have to do that, why bother storing it?  Run it when you need it!
An added benefit of this is that it will automatically take into account any
changes made to the schema, whereas if you store the DDL who can be
confident that the schema hasn't changed since the DDL was stored?

A
Author
8 Jul 2005 7:34 PM
J-T
Sorry ,maybe I didn't express myself clearly
I have a Group Table which should have a dynamic condition to address
specific users from User Tables.I was thinking to add a field to the Group
Table and put my condition there(T-SQL statement) and anytime I want to
extract the the users belonging to that group I can do it in this way.Is
there a better way of doing this?

Thanks


Show quote
"Aaron Bertrand [SQL Server MVP]" <ten.xoc@dnartreb.noraa> wrote in message
news:uc40no%23gFHA.2916@TK2MSFTNGP14.phx.gbl...
>> I'd like to have my DDL stored in somewhere so I can extract it
>> programmatically?
>
> You can generate the DDL yourself with a query, against the very views
> we've already told you about.
>
> But if you have to do that, why bother storing it?  Run it when you need
> it! An added benefit of this is that it will automatically take into
> account any changes made to the schema, whereas if you store the DDL who
> can be confident that the schema hasn't changed since the DDL was stored?
>
> A
>
Author
8 Jul 2005 8:08 PM
Aaron Bertrand [SQL Server MVP]
> Sorry ,maybe I didn't express myself clearly
> I have a Group Table which should have a dynamic condition to address
> specific users from User Tables.I was thinking to add a field to the Group
> Table and put my condition there(T-SQL statement) and anytime I want to
> extract the the users belonging to that group I can do it in this way.Is
> there a better way of doing this?

I still don't understand this word problem... can you show the structure of
the Group table (please use DDL, see http://www.aspfaq.com/5006) and the
kind of statement you want to store, and what it will be used for?
Author
8 Jul 2005 6:16 PM
Alejandro Mesa
It is already store in the system tables. See information schema views in BOL.


AMB

Show quote
"J-T" wrote:

> Is there a way to store th schema of my database objects somewhere in
> Database?
>
> Thanks
>
>
>
Author
8 Jul 2005 6:19 PM
Aaron Bertrand [SQL Server MVP]
They're already stored in your database.

http://www.aspfaq.com/search.asp?q=schema%3A


Show quote
"J-T" <J-T@nospam.com> wrote in message
news:%23snKef%23gFHA.3868@TK2MSFTNGP14.phx.gbl...
> Is there a way to store th schema of my database objects somewhere in
> Database?
>
> Thanks
>
Author
8 Jul 2005 7:11 PM
J-T
Sorry ,maybe I didn't express myself
I have a Group Table which should have a dynamic condition to address
specific users from User Tables.I was thinking to add a field to the Group
Table and put my condition there(T-SQL statement) and anytime I want to
extract the the users belonging to that group I can do it in this way.Is
there a better way of doing this?

Thanks
Show quote
"J-T" <J-T@nospam.com> wrote in message
news:%23snKef%23gFHA.3868@TK2MSFTNGP14.phx.gbl...
> Is there a way to store th schema of my database objects somewhere in
> Database?
>
> Thanks
>

AddThis Social Bookmark Button