|
database
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Setting version on SQL TableHi Guys,
Iam trying to set a version number to a database table. The main reason is if i add a new column later on i will be able to make sure that table schema need to be updated. I have tried updating the version column in the sysobjects for that table. but couldn't do that. Is it a good way to versioning the table or some other better mechanism for this. Please help me .. Hari Hari wrote:
> Hi Guys, You should never update the system tables in any way unless instructed > > Iam trying to set a version number to a database table. The main > reason is if i add a new column later on i will be able to make sure > that table schema need to be updated. > > I have tried updating the version column in the sysobjects for that > table. but couldn't do that. Is it a good way to versioning the table > or some other better mechanism for this. Please help me .. > > Hari to do so by Microsoft PSS. Why not store the database or table versions in another table. A simple: Create Table dbo.TableVersion ( TableOwner NVARCHAR(128) NOT NULL, TableName NVARCHAR(128) NOT NULL, TableVersion DECIMAL(4, 2) NOT NULL Primary Key (TableOwner, TableName) ) Thanks for your suggetion David. The problem iam finding with this approach
is, if someone delete the table and recreate it with out knowing the version table, the new table will be out of sync with version. I mean the new table will be become a brand new table but the version info will be independant. So thats the reason i like to connect the table maintenance with systables. Any suggetions? Thanks Hari Show quote "David Gugick" wrote: > Hari wrote: > > Hi Guys, > > > > Iam trying to set a version number to a database table. The main > > reason is if i add a new column later on i will be able to make sure > > that table schema need to be updated. > > > > I have tried updating the version column in the sysobjects for that > > table. but couldn't do that. Is it a good way to versioning the table > > or some other better mechanism for this. Please help me .. > > > > Hari > > You should never update the system tables in any way unless instructed > to do so by Microsoft PSS. > > Why not store the database or table versions in another table. A simple: > > Create Table dbo.TableVersion ( > TableOwner NVARCHAR(128) NOT NULL, > TableName NVARCHAR(128) NOT NULL, > TableVersion DECIMAL(4, 2) NOT NULL > Primary Key (TableOwner, TableName) ) > > > -- > David Gugick > Quest Software > www.imceda.com > www.quest.com > > You could use an extended property to hold version information - either way
holding version information inside the database is frought with error. Database users with the correct permissions can always circumvent your control making it useless. If you want a true database change management system have a look at DB Ghost which uses source control at the center of it's approach. This system has proved to be a guarenteed way to control changes to a database's schema and static data. With many governments, banks and fortune 500 companies adopting the software and the process it makes sense to check it out rather than dismiss it out of hand. regards, Mark Baekdal http://www.dbghost.com http://www.innovartis.co.uk +44 (0)208 241 1762 Build, Comparison and Synchronization from Source Control = Database change management for SQL Server Show quote "Hari" wrote: > Hi Guys, > > Iam trying to set a version number to a database table. The main reason is > if i add a new column later on i will be able to make sure that table schema > need to be updated. > > I have tried updating the version column in the sysobjects for that table. > but couldn't do that. Is it a good way to versioning the table or some other > better mechanism for this. Please help me .. > > Hari Thanks Mark, it is very useful.
Hari Show quote "mark baekdal" wrote: > You could use an extended property to hold version information - either way > holding version information inside the database is frought with error. > Database users with the correct permissions can always circumvent your > control making it useless. If you want a true database change management > system have a look at DB Ghost which uses source control at the center of > it's approach. This system has proved to be a guarenteed way to control > changes to a database's schema and static data. With many governments, banks > and fortune 500 companies adopting the software and the process it makes > sense to check it out rather than dismiss it out of hand. > > > > regards, > Mark Baekdal > http://www.dbghost.com > http://www.innovartis.co.uk > +44 (0)208 241 1762 > Build, Comparison and Synchronization from Source Control = Database change > management for SQL Server > > > > > "Hari" wrote: > > > Hi Guys, > > > > Iam trying to set a version number to a database table. The main reason is > > if i add a new column later on i will be able to make sure that table schema > > need to be updated. > > > > I have tried updating the version column in the sysobjects for that table. > > but couldn't do that. Is it a good way to versioning the table or some other > > better mechanism for this. Please help me .. > > > > Hari |
|||||||||||||||||||||||