I have a question about how I should go about handling different database versions (schema changes) with my application. I am using an sdf database as a local data store (either on the .NET framework or Compact Framework).
I set it up so that the database file has the database schema, but no actual data, which is copied to the AppData folder if it isn't already there. The I load the database into the dataset, and can store data in the database with no problems.
What I want to figure out is what happens when I later decide to change the database schema. For example, say I add a column to a table. When I load the existing database into the dataset, I get an exception because the existing database doesn't have that column.
It seems that there should be some way to update the existing database so that it adds the column into the table, and sets the rows to just have NULL for that new column.
I am not sure if the TableAdapter or some other object should handle updating the existing database so it matches the latest dataset schema, or if I need to manually write SQL statements to modify the existing database.
I have a big delimma. We are developing and application that requires parallel work to be done one different copies of databases at the same time. Then when one when group is done and ready to ship their bug fixes/features, the changes they make to the database and data have to be merge back into the baseline database.
Here's the specifics. 4 databases (that make up the product), 4 copies of the 4 database (one for each team).
I was thinking about using SQL DMO to attach to each database and comare each table's schema and data against the baseline (the current release) then scripting out the changes that were made.
Can someone give me some tips on how to maintain parallel database development and the merge process that can make this happen?
Could someone point me in the right direction? I have an internal development database and a production database. Is there an easy way to replicate the changes that have been made to the development version on the production server without modifying the actual data in the tables? So, if I add a new user in my development version I offcourse don't want to see it pop up in the live version. But adding/deleting/updating a new table or column should.
And if possible I'd also like to know how you could do the following: Let's say we have an OrderDetail table containing information about the purchased product. Let's say I'd like to add a new column 'total' to skip calculation on the database every time I want to know the totals. It should be able to initialise the value by doing 'times ordered * price' for every existing row. Is that possible as well?
Dear friends,In the area of GIS (Geographic Information Systems) there is a featureknown as versioning (long transactions).This feature allows databases to maintain different versions of data,in a hierachycal structure, in order to do simulation (what if ...),historical snapshots, concurrent editing, etc.Each version can be reconciled with its parent version in any moment(merge-post changes).I have recently seen that Oracle supports this feature from version9i.I am very interested in knowing if SQL server will support thisfeature in future versions. Looking at SQL Server 2005 doc. I haven'tseen any related info.Thanks,Jerry
I'm having problems to keep proper versioning control in place between the development and production environments. I'm running SQL2000 and we have hundreds of packages that runs daily. Some on shedules and some not.
Every time a package is saved, it creates a version in SQL Server. After development I want to be able to use something like "Visual Source Safe" and book the final version in that was moved into production. Something with a version number etc.
This is especially a problem if I want to roll back to a prior version of a package. I do not know which one of the 1000 versions to choose from that were created while developing the package.
Another problem is that I do not know if someone is working on a package if I want to work on it.
I can not run a search on all the packages to get a list of which tables/fields are used where to determine the impact of a program/database/design change that needs to be implemented.
I replicate (transactional replication) my data entry database to aread-only database. Both are SQL 2000+SP4. The web server reads theread-only database. At times, there will be lots of changes in the dataentry database, thus lots of replications to the read-only database. Iam concerned that the replication may lock the data in the read-onlydatabase, causing slow response to the web server.I would like to use row versioning so that the read-only database cansupply old data when the same row is being written by replication. Iread that row versioning is a feature in SQL 2005. Is there anyversioning capability in SQL 2000?Thanks
I was wondering if anyone knows if there is a way to version a report, after changes have been made kind of like there is to an application. when changes are made to an app with a version # of say 4.0.1 you can changge to 4.0.1. Without using a program like SourceSafe. Thanks in advance for the speed responses.
At ScottGu's Blog about "Database Publishing Wizard", AlexD from codeplex said: "Regarding the multiple requests for versioning, backup/restore of remote database, and selection of individual objects - these are all things we are actively looking at for our next release in the first half of 2007." After so many searches, I still don't know if this tool performs Versioning, i.e, when deploying the database, just update de diferences between the local and server database. Did Visual Studio Express 2008 have somethingh like that? (I know that VS Team Edition 2005 had). If this tool can't make it (versioning), which tool/method did you recomend me? Thanks in advance. Alberto
I did a seach here and found some posts but none that answered my specific problem.I am a programmer tasked with building an application for generating Quote Proposals. The database is for the most part fairly simple except when it comes to versioning and history. Basiclly every quote can be revised and modified several times prior to making a final decision (final approved quote), so I need to keep track of the changes that occur durning the revision process. I am not a DBA but I have had some database experience. From what I can tell I have two choices a.) Duplicate all the data everytime the quote is revised. While this method is does cause a lot of duplicate data it is very straitforward and easy to explain (or turnover to someone else) and reporting becomes very easy as well.Reporting.... this is my biggest area of concern as the users of the app should have the ability to print out the original quote proposals as well as the revised quote proposals. Duplicating all the data makes reporting very easy.b.) Create a history table and record the original data (along with who and when) before recording the new value in the main table. While this method does conserve disk space it make reporting a bit difficult as you would have to pull the specific value for a specific Quote Revision and display the orginal values on the report instead of the current ones.Table info: I looking a 10 to 12 tables to record and store the data. The largest table will have about 40 fields. Current estimates are producing about 5 to 8 quotes per week. Each quote is revised an average of 2 to 3 times.Are the pros and cons I listed the main ones to be concerned with and are there any other options?Thanks
I have a small webapplication, sql server 2000. The users can only update the data in the system. However my client needs a report that display changes. The changes are that needs to be monitored are only change of order status, change of delivery date and when a user splits an order.
What is the best practice to keep track of changes? A mirror table for each table with changes?
Hi All, I'm new on SSIS, but have worked for some time with DTS and a long time with other ETL tools like Informatica or OWB.
I would like to know in which way can i, easily, control my project/package versions. At the same time i need to implement a concurrency management system, which will control what developer is using which package, and when finished update the central repository (As it does Informatica or even OWB).
I have heard that i could implement versioning with source safe, but can i implement this in the way that i've referenced before. Can i use CVS?
For the past few months I've been developing an DW and ETL with SQL 2005 / SSIS. My packages are being deployed to a SQL Server. Although in the end game we will have a Dev/Staging/Production environments, I would still like to archive production packages when we push staging to production. Essentially I would like to archive the last X packages that were deployed to production where X is a reasonable number (3 - 5). I don't necessarily need to have them accessible to run. One of the purposes is to have another safeguard should we miss anything in user testing and need to roll back a deployment.
I am utilizing VSS and we will have backups running on the production server, but I would prefer to have a archive that is a little more accessible.
I just wondering if anyone has any thoughts on how to extract/archive production packages when the push is made. I could easily develop an app that queries the MSDB and exports the packages to the file system.
Edited:Maybe I should have posted this to the "managed" newsgroup. If any admins think that would be better, then let me know. I don't want to duplicate unnecessarily.
Hi,
We developed a custom Control Flow task for SSIS (2005, not yet had a lot of time to look at 2008 yet) and found that it does not handle versioning, or an uninstall and the resulting lack of an addressable component very gracefully.
Here is a typical scenario:
Baseline
Install component MyCustomTask 1.0 Create Project Save Project
Action 1
Uninstall MyCustomTask 1.0 and don't install the new version (a typical user scenario!) Open Project SSIS acts like the world has ended, especially if the user forgot to manually remove the item from the toolbox Fix:None, obviously, but it would be nice to be a bit more graceful and informative. Backdoor Toolbox fix: "Cleanse" the toolbox when it goes haywire by deleting the toolbox.tbd, in Documents and Settings<UserName>Local SettingsApplication DataMicrosoftVisualStudio8.0
Action 2
Uninstall MyCustomTask 1.0 cleanly, plus removing the toolbox item by hand. Install MyCustomTask 1.1, with identical interfaces etc, and add the toolbox item by hand. SSIS acts like the world has ended, and fails to ask you a sensible question like "do you want to upgrade the project to use the new version of the component" Fix:Identify major and minor version component changes and throw the user a rope. Backdoor Fix: Go into the DTSX manually - attack the DTSExecutable ExecutableType and DTS Name, for a Task in our case and replace it with the new version info. Even if the interface for the component has changed slightly, it seems to deal with that OK.
Given the fact that it seems to be very likely that there will need to be SSIS version specific builds of components (I am assuming that a task created in 2005 will not work with 2008), what is the best way to deal with the current lack of SSIS smarts.
Would this be the best approach:
Version the interfaces, but never the builds within a version i.e. My.CustomTask90 v1.0, My.CustomTask100 v1.0 etc.
This is a bit of a pain, rather than the simpler My.CustomTask v9.0 / v10.0 etc.
Or, are there some nice improvements in the pipe to alleviate this, plus perhaps even a way to programatically add components to the toolbox, rather than the low-rent method of getting the user to do it by hand.
in simple words it's about versioning at record level.ExampleTableEmployee - EmployeeId, EmployeeName,EmployeeAddress, DepartmentId,TableDesignationMap - EmployeeId, DesignationId, EffectiveDate,validityTableDepartment - DepartmentId, DepartmentTableDesignation - DesignationId, designationVia Modify-Employee-Details screen following are editableEmoyeeNameEmployeeAddressDepartmentDesignationthis screen should allow user to navigate through changes history.Example :Version -1EmoyeeName John SmithEmployeeAddress 60 NewYorkDepartment AccountsDesignation AccountantVersion -2EmoyeeName John SmithEmployeeAddress 60 NewYorkDepartment AccountsDesignation Chief Accountant - changedVersion -3EmoyeeName John SmithEmployeeAddress 60 NewYorkDepartment Sales - changedDesignation Marketing Manager - changedQuestion :What is the best proposed database design for maintaining historyrecords bound with version and retrieval techniqueBest RegardsSasanka
I have a question on locking pattern of read committed with snapshot isolation level that when two transaction update two different records then why do they block to each other even if they have previous committed value (old version of record).
I executed the below batch from a query window in SSMS
--Session 1: use adventureworks create table marbles (id int primary key, color char(5)) insert marbles values(1, 'Black') insert marbles values(2, 'White') alter database adventureworks set read_committed_snapshot on set transaction isolation level read committed begin tran update marbles set color = 'Black' where color = 'White'
--commit tran
Before committing the first transaction I executed below query from second query window in SSMS
--Session 2: use adventureworks set transaction isolation level read committed begin tran update marbles set color = 'White' where color = 'Black' commit tran
Here the first session blocks to second session. These same transactions execute simultaneuosly in snapshot isolation level. So my question is why this blocking is required in read committed with snapshot isolation level?
We replicate a SQL2000 database (DataBaseA) to a SQL2000 database (DataBaseB) by using the Restore function and hasn't change its logical name but only the physical data path and file name. It is running fine for a year. We use the same way to migrate the DataBaseB to a new SQL2005 server with the Restore function and the daily operation is running perfect. However, when we do the Backup of DatabaseB in the SQL2005, it just prompt the error message
System.Data.SqlClient.SqlError: The backup of full-text catalog 'DataBaseA' is not permitted because it is not online. Check errorlog file for the reason that full-text catalog became offline and bring it online. Or BACKUP can be performed by using the FILEGROUP or FILE clauses to restrict the selection to include only online data. (Microsoft.SqlServer.Smo)
Please note we left the DataBaseA in the old SQL2000 server.
Please help on how we can delete the Full-text catalog from DatabaseB so we can do a backup
I have database on localhost and i want to show this data on my website. I want to create a database online and want to sync with Local Host. Can it be possible syncing data automatically after some interval?
yes,I have an error, like 'The database file may be corrupted. Run the repair utility to check the database file. [ Database name = SDMMC Storage Cardwinpos_2005WINPOS2005.sdf ]' .I develope a program for Pocket Pcs and this program's database sometimes corrupt.what can i do?please help me
Greetings, I have just arrived back into the country (NZ) and back into ASP.NET. I am having trouble with the following:An attempt to attach an auto-named database for file (file location).../Database.mdf failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share. It has only begun since i decided i wanted to use IIS, I realise VWD comes with its own localhost, but since it is only temporary, i wanted a permanent shortcut on my desktop to link to my intranet page. Anyone have any ideas why i am getting the above error? have searched many places on the internet and not getting any closer. Cheers ~ J
I have a problem when i restore my .DAT_BAK file. I am getting error like "The backup set holds a backup of a database other than existing database. Restore Database is terminating abnormally".
I tried by using
RESTORE DATABASE <DATABASENAME> FROM DISK = 'D:DATAMYTEST.DAT_BAK' WITH MOVE 'VZAI_DATA' TO D:PROGRAM FILES..MSSQLTEST.MDF', MOVE 'VZAI_LOG' TO D:PROGRAM FILES..MSSQLTEST.LDF', REPLACE
And also i tried like
RESTORE DATABASE <DATABASENAME> FROM DISK = 'D:DATAMYTEST.DAT_BAK'
WITH REPLACE
When i use like this,
RESTORE FILELISTONLY FROM DISK = 'D:DATAMYTEST.DAT_BAK'. I am able to get the output as LogicalName, PhysicalName, Type, FileGroupName, Size, etc.
From the http://msdn.microsoft.com/en-us/library/bb384469.aspx (Walkthrough: Creating Stored Procedures for the Northwind Customers Table, I copied the following sql code:
--UpdateSPforNWcustomersTable.sql--
USE NORTHWIND
GO
IF EXISTS (SELECT * FROM sysobjects WHERE name = 'SelectCustomers' AND user_name(uid) = 'dbo')
DROP PROCEDURE dbo.[SelectCustomers]
GO
CREATE PROCEDURE dbo.[SelectCustomers]
AS
SET NOCOUNT ON;
SELECT CustomerID, CompanyName, ContactName, ContactTitle, Address, City, Region, PostalCode, Country, Phone, Fax FROM dbo.Customers
GO
IF EXISTS (SELECT * FROM sysobjects WHERE name = 'InsertCustomers' AND user_name(uid) = 'dbo')
SELECT CustomerID, CompanyName, ContactName, ContactTitle, Address, City, Region, PostalCode, Country, Phone, Fax FROM Customers WHERE (CustomerID = @CustomerID)
GO
==================================================================================== I executed the above code in my SQL Server Management Studio Express (SSMSE) and I got the following error messages:
Msg 911, Level 16, State 1, Line 1
Could not locate entry in sysdatabases for database 'NORTHWIND'. No entry found with that name.
Make sure that the name is entered correctly.
=============================================================================================================== I know I recreated the NORTHWIND Database from a different Database before and I did not do anything for the entry in sysdatabases. How can I change the entry in sysdatabases for database 'NORTHWIND' now? Please help and advise.
I recently added a new user to my database. Now I want to delete that user, but I keep getting the error above. What do I need to do to delete my recently added user?
We have a SQL database that uses Active Directory with Windows Authentication. Can users that are members of the Active Directory group that has read/write access to the SQL database create ODBC connections to access the database directly and update the data? They dont have individual logins on the server. They are only members of the Active Directory group that has a login?
I had to to relocate the database log file and I issued an Alter database command but by mistake I put a space in the file name as below. The space is at the beginning file name. Now I am unable get the database loaded to SQL Server. The database has 2 replications configured, so deleting and re-attaching the database means the replication needs to be re-configured. Is there an alternative way to issue a command to update the database FILENAME ? Not sure if this can be edited in master database (sys files).
ALTER DATABASE [User_DB] MODIFY FILE (NAME = User_DB_log, FILENAME = 'I:SQLLogs User_DB_log.ldf') GO
I created the db with the attached script and I am able to access ituntil I reboot the server. I've tried enabling flag 1807 via the SQLserver service and the startup parameters of the instance. In allcases the database always come up suspect after a reboot. There wasone instance where I was able to recover, but I am not sure how thathappened.Does anyone have an idea of how I can reboot the server without thedatabase becomming suspect?USE MASTERGODBCC TRACEON(1807)GO--DBCC TRACEOFF(1807)--DBCC TRACESTATUS(1807)GOCREATE DATABASE ReadyNAS ON( NAME = ReadyNAS_Data,FILENAME = '\NAS1NASDiskSQL ServerReadyNASReadyNAS_Data.mdf',SIZE = 100MB,MAXSIZE = 20GB,FILEGROWTH = 20MB)LOG ON ( NAME = ReadyNAS_Log,FILENAME = '\NAS1NASDiskSQL ServerReadyNASReadyNAS_Log.ldf',SIZE = 20MB,MAXSIZE = 100MB,FILEGROWTH = 10MB)
I downloaded and ran AdventureWorks.msi into my SQL Server Management Studio Express (SSMSE) one year ago.But I did not know how to attach it to my SSMSE then. Last week, I deleted it from the "Add or Remove" of Control Panel and I downloaded the new AdventureWork.msi and installed it my SSMSE. Today, I tried to use the Database Explorer of VB 2005 Express for the first Stored Procedure programming. I clicked on AdventureWorks.mdf and I got the following error: One or more files do not match the primary of the database. If you are attempting to attach a database, retry the operation with the correct files. If this is an existing database, the file may be corrupt and should be restored from a backup. Cannot open user default database. Login failed. Login failed for user 'CENADe1enxshc'. Log file 'C:Program FilesMicrosoft SQL ServerMSSQL.1MSSQLDataAdventureWorks_Data_log.ldf' does not match the primary file. It may be from a different database of the log may have been rebuilt previously. Please help and advise me how to correct this problem.
I have installed 2 SQL Server 2005 Express sample databases from 2 books, ASPnet 2.0 and ADOnet 2.0. The ASPNETDB.MDF was shown in App_Data and Database Explorer, but not in the SQL Server Management Studio Express. The AdoStepBy Step database created by a ConfigDB.exe was displayed in the Management Studio, but not in the App_Data, or Database Explorer.
Is this the way SQL Server 2005 runs the 2005 databases for SQL Server 2005 Express only? Or also in SQL Server 2005?