Red Gate forums :: View topic - saving information
Return to www.red-gate.com RSS Feed Available

Search  | Usergroups |  Profile |  Messages |  Log in  Register 
Go to product documentation
SQL Doc 1
SQL Doc 1 forum

saving information

Search in SQL Doc 1 forum
Post new topic   Reply to topic
Jump to:  
Author Message
kingram



Joined: 16 Mar 2007
Posts: 1

PostPosted: Fri Mar 16, 2007 5:04 pm    Post subject: saving information Reply with quote

i have several lower level enviroments that gets refreshed form production every weekend. with the systems i have, we are documenting in my integration enviroment.

the descriptions of objects are stored i assume the objects extended descriptions field in SQL, how do i store those descriptions out side of that ? or can i ???
Back to top
View user's profile Send private message
david connell



Joined: 21 Nov 2005
Posts: 207

PostPosted: Mon Mar 19, 2007 3:43 pm    Post subject: Reply with quote

Hi there Kingram,

The descriptions used by SQL Doc are stored as extended properties, which in turn are stored in the database itself. As a result they will be backed up & restored within your database.

So the next question is, How to get all the extended Propeties out of the database?
I would use SQL Compare to compare my database against a blank database. And export the data as XML...
I would then use XSLT or a program to scan the XML and strip out the sp_addextendedproperty.
The XML looks like
Code:

- <line type="different">
  <left>ALTER TABLE [Person].[Address] ADD CONSTRAINT [FK_Address_StateProvince_StateProvinceID] FOREIGN KEY ([StateProvinceID]) REFERENCES [Person].[StateProvince] ([StateProvinceID])</left>
  <right />
  </line>
- <line type="different">
  <left>GO</left>
  <right />
  </line>
- <line type="same">
  <left>-- Extended Properties</left>
  <right />
  </line>
- <line type="same">
  <left />
  <right />
  </line>
- <line type="different">
  <left>sp_addextendedproperty N'MS_Description', N'Street address information for customers, employees, and vendors.', 'SCHEMA', N'Person', 'TABLE', N'Address', NULL, NULL</left>
  <right />
  </line>

The above example was taken from AdventureWorks.
Once I had this working well I would setup up some command line utlitilies to automate this task as part of my general build mechanisms...
Hope this helps
David Connell
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic All times are GMT + 1 Hour
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group