Merging Two Different SQL Server 2000 Databases With Same Schemas In A Single Database

Jan 7, 2008

Hi,

I have two databases lets say DB1 and DB2.
Schemas for both databases is same.
In both database schemas there are tables which has identity columns as primary key.
Now i want to merge these two databases in a single database say DB3.
It may also possible that some master records in both databases are common so they should not repeat in DB3

Is there any way so that i can do it quickly and as soon as possible.

Thanks in advance
Rohit

View 1 Replies


ADVERTISEMENT

Merging 2000 And 2005 Databases, Save As 2000

Apr 30, 2008

I have to merge the data from two databases, one is in SQL Server 2005 format, one is in 2000. The merged data will then reside on a SQL Server 2000 platform. Is there an easy way to do this through Management Studio or Enterprise Manager? Or will we have to export the data from the 2005 database to a flat file and import it into a new 2000 database. And then do the merge?

TIA

View 4 Replies View Related

Merging Multiple MSDE 2000 DB's Into A Single DB

Jun 3, 2008

Hi,

We are trying to consolidate sales order data from different sales locations where in which we have to merge multiple [more than 25] MSDE 2000 databases into a Single DB. What is the best way to do this?

At the end of the day i should have one DB which contains sales order data of all the sales locations.


Thanks,
SakthiVenkatesh.

View 5 Replies View Related

Is There A Tool For Creating Database Schemas From SQL 2000?

Sep 30, 2005

Be gentle, I'm new! :o

We have three databases running on SQL 2000 and would like a visual database schema. We'd rather not do it by hand. ;)

The free-er, the better!

Thanks in advance

Rajendrakumar Varsani

View 2 Replies View Related

Merging 3 SQL Server Databases Into One.

Apr 6, 2006

How do I merge three SQL Server databases into one. There will be some duplicated information in some of the tables. Any help much appreciated. Thanks.

P.S. Running SQL v7 on NT!!

View 1 Replies View Related

SQL Server 2008 :: Comparing / Merging Records In Single Table?

Jun 2, 2015

I'm trying to avoid a large amount of manual data manipulation.

Here's the background: Legacy system that has (well let's call apples apples) pretty much no method of enforcing data integrity, which has caused a fairly decent amount of garbage data to be inserted in some tables. Pulling one of the [Individuals] table from within this Legacy system and inserting it into a production system, into the Table schema currently in place to track [Individuals] in this Production system.

Problem: Inserting the information is easy, how to deduplicate the records that exist within the staging table that the legacy [Individuals] table has been dumped into in production, prior to insertion. (Wanting to do this programmatically with SQL or SSIS preferably, so that I can alter it later to allow for updating existing/inserting new)

Staging Table Schema:

