473,661 Members | 2,494 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Compare databases between 2 SQL servers

Hello,
I wish to see if the tables from database A server A1 exist in database
A on server B1.
I setup a linked server from my first server (robertcamarda) to a
target (cognos-dev)
This works from robertcamarda:
select count(*) from [cognos-dev].ds_v6_source.d bo.stdmas

and this works:
select * from ds_v6_source.in formation_schem a.tables order by
table_name

but this wont work:
select * from [cognos-dev].ds_v6_source.i nformation_sche ma.tables order
by table_name

Error:
Msg 117, Level 15, State 1, Line 1
The object name 'cognos-dev.ds_v6_sourc e.dbo.informati on_schema.table s'
contains more than the maximum number of prefixes. The maximum is 3.

I want to do something like:
select * from ds_v6_source.in formation_schem a.tables
where table_name not in (select table_name from
[cognos-dev].ds_v6_source.i nformation_sche ma.tables order by
table_name)

so I can see of the sql server (robertcamarda) has any missing tables
that exist on the server (cognos-dev)
TIA
Rob
SQL Server 2005 Enterprise

May 17 '06 #1
3 3570
use sqlcompare tool to compare anything and everything between two
databases

www.red-gate.com

download the trial version and see if it works for you.

May 17 '06 #2
On 17 May 2006 05:30:36 -0700, "rcamarda" <ro*****@hotmai l.com> wrote:
Hello,
I wish to see if the tables from database A server A1 exist in database
A on server B1.

winsql has a trial that is pretty useful
hth
Jeff Kish
May 17 '06 #3
rcamarda (ro*****@hotmai l.com) writes:
but this wont work:
select * from [cognos-dev].ds_v6_source.i nformation_sche ma.tables order
by table_name

Error:
Msg 117, Level 15, State 1, Line 1
The object name 'cognos-dev.ds_v6_sourc e.dbo.informati on_schema.table s'
contains more than the maximum number of prefixes. The maximum is 3.


There is an apparent inconsistency between the error message and the
command you presented.

Then again, I was not able to get it to work with the proper command
either. This is probably because the INFORMATION_SCH EMA views are
not present in the databases, only in master. (Hm, I believe they
were in SQL 7, so with if you connect to SQL 7 it might work.)

Rather than using INFORMATION_SCH EMA, use the system tables or
the catalog views depending on which version of SQL Server you
are on.

SELECT name FROM [cognos_dev].ds_v6_source.d bo.sysobjects
WHERE type = 'U'
ORDER BY name

--
Erland Sommarskog, SQL Server MVP, es****@sommarsk og.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pro...ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinf...ons/books.mspx
May 17 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
2638
by: CJ | last post by:
We have just released for beta testing our xSQL Object that allows SQL Server DBAs to COMPARE Servers, Databases, Tables etc., SCRIPT and SYNCRONIZE Tables, Views, Stored Procedures, UDFs etc. It also provides for identifying and displaying object dependencies and allows scripting of all the objects in the dependency tree etc. You may download the Beta version of the product from www.x-sql.com Your comments and suggestions on how to make...
1
1800
by: Evgeny Gopengauz | last post by:
Hello all! My question is: how to compare two database structures if I only have their DDL files? As the result I would expect an sql-script upgrating one database structure to another. The most 3rd-party tools I tested require connection to both databases. *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it!
3
2305
by: Shock | last post by:
Hey all, I am currently researching ways to compare databases via an XSD schema. I wrote a small app that creates a dataset from a database and exports that dataset to XSD. This gives me an XSD file with tables and relationships representing the entire database. At this point, I am trying to find ways to compare these schemas. Does anybody know of a way to do this easily and to record differences if there are any?
3
2071
by: Stephen | last post by:
I have to write a .Net application which can compare SQL Databases including things like: - DB structure, PK's, FK's, indexes and types of indexes i.e. should be able to detect if the same index has cascade set on one db and not on another, or unique on one and not the other, Constraints, Triggers, Stored procs, Users, Roles. I downloaded the SQL Data Compare 3.0 application 14 day trial and it seemed really good however does a bit more...
8
7130
by: Vincent | last post by:
has any one seen a program to compare mdbs'. I have ran into a few of them, but none seem to really do that job. Basically what I need to do is, take 2 access mdb's and check the differences between the 2. i am talking about tables, forms, queries, the whole ball of wax. Most of the programs jus do tables, that is the easy part. Also I was wondering how you would compate text fiels progammatically and kick back a report using...
1
1838
by: Stephen | last post by:
I am trying to compare the tables in two similar databases using the SQLDMO object. I am able to use this object to access different SQL servers and choose two different databases. The versions of the databases are slightly different so I would like to be able to compare them for things like datatypes, primary and foreign keys, number of records etc. I know that there are packages out there that do this kind of thing but I have to...
6
2879
by: Andy | last post by:
Someone posted this official proposal to create comp.databases.postgresql.general again. He wrote his own charter. As far as I know, he did not consult any of the postgresql groups first. There may be an upcoming vote on this, so please stay informed and read news.newgroups.announce for updates. Also see message <2uu44nF2eodc0U1@uni-berlin.de> for an example of the proponent's temperament.
5
15398
by: linuxlover992000 | last post by:
I am a newbie in the world of MySQL. In fact I enabled it in my Linux box only because it is required to run WordPress (the blogging software). I was trying to plan ahead and figure out a way to backup (and restore) a database, should my Linux machine ever goes belly up. I disovered that the databases are stored in subdirectories under /var/lib/mysql. My questions are basically three: (1) Why /var/lib? Why not some /home/mysql or...
3
3699
by: byrocat | last post by:
Up until now, I've been working with V& DB2 UDB databases, using Embarcadero DBArtisan as my GUI tool. I also have other tools that I use in my day-to-day job so running directly on the server via the CLP is not a viable option. I've just had a number of V8 DB2 UDB databases added to my task list. Of course #1, the old V7 DB2 ODBC client software doesn't connect to V7 databases.
0
8432
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8343
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8856
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8762
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8545
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8633
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
4347
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2762
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1992
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.