|
database
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
How to store schema of my tables in DatabaseIs there a way to store th schema of my database objects somewhere in
Database? Thanks It is already in your system tables. Are you looking to maintain your own
catalog? -- Anith 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 > > I'd like to have my DDL stored in somewhere so I can extract it You can generate the DDL yourself with a query, against the very views we've > programmatically? 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 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 > > Sorry ,maybe I didn't express myself clearly I still don't understand this word problem... can you show the structure of > 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? 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? 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 > > > 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 > 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 > |
|||||||||||||||||||||||