how can communicate two SQL database in LAN to save data in both database - sql

We have a server with SQL database (8 database) working in LAN, Now we are planning to make a backup server connected through LAN.
What we need is, when user enter data it should save in both database, so that we have all the data in both database.
I am a newbie so pls give me some detail information. I have seen some replication option, is it better option for us.
We have SQL Server 2005.

Which database engine are you using?
There're several ways to build a distributed/replicated database, I'm sure you'll find out how to do it by reading your engine documentation, but we cannot help here without more info.

Yes, you can backup your database from one server to other by multiple way.. Following are those
1) Make script of complete database with schema and data..Technique is here
2) Export your database to excel file and import it to other server (Use only in required conditions).
3) communicate two server by addlink.. Technique here
Now if you want dump data in two different server then its depend on code logic written for dumping database and connection string provided for it. By adding Trigger to one server database you can dump data on different server or database.. Trigger

Related

Exporting SQL data from server

I was working on a data modeling project. The client has an SQL database running on an active server but as an advancement and version updates, they need to use the Mongo database for effective data processing.
The client shared structured SQL data files (filename format: dump_.sql) over SSH connectivity. This SQL data should be populated on MongoDB. Please suggest the best steps to solve this.
Thank you.

Identify relationships between multiple databases in SQL

I am working on migrating an application from one server to the other. According to the connection string of this application, it is touching different databases. Meaning a view query in DB1 will touch a table in DB2. So while migrating this application, I constant get to see chain of 'Database unavailable' errors and every time I see such error, I have to migrate that specific database.
I am wondering, since we have ER diagrams to know about relationships between tables in a database, is there any way in SQL server to know the relationships/linkages between different DATABASES in a server? Are there any tool that does this?
Depending on number of databases you have, here would be a somehow quick way you can find that out (number of required search = number of available databases in the server):
Use 'SQL Search' application of Red-get
(https://www.red-gate.com/dynamic/products/sql-development/sql-search/download)
and search for the other database names one after another by selecting
your database of interest. Select all objects.
If you have metadata oriented design (a Stored Procedure looping through the names of different other Stored Procedures / Functions from different databases which are stored in a table as metadata and executing them with a wrapper Stored Procesure), then you will have make use of SQL Locator software (http://www.sqllocator.com/Downloads.html) to search for database names in SQL Table values.
Both of the above software are free.
You need to have SSMS (SQL Server Management Studio) installed to be able to use this application. After installation, ‘SQL Search’ will be directly available in your SSMS as an add-on.
SQL Locator can be directly used by providing the SQL Server name and your SQL Server credential.
Note:- The above steps will help you find out the referenced databases from a certain database within the same SQL Server. If you need to find out databases from Linked Server (I do not believe your question is asking that anyways), then you will have to smartly utilize the same above tools to find the external server reference by searching the external server name.

Transferring data from one server to another without linking servers

I want to write a stored procedure that will query a server that I only have read access to.
Is this possible using SQL? If so, how?
The answers from Insert Data From One Server To Another? and Export table data from one SQL Server to another seem to only be helpful if I had more permissions in the source server. If I am mistaken, please correct me.

How to transfer local database table's data to remote database tables using vb.net with SQL Server

I have a local SQL Server database with many tables. I need to transfer data to a remote SQL Server database using vb.net, and task should be run every 2 hr from application. How is it possible to do this? Please suggest the best way for this.
I think the better way is replication. i don't know the possibilities in SQL Server but it works great in mysql. if you enables the replication in two database(Master- Slave) what ever be the changes you have made in the master will simultaneously in the slave. there is possibilities for Bi-Directional Replication in MySQL.
SQL Server provides various types of replication to extend the possibilities. this article helps you to establish replication in Sql Server

SQL synchronize database between local and remote server

I've got 2 companies in different locations and the main server is at my office. The main server is working with a full version of SQL Server where the companies use SQL Server express version.
What is the best way to synchronize these SQL Server databases together that the main server have always the latest updates?
There are several technologies specifically for this type of scenario:
SQL Replication
Supports unidirectional or bidirectional synchronization
SSIS
Lets you define the mappings of the data, as well as transformations, and attach other code to the process easily
Linked-servers
Allows you to query databases and tables on remote servers as though they are part of the local database. Very easy to setup (just call exec sp_addlinkedserver) and once defined uses nothing but plain old SQL
If you want to do in an event (like button click), I would suggest Linked Server. Click here for a simple tutorial about how to create a linked server. After creating linked server, we can query it as follows:
select * from LinkedServerName.DatabaseName.SchemaName.TableName