SQL 2012 :: Automatically Syncing Database To Different Server?
Jul 25, 2014
We have two SQL 2012 servers, sever A and B.
We need to sync a database on A so that there is a copy of it on B.
We need to be able to query both databases so mirroring isn't an option.
View 7 Replies
ADVERTISEMENT
Oct 14, 2015
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?
View 6 Replies
View Related
Apr 3, 2015
Our auditors are trying to enforce a requirement that all users be disconnected from any application or database after 15 minutes of inactivity. Is there any way to force a logoff within SQL Server? For example, someone is in Management Studio connected to a database. They should be logged off after 15 minutes of no activity.
View 1 Replies
View Related
Jul 20, 2005
We have a database on our central servers that is the backend to a webapplication we have in ColdFusion. About 4 times a year, we have a userthat goes out to other locations without internet access that would needaccess to this application. Once she comes back to the office, we wouldlike to update any changes she has made to the central server database.What is the best course of action to do this?To start, we thought we would install msde on the laptop, along with asingle user version of ColdFusion and IIS so she could run the application.How would we get that new data from her laptop to our main database?Thanks for any input.
View 1 Replies
View Related
Oct 28, 2013
automatically replicates new databases to Availability Group partners - if you do a little prep work on your environment first.To make it work:
1) Create linked servers on all group members pointing to all other servers in the group, with names matching the hostnames they represent.
2) Ensure suitable credentials (or 'current context' impersonation) for linked servers. Also: Enable RPC and RPC OUT
3) Run the DDL code below.
4) Schedule hadr_replicate_queue on [master] to run as often as you want initial syncs to occur. Every 5-10 minutes is plenty for most purposes.
5) Connect to an availability group listener and call CREATE DATABASE :)
I use a slightly more extended version of this code at home to do things like permissions synchronization across replicas - I essentially allow applications to install direct to an availability group replica and then have all the relevant objects replicate to other nodes. I don't really like going through manually and doing things, even though there's an AddIn from SQLSkills for management studio - it still requires manual intervention.
The main use I have for this at home is that I'm using the Azure pack, and want to automatically ensure that my newly created 'SQL Server Cloud' databases are highly available, plus it means when I install a non-alwayson aware product it doesn't require any extra work afterwards to allow failover to another machine.
* AlwaysOn Self-Population Script
* By: Steve Gray / steve@mostlyharmful.net
* Usage: Free, but buy me a beer if you're ever in Brisbane.
**/
USE [master]
GO
IF EXISTS (SELECT * FROM sys.tables WHERE name='hadr_pending_replicate')
[code]....
View 4 Replies
View Related
Jul 1, 2015
I have a client data which has the candidate id, a start date which will have only the date in varchar format and a time value associated to that date in varchar format in a seperate column.
To give a brief explanation about the data a candidate will come to study center at any time point in a day for example 10:00 AM on 20-10-2014. The start date will be 20-10-2014 and from 10:00 AM he will have test based on the time point. So if the time point is 2 HR, then at 12:00 PM he will have a test. If the time point is 8 HR, it will get added with 10:00 AM and based on this he will have the test at 06:00 PM. When the timepoint reaches 00:00 the start date needs to be the next date instead of 20-10-2014.
The start date needs to be appended with the time value such that when it crosses over the time 00:00, the start date needs to get increased by 1 ie the next day. I have added the start date to the time by using the code below
CAST(STARTDATE as datetime) + CAST(CAST(STUFF([TIME],3,0,':') as time(0)) as datetime) as [EXPECTEDDATETIME]
By this above code i have created the expected datetime however
I will not be able to hardcode the value due to dynamic data. I tried to apply >= and < to the time value something like
case when MyTime >= '00:00' and MyTime < '08:10' the Dateadd(day, 1, date)
This works perfect but my concern is that I cannot put the value 08:10 because it will not a constant value for all rows.
I have provided a screenshot of my data and a expected date column for reference.
Candidate StartDateStartTimeExpected DateTime Timepoint
1 20141020 1000 2014-10-20 10:00:00 0 HR
1 201410201200 2014-10-20 12:00:00 02 HR
1 201410201400 2014-10-20 14:00:00 04 HR
1 201410201800 2014-10-20 18:00:00 08 HR
1 201410200000 2014-10-21 00:00:00 12 HR
1 201410201200 2014-10-21 12:00:00 24 HR
2 20141020 1100 2014-10-20 11:00:00 0 HR
[Code] ....
I have also attached the data for reference.
View 9 Replies
View Related
Sep 22, 2005
Is it possible to merge/sync 2 "part time connected" Sql Server databases? I basically want to keep one of my in office databases synced with a database on my hosting provider. (Said hosting provider does not offer SQL Server's built in Merge Replication) Can anyone recommend a 3rd party application that does this if one exists?
View 1 Replies
View Related
Mar 13, 2007
I been asked recently in the interview thatHow can I detect changes automatically in the SQL Server Database when anything is updated, deleted or inserted?if anyone can help me in this that will be really great.
I dont actually know whether I can ask this here but I wanted to know the answer for this and thought this might be right place to ask?
sorry if I am wrong?
Thanks in Advance
View 2 Replies
View Related
Jul 29, 2015
our clients have the flexibility to detach and attach databases (I know there are a lot of considerations around this but there is now way of changing it), once they attach a database we need to run some code to update a bunch of values in the database.
Other than creating a SQL Agent job are there any other options available to automatically execute a script once the database has been attached?
View 1 Replies
View Related
Mar 3, 2008
I come cross some post about how to backup a database in Sql Server Management Studio Express automatically. The scripts look like as below
USE [master]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[sp_BackupDatabase]
@databaseName sysname
AS
BEGIN
SET NOCOUNT ON;
DECLARE @sqlCommand NVARCHAR(1000)
DECLARE @dateTime NVARCHAR(20)
SELECT @dateTime = REPLACE(CONVERT(VARCHAR, GETDATE(),111),'/','') +
REPLACE(CONVERT(VARCHAR, GETDATE(),108),':','')
SET @sqlCommand = 'BACKUP DATABASE ' + @databaseName +
' TO DISK = ''C:Backup' + @databaseName + '_Full_' + @dateTime + '.BAK'''
EXECUTE sp_executesql @sqlCommand
END
It throws that the DDL statement is not allowed. What's wrong with it?
View 5 Replies
View Related
Jun 11, 2015
We have a production server "prod" which has a user say 'test' that lets the users connect to the application and a logon trigger which stops them from connecting to the server through SSMS. I log ship 'prod' to the 'rep' database and the user 'test' is obviously created in the logshipped database 'rep' during the logshipping.
Now the login 'test' does not have any login from server 'rep', But people can still login to the 'rep' server and query the 'rep' db . I checked with SUSER_SNAME and found the SID of the user in rep server which I never created and which is not even present in the login names, Even If I create a new username in the 'prod' db, after logshipping the new user is replicated in the 'rep' server.
View 9 Replies
View Related
Jun 10, 2014
How to create insert statements of the data from a table for top 'n' rows. I know we can create using generate scripts wizard, but we can't customize the number of rows. In my scenario i got a database with 10 tables where every table got millions of records, but the requirement is to sample out only top 10000 records from each table.
I am planning to generate table CREATE statements from GENERATE Scripts wizard and add this INSERT STATEMENT at the bottom.
EX : INSERT [dbo].[table] ([SERIALID], [BATCHID] VALUES (126751, '9100278GC4PM1', )
View 4 Replies
View Related
Jun 4, 2014
Disable logins on access expiry date(Not windows password expiry). we grant access to users on databases only for 60 days. So access is only valid for 60 days. Then the user should again request access to the database going thru security clearance. Thn the DBA's enable the login. Maintaining all these logins of users manually is causing more confusion.
As we know, we dont have any inbuilt functionality to automatically disable logins in SQL Server.
I have a table where the logins and expirydate were recorded in a DB.
Using this table and SQL Server agent. Can i achieve this process automated ?
CREATE TABLE [dbo].[LoginsExpiry](
[LoginName] [varchar](50) NULL,
[ExpiryDate] [date] NULL,
[Roles] [varchar](500)
) ON [PRIMARY]
GO
View 3 Replies
View Related
Jun 25, 2004
Hi ,
Does anyone how to sync data from one table to the exact same table on another server?PLease help
TY
Burner
View 6 Replies
View Related
Jun 25, 2004
I have 2 databases with corresponding history databases.
As the system is under development, the 2 databases are changing in structure i.e the table structure(new tables as well as changes to existing ones) and indexes will change every week.
What is the best solution to replicate the changes on the history database.
Regards,
Ashutosh
View 1 Replies
View Related
May 2, 2008
I'm restoring a production server onto a backup server. I have all the user databases restored, but trying to figure out how to transfer to logins to the backup server. any ideas?
View 2 Replies
View Related
Feb 5, 2008
I've got two very similar tables on seperate servers and databases. Both sqlserver. I am being told I cannot link the databases. I need to keep one table current with the other.
Is SSIS my best option?
At a high level, what should I do? What connect types?
View 6 Replies
View Related
Jul 15, 2015
I am setting up SQL audit on sql servers in my environment based on requirement. I want to create database specifications ASAP database created. I tried DDL trigger but Audit doesn't support triggers. So I created audit specifications on model database. the only problem with this is every specification created on new database with same name.database specification name includes newly created database name or other methods to create database specifications on newly created databases.
View 6 Replies
View Related
Jul 23, 2005
I have taken over a transactional replication setup that is being usedfor fault tolerance (I know, I know...).The scenario I am concerned with is where the publisher goes down due tofailure, so we need to point our application at the subscriber and startupdating the data there. We are not using the immediate updating option.How do I go about re-syncing the publisher with the data that been addedto, or changed on the subscriber, when the publisher comes back online?Thanks,TGru*** Sent via Developersdex http://www.developersdex.com ***Don't just participate in USENET...get rewarded for it!
View 1 Replies
View Related
Aug 30, 2001
Hai,
My database shutsdown automatically after 2 hours , when i start to run a jobs from a queue.
Can someone suggest me a way for monitoring it, so that i can find the possible causes.
Thanks
Balaji
View 1 Replies
View Related
Apr 10, 2000
Does anyone know at what point SQL Server 7.0 decides to grow the database when the autogrow option is set? Our site just went down for 45 minutes because the growing process was taking too long as compared to the data coming in, so the device filled up.
Ray? Craig? You guys seem to know all, so jobs.com appreciates your input...
View 7 Replies
View Related
Aug 30, 2001
when i start to run a jobs from a queue to the database, after 2 hours the database shutsdown automatically.
This problem is reproducable, Running a trace on it from profiler is what comes to my mind. Is there any other suggestion.....
Thanks
Balaji
View 1 Replies
View Related
Nov 25, 2006
When I create a setup program for my vb.net 1.0 app which has embedded sql express database, it successfully copies the database to the new machine alone with the upgraded app.
However, if I just copy the vb.exe app to the other pc and also copy the mdf, ldf files, I get an error opening the sql database.
I am presuming that the setup program does some kind of backup restore or detach, attach to copy in the .mdf.
If the user cannot do this from the management studio (or if they do not have the management studio installed), is there any way I can create some method to have this copying done automatically via some code by the user?
Thanks
SM Haig
View 1 Replies
View Related
Mar 7, 2007
For a GPS utility project we are planning on extracting certain attributes from a huge "GPS Raw Data" read only database which we have access to containing GPS data from several years from several devices attached to vehicles.The data is time stamped. Where the time gap between pieces of data is more than 10 minutes, a new trip is instance is assumed and in our write access "Trip" database we create a new instance for the data clump with a new trip id along with the time range of the data. The process is to be run hourly to update the "Trip" database with new trips and append to overlapping trips. We've some questions:a) Is it easy to read from one database and write into another in c# hourlyb) How would one go about running a C# program automatically every hour on the server?c) Is there a better way to do this than an hourly update? (dynamically perhaps??)d) When querying the database and comparing the time stamps, how for instance would we go about identifying a 10 minute gap when the time/date is in the format "22/12/2007 11:25:00". I can't get my head around actually writing this - it's probably ridiculously simple
View 7 Replies
View Related
Nov 1, 2000
Hi ALL
I have question about database automatically growing for SQL Server 7. It seems to me that SQL database automatically grow will ONLY happen when it's getting really full, maybe above 90% full. Even if you manually increase the DB size, actually the increased DB size will only keep very short time. And DB size will be back to the smaller size again. If you have any suggestions I will be really appreciated. Thanks
View 2 Replies
View Related
Mar 10, 2008
I have a database that I have made with Sql Server 2005 Express. I am building a windows app using this db as the back end. I am using visual C# Express as well.
I found out during this project that I had to detach my database in order to establish a new connection to it using the express editions. I learned that this is a short coming of the Sql Server 2005 Express Edition. So I detached my db. When I reattached my database the name had the path to where the file was in it's name. I don't think I have done anything to cause this. But, obviously something went wrong.I have a jpeg screenshot of this but can't post it in this forum.
I created another small database as a test to see if the same thing would happen again. The database only has one table with two columns. I detached and then reattached it with no problems. It did not get the weird file name that automatically included the path to the file.
Does any one know what is going on with this? Do you know how I can reattach this database and only have the original name(not the path to the file)?
Thanks
View 5 Replies
View Related
Dec 26, 2007
Hi,
i've sql 2005 std sp2,and i'm working with a program that create every view month's a new database automatically.
my question is - how can i make a full backup of the newly created database automatically only one time when it's created?
Thx
View 16 Replies
View Related
Feb 28, 2008
Hello!
I have created my self a person website in VS2008 using Linq and ahev downloaded a copy of sql express to use as my database when working on it at home.
I have just noticed, now I am trying to upload it to a server that my sql express is automatically creating the database in my app_data folder, this is causing me problems, as I don't want it to do this. I want it to be able to point it at a full version of SQL server.
Is there some setting I have missed? Of how can I stop tis automatic creation of the database?
Thanks
Bex
View 1 Replies
View Related
Sep 3, 2002
Hi guys,
I need to update one table in database A based on the other database B, which is on a romote server. The requirement is to update it automatically at 12:00 in the mid-night everyday. Database A is MS SQL Server 7, and database B is Oracle database.
What's the best to implement it? I thinking to use trigger, am I right?
Thanks in advance for any advice.
Henry
View 1 Replies
View Related
Feb 28, 2006
hi e'body:
I have some database tables, and each one of them have a creation_date and modified_date in them. I was trying to figure out a way where when a row in one of these tables is changed using Enterprise Manager (Database -> Tables -> select table -> right click -> select all rows -> change a field in a row inside a table), is there a way apart from triggers, such that the "modified_date" column for that row get changed to 'getdate()' (rather picks up the current datetime).
thanks in advance.
View 1 Replies
View Related
Jul 23, 2005
Dear group,I have to replicate remote data to a SQL Server in the headquarter.The data are on a site which does not have permanent online-connectionto the headquarter.I have written a script which replicates the data and i want to set upa process / batch on the headquarter-machine which roughly does thefollowing1) Connect to the remote site2) start replication script (in fact a stored procedure)3) on success disconnect from the remote siteAll this has to run automatically e.g. during nighttime.Could someone please outline how i set up the connection and keep itup during my database-action and how to automatically disconnect aftersuccess of my replication script.I'd be jolly grateful.Thanks in advance and Greetings from ViennaUli
View 1 Replies
View Related
Aug 5, 2015
I need to deploy the trigger in database whenever new DB is creating on the server.
View 6 Replies
View Related
May 12, 2007
Hi frdz, I m creating my web-application in asp.net with C# 2005 and using sql server 2005. I have created the stored procedure for the insert,update. I want to know how to write the mathematical calculations in the stored procedure.. Pls tell me from the below stored procedure were i m making the mistake ?? As the discount and the total amount are not calculated by itself....and stored in the database How to convert the @discpercent numeric(5,2) to@discpercent ="NoDiscount" should be displayed when no discount is being given to the customers.... ALTER PROCEDURE CalculationStoredProcedure
@accountid int output,
@accountname varchar(20),
@opbal numeric(10, 2),
@opbalcode char(2),
@total numeric(10, 2),
@clbal numeric(10, 2),
@clbalcode char(2),
@discpercent numeric(5,2),
@discamt numeric(10, 2)
as
begin
set nocount on
if @opbal IS NULL OR @opbal = 0
begin
select @opbal=0
select @opbalcode= ' '
select @clbal= 0
select @total= 0
select @clbalcode= ' '
@discpercent ="NoDiscount"
@discamt=0
end
select @accountid = isnull(max(accountid),0) + 1 from accountmaster
select @total=@opbal - @clbal from accountmaster
select @discamt=@total* @discpercent/100 from accountmaster
begin
insert into accountmaster
(
accountname,opbal,opbalcode,clbal,clbalcode
)
values
(
@accountname,@opbal,@opbalcode,@clbal,@clbalcode
)
end
set nocount off
end
Thanxs in adv...
View 7 Replies
View Related