;
CREATE TABLE [dbo].[stage_Individuals](
[SysID] [int] NULL, --Unique, though it's not an index intended to identify the [Individuals]
[JJISID] [nvarchar](10) NULL,
[NameLast] [nvarchar](30) NULL,
[NameFirst] [nvarchar](30) NULL,
[NameMiddle] [nvarchar](30) NULL,

[code]....

Scenario: There are records that duplicate the JJISID, though this value is supposed to be unique for every individual. The SYSID is just a Clustered Index (I'm assuming) within the Legacy system and will be most likely dropped when inserted into the Production [Inviduals] table. There are records that are missing their JJISID, though this isn't supposed to happen either, but have valid information within SSN/DOB/Name/etc that can be merged into the correct record that has a JJISID assigned. There is really no data conformity, some records have NULLS for everything except JJISID, or some records will have all the [Individuals] information excluding the JJISID.

Currently I am running the following SQL just to get a list of the records that have a duplicate JJISID (I have other's that partition by Name/DOB/etc and will adapt whatever I come up with to be used for those as well):

;
select j.*
from (select ROW_NUMBER() OVER (PARTITION BY JJISID ORDER BY JJISID) as RowNum, stage_Individuals.*, COUNT(*) OVER (partition by jjisid) as cnt from stage_Individuals) as j
where cnt > 1 and j.JJISID is not nullNow, with SQL Server 2012 or later I could use LAG and LEAD w/ the RowNum value to do my data manipulation...but that won't work because we are on SQL Server 2008 in this environment.

[URL]

With, the following as a potential solution:

GSquared (3/16/2010)Here's a query that seems to do what you need. Try it, let me know if it works.

Performance on it will be a problem, but I can't fine tune that. You'll need to look at various method for getting this kind of data from the table and work out which variation will be best for your data. Without access to the actual table, I can't do that.

;
WITH CTE
AS (SELECT master_id,
MIN(ID) AS first_id,
MAX(Account_Expiry) AS latest_expiry
FROM #People
GROUP BY master_id)
SELECT P1.master_id,

[code].....

Unfortunately, I don't think that will accomplish what I'm looking for - I have some records that are duplicated 6 times, and I'm wanting to keep the values within these that aren't NULL.

Basically what I'm looking for, is to update any column with a NULL value to the corresponding Duplicate [Individuals] record value for that column.

**EDIT - Example, Record 1 has a JJISID with NULL NameFirst & NameLast BUT Record 2 has the same JJISID and values for NameFirst & NameLast. I'm wanting to propogate the NameFirst & NameLast from Record2 into Record1

View 6 Replies View Related

Synchronising Databases With Different Schemas

Apr 28, 2008

Hey folks,

I'm looking to gather ideas on this before I start the project; so what better way to start than to ask here? ;)

The situation is this: we are in the process of replacing a large data driven application with a new one. Before turning the old'un off (that's not for a minimum of 6 months), we need to migrate data between the two entirely different schemas, and I've been tasked with writing the interfaces.

Now, here comes the kicker; they don't just want a "straight-forward data conversion", they want to run a period where they can still update both databases and any changes in the old one are to be pushed into the new db.

Because the schemas are not the same, I believe replication is out of the question so I was looking for advice as to what possibilies I have ahead of me to achieve this.

I fear I may not have expained this well enough; so as always if there are holes in the detail let me know and I'll do my best to fill them in :)

Old db = SQL Server 2000
New db = 2005

Thanks,
George

View 13 Replies View Related

SQL 2012 :: Multiple Databases And Schemas

Jun 9, 2015

I have a SQL Server 2012 Enterprise Edition install that I am needing to do the following:

- Provide db_owner access to a single user. Have the db_owner privilege apply for the user in all Schemas of the database (this is a generic AD account that is being used for an application).

They are wanting me to do this because they do not want to get so granular as to tell me all of the objects that the user will need specific access to in any of the given Schemas of the database(s).I have 8 databases, and each one has additional Schemas. These are all contained in a Default instance.I am finding that without explicitly applying permissions to the various objects in the Schemas that are not the default Schema for this user, I am a bit stuck.Is there any way to have the db_owner permission apply to the single user for all the Schemas in a given database (without making them a Sysadmin)?

View 4 Replies View Related

How To Make A Single Database From Two Databases ....

Nov 8, 2006

Hi ...

I have two separete databases, what Ineed is that I want to make a single database of the two. Although all the table definitions of both the database are same.

I will be glad to know "how to make a single database from two" and i will be happy to see the query to insert the values from one database to another one.

Abdul Ghaffar

View 1 Replies View Related

Schemas, Stored Procedures And Shared Databases

Dec 11, 2007

Hi,

We have two databases right now that house miscellaneous small applications. We have them in place so developers can develop small applications in them without going through the database request process and bother the DBAs. This was set up before I got here - so I wasn't involved in the decision to do such a thing. The obvious drawback to this is that a restore would wipe out data for multiple applications. As we move to a new 2005 server we are re-evaluating our methods and would like some input on this - and some other aspects.

I know that we could use filegroups and put objects related to certain applications within them so restore is independent of other apps. Each application has its own user which is granted execute on it's stored procedures.
Are we missing anything here? I'm almost tempted to try to get separate databases created to uncomplicate it. If a developer can spend hours working on an app, they can spend 10 minutes on a form and wait 30 for us to create it.

Another thing I've noticed it that it can take quite a while to grant permissions to many stored procedures to a user in 2005. In 2000 there was a grid and you could arrow down and hit space, granting execute. You could also use code to do this, be we never really needed to since developers granted as they went and we would script the object and check the 'script obect level permissions' checkbox. This has since disappeared and granting execute is another step for us.

What do you think of 'sub schemas' for each role in the application - which is usually 'User' and 'Admin'? So we would have MylittleApp_User.ProcedureName and MylittleApp_Admin.ProcedureName with execute granted on the schema for each application user. Tables would be placed in MylittleApp schema.

In the past developers simply prefix their procedure with the application name to denote what application it belongs to.

Thanks for your advice on this - we don't want to get headed down the wrong path.

View 3 Replies View Related

View Of Multiple Databases With Identical Schemas

Aug 24, 2006

I have several distributed databases with identical schemas that I have added to my SQL server as a set of linked servers. For the sake of simplicity consider a schema with single table with one column called Info. I would like to present a view with columns DatabaseName and Info, that presents all the rows from all the databases in a single view.

How can this be achieved this using a SQL Server View?

If not is not possible using Views, what approach you recommend?

View 1 Replies View Related

Merging Two Rows Into A Single One

Mar 5, 2012

I'm using a shipping program called endicia professional that allows for database manipulation to make my processing easier. I've managed to fix the database here and there but have had an issue combining orders from a single customer when theybuy more than one item. Ideally I would like to have it combine rows when a customer purchases items going to the same address. To avoid having an issue where the address line is the same ie two people live in the same appt complex and it combines these I thought we could use qualifiers as the purchase will have name, order Id that should be unique enough

Order-id name address sku
1234 John 46 easy ln. A27
1234 John 46 easy ln. B32

Results:
Order-id name address sku
1234 John 46 easy ln. A27,b32

View 6 Replies View Related

Complex Merging Query In Sql Server 2000

Oct 6, 2006

Hello,I have a Database in a SQL Server 2000 where I have different userstables with equal fields like this:id (int)email (varchar)name (varchar)address (varchar)joinedon (datetime)I want to merge all the tables in one taking rows with the same emailbut taking always the more recent fields based on the 'joinedon' field.So if I have this four different rows:Tbl email name address joinedon--------------------------------------------------------------------------------------------T1 Join Bytes! johnathan NULL 01/01/95T2 Join Bytes! NULL barcelona street 01/01/98T3 Join Bytes! john valencia street 01/01/97T4 Join Bytes! john Q NULL 01/01/99And the final row entered in the new table would beTbl email name address joinedon----------------------------------------------------------------------------------------new Join Bytes! john Q barcelona street 01/01/99I am trying doing his with union statements, but i am not getting thereal merging of data. Any clue?Thanks for your help.

View 1 Replies View Related

Merging Databases

Aug 17, 2006

I'm pretty new to SQL altogether. I kinda gave myself a crash-course when the software I was using, Papertrack, was having problems. It all started when I tried to move the database. Now there are two separate databases that I can see on SQL Enterprise manager. I picked up the book and figured some things out, but still don't know how to merge the databases. I called the support for the software and got to know them on a middle-name basis. Is there a way I can merge the two databases so that the software can pull queries from both and access the files?
To anyone that likes a challenge,

Thanks

View 6 Replies View Related

Transact SQL :: Merging Every 3 Rows Into A Single Row

Aug 18, 2015

I have 2 columns (ID, Msg_text) in a table where i need to combine every 3 rows into single row. What would be the best option i have? I know by using 'STUFF' and 'XML PATH' i can convert all the rows into a single row but here i'm looking for every 3 rows into a single row.

View 3 Replies View Related

SQL Server 2005 Express Database Schemas

Jun 29, 2007



Down loaded the help desk starter data schema but do not know how to connect to mdf file using SQL server management studio can anyone help?



Thanks



Kevin

View 1 Replies View Related

Sync/Merge Local Sql Compact Databases To Single Global Database

Jun 23, 2007

Hi, I have compact sql databases which will be local on multiple users
devices. Due to space constraints, for one of the tables i have had to use
auto incrementing integer which works fine for the local database but i
would like to merge all of the users databases into a global database. The
table format can be seen below:




Code SnippetCREATE TABLE Players
(
ID UNIQUEIDENTIFIER NOT NULL PRIMARY KEY,
FirstName NVARCHAR(32),
LastName NVARCHAR(32)
);

CREATE TABLE Sessions
(
ID INTEGER NOT NULL IDENTITY,
PlayerID UNIQUEIDENTIFIER ,
SessionDateTime DATETIME,
CONSTRAINT pkSessions PRIMARY KEY (ID),
CONSTRAINT fkPlayerID FOREIGN KEY (PlayerID) REFERENCES Players(ID)
);

CREATE TABLE SessionDetail
(
SessionID INTEGER,
Time real,
Power real,
CONSTRAINT pkSessionDetail PRIMARY KEY (SessionID,StrokeTime),
CONSTRAINT fkSessionID FOREIGN KEY (SessionID) REFERENCES Sessions(ID)
);



The Players table will merge fine as GUIDs are used. However, how will the
sync capabilities of compact SQL handle the sessions table? When it pushes
the local data to the remote database will it change the Sessions.ID column
to a unique field (as no doubt lots of people will have 1, 2, 3 in their
local databases and the global database must have a unique ID), and then
transfer this changed ID back to the local database? Furthermore, if it
changes the Sessions.ID column during the merge it will also need to update
the SessionDetail.SessionID foreign key to maintain referential integrity,
is this also handled?

So my question is, how much of this sync and data merge is automated and are
there any good examples or pointers for my scenario? I cannot reasonably use
a GUID for Session.ID as there will be lots of SessionDetail entries and the
size would be far too much.

Many thanks,

Chris

View 7 Replies View Related

Merging 2 SQL Express Databases Into 1

Mar 15, 2007

Hello, As is known, when developing an application in VWDE that features membership as well the application's own database, you have a total of 2 databases. Seeing as a lot of hosters charge per database instance, to make the membership utility viable, it would be prudent to merge each database into one. Quite a few blogs/tutorials, including ScottGu's, recommend merging, but I'm as yet to find one that actually explains the merging process step by step. Advice such as, "run each script against the same database," simply isn't enough.If anyone could shed any light on this topic, it would be much appreciated. Of note, I have SQL Server Management Studio as the recommended deployment tool. If one thing's becoming increasing evident, it's that it would be well worthwhile in finding a host that supports SQL Server 2005 as opposed to 2000.  Kind regards.  

View 2 Replies View Related

Merging Data From Two Databases

Sep 14, 2007

i have two databases one has
firstname, lastname
and the othere
firstname, lastname, emailaddress

how do i get to merge the data from emailaddress to the 1st datbase?

Melvin Felicien
IT Manager
DCG Properties Limited

View 6 Replies View Related

Merging Two Databases With The Same Table Structures

Oct 20, 2000

Hi
I have a problem out here. I have two databases with the same table structure
and I want to merge data from both the tables . Please can anyone let me know.
Iam using Sql Server 7.0.

Thanks
Bye

View 1 Replies View Related

Merging 50 Databases Into One On A Nightly Basis

Sep 13, 2007

How would you solve this problem?
Would you use replication? SSIS? Schedule stored procs? A third party data tool?

We have about 50 databases located at offices around the world. There are several key tables which we need a central copy of at our Head Office.

We need only the new INSERTS or UPDATES for the day to be copied to head office.
The copying process should happen after business hours for that office.

Some cleaning of the data needs to happen before updating head office.

Our database is being installed at new offices every other month, so it's important to us that this be easy to add a new database into the schedule, ideally without needing a SQL DBA or Developer.

We want something robust, performant and easy to troubleshoot.


Kev

View 1 Replies View Related

How Many Databases Are There In A Single Server

Sep 28, 2007

Hi all,
How to find out how many databases are there in a
single server.
example: server name 172.16.9.33 i want to find out how many
databases are there in this server.
Any solution for this plz help me.



Thanks&Regards,

Msrs

View 3 Replies View Related

Multiple Databases In Single Linked Server ?

Apr 25, 2008

HI Guys,

I just need to add multiple catalogs to the same linked server, in Sql Server 2000 or Sql Server 2005. Here i need only to add 3 databases in to a single linked server name.


Thanks In Advance,
Krishna

View 1 Replies View Related

SQL 2012 :: TDE Encrypted Databases On 2 Different Server To Be Restored On Single Dev Server

Apr 29, 2015

have a Prod Server A having TDE enabled on 2 of those databases. I have a Prod Server B having TDE enabled on 3 of those databases. Now I have to create a single Dev server Server C for all the above 5 databases residing on the two servers. So how can I restore all the 5 database backup files on server C.

Does it mean that I need to copy the certificates and Keys from both the Prod server to this Dev Box and then restore the backup files. Once done, I can enable the encryption ON on those 5 database on Dev box or is there any different approach.Also how will tempdb behave in this scenario.

View 5 Replies View Related

MSSQL 2005 Schemas Vs SQL 2000 Users

Aug 20, 2007

Hello,
I think now MS SQL 2005 support packaging database object into schemas which may be granted access by any of the db users, while SQL 2000 only we could use the database creator user instead of schema. my case is i am working in a system with more than one module, e.g. HR + TaskManagemt.
Both HR and TaskManagement objects are in the same database, and there are some common objects.
I want to isolate the HR objects from the TaskManagemt objects, so i can package any module separated from the other, suppose i want to buy only the HR module, so that i want only to exctract the HR Object + the common objects but not the TaskManagement objects.
So how can i accomplish such operations using SQL 2005 schemas AND using SQL 2000 users.
P.S. i have two servers one with 2000 and the other with 2005, so i want to find solutions for both 2000 and 2005
 Thanks in advance

View 3 Replies View Related

Why Is My Database Re-indexing Script Not Able To Shrink Databases? (MSSQL 2000)

Aug 3, 2007

Hi,

Currently we have a variety of SQL 2000 (and 2005) database servers, we are having issues with the maintenance plan of a few SQL2000 boxes where they no longer have enough hard disk space to do a full index-rebuild on the system.

Now we want to re-build the databases indexes approximately once a week, or maybe a little less often, in the past this has worked fine with maintenance plans.

However, we now have issues because we have some databases in offline mode, and we are quite low on disk space with no plans for hardware upgrades anytime soon.
The temporary solution is to turn the index rebuilds off.

I have been working on a script that will:


Cycle through each database and within that database:

Go through each table
Run a DBCC DBREINDEX on the table
Move on to the next table
Once the reindexing of one database is complete
IF the database is not in simple mode

Backup the transaction log
Run a DBCC SHRINKDATABASE with the required amount of free space
Go to the next database until all are complete.The logic is quite simple but so far this has not worked, it would appear something is locking the transaction log until the script exits.


Now the script works fine excluding the shrinkdatabase, I always get:
DBCC execution completed. If DBCC printed error messages, contact your system administrator. [SQLSTATE 01000]
Shrinking database: inf_dev target percentage: 10 at: Aug 2 2007 5:33PM [SQLSTATE 01000]
Cannot shrink log file 2 (INF_PROD_Log) because all logical log files are in use. [SQLSTATE 01000]

Where I'm indexing the INF_Prod database.
A DBCC LOGINFO shows something along the lines of:



Code Snippet
BACKUP LOG successfully processed 45162 pages in 152.607 seconds (2.424 MB/sec). [SQLSTATE 01000]
FileId FileSize StartOffset FSeqNo Status Parity CreateLSN
----------- ---------------------- ---------------------- ----------- ----------- ------ ---------------------------
2 253952 8192 29618 0 128 0
2 253952 262144 29621 0 64 0
2 253952 516096 29620 0 64 0
2 278528 770048 29619 0 64 0
<cut cut>
2 9043968 370737152 0 0 0 29800000001528500007
2 9043968 379781120 29802 2 64 29800000001528500007
2 9043968 388825088 29801 0 64 29800000001528500007




Clearly there is something in the log file towards the end.
However, I don't know why this is happening as I'm running the script in the master database and I've backed up the transaction log of the database I'm working on.
I've tried doing Full backup + Transaction log + Shrink, it fails.
I've tried waiting 10minutes in the script + shrink, it also fails.

However, if I open a query analyzer and do a backup log, then a shrink it works perfectly every time.
However in the script it always fails no matter what I do.

Where am I going wrong here?

Regards,
Gareth

View 3 Replies View Related

Error Connecting Database Problem After Moving Databases 2000 To 2005

Nov 9, 2007

I have moved my databases to 2000 to instance of 2005 on the same server.
Now i set databases offline in 2000 as i did upgrade use backup & recovery method.

& my connection string
Password=test;Persist Security Info=True;User ID=test;Initial Catalog=databasename;Data Source=ipaddress

i was using above connection string to connect when using 2000 databases form applications in the production machine

I get the following error when i am running my applications now after moving to 2005


An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)

IS it because i have two server on one server or
What do i need to do in order to fix this....tried several thing by searching nothing worked out..

Let me know
thanks


View 9 Replies View Related

Compare 2 Database Schemas?

Nov 17, 2006

We're using Sql Server 2000. The one database contained tables and stored procedures which were possibly updated with some script information. Is there an application(commercial or free) or script I can use to compare the base database against this updated database to confirm there schema information is the same.

Thanks

View 1 Replies View Related

Multiple Database Vs. Schemas

Jul 24, 2007

We have a system with multiple modules, for each module we have a separate database. Is it better to have multiple databases or have multiple schemas. Performance, advantages, disadvantages...
When is too much too much, 10-25-50-100 Schemas???

Course.dbo.table1
Program.dbo.table1

vs.

NEWDB.Course.table1
NEWDB.Program.table1

Thanks

View 5 Replies View Related

Returning Database Schemas

Jul 20, 2005

Hi, I am storing information being sent to me weekly into a ms sqldatabase. The one twist I am running into is that later down the linethe information I recieve may require more columns, or columns mightbe renamed so having a static database call is out of the question. Iwas using mysql but for certain reasons switched to ms sql 2000.Currently before ms sql, I query the database for show fields whichreturns all the database data such as type, column name, etc... then Iuse a giant if statement structure to deal with matching andconverting data from my users display to the information into thedatabase.So my first question is how do I either query or using datatypes builtinto C# return information about a tables setup. I was hoping therewas some sort of table array object which could be returned with namesand types, if not then just an sql statement return.My second question is I have user data which needs to be displayeddifferently then the database raw data, how do I use a C# dataset, andconvert it's column data into my raw database data without having tocreate raw insert and update sql strings myself? I would really liketo use the sort of automatic update features of the dataset.Lastly am I going about this the wrong way? Are there other ways tomap & convert datatypes between a dataset column and a table column.

View 1 Replies View Related

Merging Data From Multiple Databases With Multiple Tables (all With The Same Structure)

Nov 15, 2006

Hi!

I have 7 source databases and one target database, all using the same structure. The structure is made of 10 tables, with foreign key constraints.

I need to merge the source databases into the target (which won't have any data before that process, but will already have the correct schema), and to keep the relationships between the records.

I know how to iterate over the source databases (with SMO foreach), but I'd like to know if someone can advise the best copy method for that context in SSIS ? (I don't want to keep the primary keys, but I need to keep the relationships...)

Any pointer most welcome!

best regards and thanks

Thibaut

View 1 Replies View Related

SQL Server 2000 Databases In RAM?

Jan 7, 2002

Hi all,
Please let me know if SQL Server 2000 databases be held in RAM inorder to improve performance.
Thanks in advance
Praveena

View 2 Replies View Related

SQL Server 2000 Databases To SQL Server 2005? Enterprise Manager And Management Stuio At The Same Server?

Feb 13, 2008

When I proposed start to use SQL Server 2005 for new VS 2005 web sites, one of my co-workers responded that
we will update the old SQL Server 2000 databases to SQL Server 2005 when we are ready to use 2005 SQL Server.

Questions:
1. Any expected problems to upgrade old 2000 databases to new 2005 SQL Server?
2. I have installed both 2005/Management Studio Express and 2000/Enterprise Manager in my PC. Any expected
problems when running both 2000 and 2005 SQL Server at the same database server?
3. What is the best configuration for running SQL Server 2005 when we have old 2000 databases? Upgade or not upgrade?

TIA,
Jeffrey

View 4 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved