Check If A Remote Server Is Online/available Before Executing A Series Of Sql Statements

Sep 30, 2007

Hi,

We have unreliable circuits connecting our office to remote sql servers. At our office I need to delete/insert a bunch of records from those remote locations. Since the connection is unreliable what is the best way to check if a server is available before executing delete/insert statements. A few points to consider:

1. I want this to be done in SQL
2. I have a cursor that cycles through a tabe that contains the name of the linked servers. The cursure is used to delete/insert a bunch of records from each remote server.
3. If one server is unavailable the stored proc should continue to the next sql server (next record in the cursor.)


Thanks,
Bradley

View 3 Replies


ADVERTISEMENT

Is There An Online Remote SQL Server I Can Test Against?

Jun 5, 2006

HiI am trying to connect an application to a remote sql server database, however it does not appear to eb configured for remote connections. Does anyone know a connection string of a database I can connect to , soem sort of learnsers database sort of idea ?Thank you.

View 1 Replies View Related

Export Table Data Into A Series Of Insert Statements (or Alternative)

Jan 29, 2008

Hi all,

I have a table which I would like to export to a series of insert statements (in a file maybe). Is this possible somehow?

Alternatively, I could use an existing xml document which contains table metadata (table name, column names,types etc) to transfer data from these particular columns to another database replica.

Thanks,
Yannis

View 10 Replies View Related

Code To Check If DB Is Online

Apr 4, 2008

I want to check whether or not a DB is online when a report is run. If it is offline I would like to display a friendly message.

Currently my users get error messages when they run a report against a database that is offline. They get incomplete reports if they run a report while the database is being restored.

How can I detect the state of the database and display the appropriate friendly message? Is there a property to check or an event where I should write some code?

I look forward to your response.

View 2 Replies View Related

Recovery :: Server Cluster Resource Fails To Come Online And Pending Online State

Nov 3, 2015

We have SQL cluster installed on top of windows cluster on VM environment. Node1 and Node2 under Windows Failover Cluster. SQL instance is currently on node2 the instance is up and running, but SQL Cluster service remains online pending and it restarts the instance on every 5 minutes.

SQL Browser service are running successfully.TCP/IP ports are enabled and configured.If we start the SQL server agent it is on for seconds and stopped immediately  .Cluster Service is attempt to connect to the SQL service every few minutes (setting in SQL cluster resource) for the IsAlive check, if this fails then the SQL resource is restarted even if the instance was online. Hope this is what happening exactly.

[sqsrvres] ODBC Error: [08001] [Microsoft][SQL Server Native Client 11.0]SQL Server Network Interfaces: Error Locating Server/Instance Specified [xFFFFFFFF].  (268435455)
00001024.00053314::2015/10/30-19:57:50.772 ERR   [RES] SQL Server <SQL Server (SIMAH_COMMDB)>: [sqsrvres] ODBC Error: [HYT00] [Microsoft][SQL Server Native Client 11.0]Login timeout expired (0)
00001024.00053314::2015/10/30-19:57:50.772 ERR   [RES] SQL Server <SQL Server (SIMAH_COMMDB)>: [sqsrvres] ODBC Error: [08001] [Microsoft][SQL Server

Native Client 11.0]A network-related or instance-specific error has occurred while establishing a connection to SQL Server. Server is not found or not accessible. Check if instance name is correct and if SQL Server is configured to allow remote connections. For more information see SQL Server Books

Online. (268435455)
00001024.00053314::2015/10/30-19:57:50.772 INFO  [RES] SQL Server <SQL Server (SIMAH_COMMDB)>: [sqsrvres] Could not connect to SQL Server (rc -1

View 5 Replies View Related

Remote Online Backups

Mar 20, 2008

We have about 40 locations worldwide, with a typical data size of about 200 GB per location, with some up to 2 TB. Most sites have 1024 to 1536 Kb/s MPLS links, with a few 2 Mb/s and one 4.5 Mb/s. Central data center has two 45 Mb/s links.

We are looking to remote, online backups to our data center from each location. I'm wondering which products and processes have worked.

Has anybody successfully implemented remote, online backups of Windows servers across their WAN to a central data center?

View 2 Replies View Related

Integration Services :: Executing BAT File On Remote Server And Scheduling It

Jun 24, 2015

I have to execute a .bat file on a remote server (that is used to stop and start services of an appl). The remote server doesn't have SSIS,SSMS installed. I want to create a package on my desktop the uses Execute process task and execute the .bat file on the remote server and then schedule it using the SSMS.

View 14 Replies View Related

Executing Sql Statements

Jul 23, 2005

When i execute the following in Sql query anlyzerDeclare @dbname varchar(30),@str varchar(500),@emailID varchar(50)set @EmailID='santosh@yahoo.com'set @dbname='DB_kms_prv'set @str='SELECT empid, NTName, officialEmail, PreferredName FROM ' +@dbname + '.dbo.tblEmployee where officialEmail=' + @emailIDexec (@str)I get error messageThe column prefix 'santosh@yahoo' does not match with a table name oralias name used in the query.How to get rid of it..?

View 1 Replies View Related

Executing SQL Statements Through Variables

Sep 23, 2002

Hi,

I try to run sql statement by placing them in a variable as given below but receive the following error message

set @sql_string= 'BACKUP DATABASE '+ @temp_db+' TO '+ @bk_device+' WITH FORMAT,INIT, NAME = '''+ @bk_name+''''
EXECUTE IMMEDIATE @sql_string


Error Message

Server: Msg 2812, Level 16, State 62, Line 10
Could not find stored procedure 'IMMEDIATE'.
Server: Msg 2812, Level 16, State 62, Line 18
Could not find stored procedure 'BACKUP DATABASE DTSTEST TO bk_dev1 WITH FORMAT,INIT, NAME = 'Full backup''.


Thanks
John Jayaseelan

View 2 Replies View Related

Executing Large SQL Statements

Apr 15, 2004

Hello,

I am trying to import a very large amount of data into an SQL database. The data is in a format of SQL statements already - it is all in one large text file consisting of a number of CREATE TABLE X and INSERT INTO X VALUES().

The problem is that the amount of values being inserted into some of the tables is so large, that I am unable to open the .SQL file using query analyzer to run it, because the line-size limit for query analyzer is 64kb, whereas actual line-size in the file is in some cases in excess of 15MB.

I would appreciate any advice on how to get all this data into a managable format. I keep thinking that there simply has to be a way to execute these over-size SQL statements.

Thank you in advance!

-Sergey

View 1 Replies View Related

Executing SQL Statements In Another Database

Apr 9, 2008

I have a stored procedure named usp_CreateSomeAdminObjects that resides in say a database named AdminStuff (ok, fictional but it gets the point across :) ). This proc generates a series of dynamic SQL statements (DROP TRIGGER, CREATE TRIGGER and EXECUTE sp_settriggerorder) against tables that reside in different databases. However I am unable to change the context of the database from AdminStuff to the database I am cycling. Any suggestions on how I can have execute this dynamic SQL in the context of a specific database (other than the one the proc resides in)?

I can not put the USE statement in a stored procedure. Attempts to use sp_executesql, EXECUTE and even run the script through sqlcmd using either (a) the -d option or (b) a USE <dbname>; statement as part of the -q parameter have all been unsuccessful.

Heck, even if I execute this code through SSMS it does not work as I need it to:

USE OtherDatabaseName;
EXEC DBA.dbo.usp_CreateSomeAdminObjects

I confirmed this by adding these statements to the proc:

/* Gets list of tables from the current database */
SELECT name, create_date FROM sys.objects WHERE type = 'U' ORDER BY name

SELECT DB_NAME();

These statements return a list of user tables that reside in AdminStuff and not OtherDatabaseName (the same goes for the DB_NAME() statement.

Any suggestions on how I can accomplish what I'm looking to do - have this proc execute dynamically generated DDL scripts for tables that reside in a different database. I'd rather not name this procedure sp_CreateSomeAdminObjects and compile it in the master database. If that is my only option I will but figured I'd check out other options first.

View 10 Replies View Related

How To Check Using If SQL Server Is Running On A Remote Computer

Jan 21, 2004

I am about designing an access project file that connect to a SQL Server database : it could be either on the local computer or a remote workstation, this depending on where the front end is running.

Bypassing the default log on dialog box i have set my own form that users should use to connect on adp. Then using baseconnection string i connect the adp to sql server database.

My concern is how can i check from vba if the instance of SQL Server where my back end database is located is running in order to make
users knowing that due sql server service status off their connection
tentative will fail.

inform u i can check same from console management however i would to automate same controle from my adp and avoid that users have to operate such task...

View 4 Replies View Related

How To Automatically Replicate Remote Database Which Is Not Permanently Online

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

Executing Statements W/o Explicit Transaction

May 30, 2008

Hi

What is SQL Server 2005 default behavior with statement like this:


SELECT * FROM dbo.Products

Will it take any shared locks on Products table? Is it different than:


BEGIN TRAN



SELECT * FROM dbo.Products WITH NOLOCK

COMMIT



TIA

View 2 Replies View Related

How To Check Whether An SSIS Package Is Executing

Aug 23, 2006

I have scheduled an SQL Job to run every 15 mins. This runs an SSIS package. But sometimes my package might execute for more than 15 mins. In this case, a second instance of the package would start. I don't want this to happen. So is there any way I can check whether the package is already running before I continue the execution of the same. Right now I am using a mutex to handle this problem. Are there any problems using the mutex and is there a better way to handle this?

Thanks in advance.

Sumesh

View 11 Replies View Related

Transact SQL :: Check For NULL In CASE / WHEN Statements?

Aug 5, 2015

I have a table that keeps track of all changes that were performed in an application. There is a column called "old value" and column called "new value". There are some values in the application that don't require data therefore the "old value" or "new value" values can be empty. These columns are an nvarchar data type because the value can be text or numbers or dates. An example is "ReceivedDate". There is a report that is generated based on this table.

What is happening is the query in the report dataset is adding dates when it should be displaying empty. They query is using "CASE/WHEN/THEN". What I need is "When the column is "RecievedDate" and it is not null then convert it to a date". This is for formatting purposes.

This is an example of the table:

UpdateColumn
Old Value
New Value
ReceivedDate
 7/8/2015 5:00:00 AM
ReceivedDate
7/8/2015 12:00:00 AM
7/9/2015 5:00:00 AM
ReceivedDate
7/9/2015 12:00:00 AM

So, the first time it was updated there was no value but it was replaced with July 8, 2015 and so on.This is what the report is displaying

This is the query:

CASE UpdateColumn
... WHEN 'ReceivedDate' THEN (replace(convert(varchar(11),CONVERT ( date, oldvalue ), 106), ' ', '-') )
...
I tried adding
CASE UpdateColumn
...
WHEN 'ReceivedDate' IS NOT NULL
THEN (replace(convert(varchar(11),CONVERT ( date, oldvalue ), 106), ' ', '-') )
...

But it did not like the "IS NOT NULL".

View 9 Replies View Related

How To Execute DBCC Statements Through Remote Stored Procedures

Jan 23, 2004

Hello,

Is it possible to execute DBCC statements remotely in destination servers through stored procedures existing in source server.

I don’t want to use isql, osql, openquery, openresultset because I have to pass user id or password.

I have linked the required SQL servers using Linked servers.

If so please give some example.

Thanks in Advance,
Sateesh

View 9 Replies View Related

Error On Executing SSIS Packages On A Remote Machine Using Code

Apr 10, 2007

Hello all,



I am trying to execute the ssis packages using code.These packages are hosted on remote server under MSDB in local Network.



Below is the code tried to Execute
--------------------------------------------------

DTSExecResult execRslt = _dtsxPackage.Execute();

foreach (DtsError dtserr in _dtsxPackage.Errors)
{
Console.WriteLine("Source: " + dtserr.Source + ", Description: " + dtserr.Description);
}


I get hte following Error
--------------------------------



"Dupaco Load MMAs"-------------"An OLE DB error has occurred. Error code: 0x80004005.
An OLE DB record is available. Source: "Microsoft OLE DB Provider for SQL Server" Hresult: 0x80004005 Description: "[DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access denied.".
"

"Data Flow Task" -------"The AcquireConnection method call to the connection manager "Dupaco" failed with error code 0xC0202009.
"

"Data Flow Task" ----------"component "OLE DB Destination" (119) failed validation and returned error code 0xC020801C.
"



"One or more component failed validation.
"



"There were errors during task validation.
"



When i try to execute the same code on the server where all the package are hosted. It is working fine.



More Info:

In thepackage we are using one "Source Flat file connection" and one "Oledb Destination connection"

Please help me to solve this problem, as my client needs it very badly


Thanks
Subin

View 9 Replies View Related

Stored Procedure Executing Durations Are Different Between Executing From Application(web) And SQl Server Management Studio - Qu

Jan 24, 2008



Hi,

I have a web application using Stored Procedure (SP). I see that there's a SP taking long time to execute. I try to capture it by Profiler Tool, and find out that with the same SP on the same db with the same parameter. The duration of executing by my web app is far bigger than the duration of executing on SQl server management studio - query window

Please see the image through this url http://kyxao.net/127/ExecutionProblem.png


Any ideas for this issue?

Thanks a lot

View 1 Replies View Related

Stored Procedure Executing Durations Are Different Between Executing From Application(web) And SQl Server Management Studio - Query Window

Jan 23, 2008

Hi,I have a web application using Stored Procedure (SP). I see that there's a SP taking long time to execute. I try to capture it by Profiler Tool, and find out that with the same SP on the same db with the same parameter. The duration of executing by my web app is far bigger than the duration of executing on SQl server management studio - query windowPlease see the image attached http://kyxao.net/127/ExecutionProblem.png Any ideas for this issue?Thanks a lot Jalijack 

View 2 Replies View Related

How To Check The Remote Shared Drive?

Nov 3, 2006

Hello, everyone:

I want to write a query to check a remote shared drive. The shared drive is mapped as T drive in my local. I run the statement,

EXEC master.. xp_cmdshell 'DIR C:'

It works. If I change to T drive like,

EXEC master.. xp_cmdshell 'DIR T:'

It dosen't work and returns,

"The system cannot find the path specified."

But I run DIR T: in DOS prompt, it works.

Any help will be great appreciated.

Thanks a lot.

ZYT

View 4 Replies View Related

Strange Problem With Time Series Data On Time Series Chart

May 31, 2007

Hi, all experts here,



Thank you very much for your kind attention.



I encountered a very strange problem again. Why the time series displayed on the chart are so strange? The Key time column I chose for my time series algorithm is cal_month(e.g 199001...), but why the date displayed on the time series chart is like :05/06/2448? (it should be like 199001..?) What is that data? And where exactly did it come from? What is the exact cause of this?



Hope it is clear for your help.

I am really confused on this and thanks a lot for your kind advices and help and I am looking forward to hearing from you shortly.



With best regards,



Yours sincerely,

View 1 Replies View Related

Register Online Sql Server

Jul 18, 2007

Hi, here is my problem



I am trying to conncet to an SQL Server that is on the net. The name of the server looks like : sqlServer.TheCompanyOwingIt.Com and it listens to port 2433

I am opening enterprise manager and trying to connect ,giving the name of the server and the credentials but no luck. I also tried opening hte client Network utility , created an alias for that server, specifying 2433 as the port but no luck again. Finally i tried to change the port of my sql server to be 2433 (instead of 1433), no luck again !!! Any ideas ? (there is no firewall running on the PC, but there is a router which might (?) cause the problem ? (i tried to port forward 2433 , but i am not sure if i did it correctly).



Any ideas, suggestions will be greatly appreciated

Thx in advance

Theodore

View 5 Replies View Related

SQL Server 2012 :: Series Of Records - Identifying Discrepancies

Mar 17, 2014

I have a series of records based on empid where I want to identify the empid that may have discrepancies listed. I have some empids that are listed more than once and have different DOB's. In the example I am trying to Create a DOB_ERROR column and either say yes if the DOB doesn't match the other records in the file with the same empid.

SELECT
Empid,
DOB,
CASE WHEN DOB = DOB THEN 'No' ELSE 'Yes' END AS DOB_ERROR,
City,
St,
Gender
FROM Emp
WHERE EMPID IN

('12335', '23456', '545432','231245')

View 3 Replies View Related

Storing Time-series Data In SQL Server 2005

May 1, 2007

Hi all,

I'm wondering what is the best way to store time-series data in an SQL database?? I've done a bit of investigating on the rrdtool (round robin database tool) that is used in a lot of nix based solutions for monitoring network equipment. I have a need to collect performance data from servers and routers and then produces some nice graphs from that data. I'm just not sure who i should store that data without the database growing to some huge size.



Any suggestions?

View 1 Replies View Related

Moving A SQL Server 2005 Database From The Local Network To An Online Server.

Mar 7, 2006

Hi All, first post.

I have done a bit of searching around and cant find a clear answer to this question.

Current Setup
Desktop application (c#) that connects to a SQL Server 2005 express database on the same local network as the application (currently 3 users)

It is only a very small company and has just taken on their first remote worker, but expects to take on another 6-8 over the next few months. They have asked for the database to be moved online.

The application was written in such a way that everything has been done using no stored procs, or views, it is all native SQL.

This will be my first DB hosted online and before I go ahead and do anything I just wanted to make sure what I have to do is correct, sorry if this is a very basic question, although I have been programming for a long time, I have never had the chance to do any online databases before.

Will this work.
1.Find a SQL Server 2005 Hosting company.
2.Move the database to the server.
3.Setup the users permissions.
3.Alter the connection string in the application to point to the new location.

So the only thing that would change would be a new connection string in the application preferences?

Or am I living in a dream world, because nothing is ever that simple.

One thing I am worried about is the security/visiblity of the database and data as it travels from the server to the client and back.

Thanks for any advise you can give.

Mark

View 2 Replies View Related

Online Connection Between Access And SQL Server

Mar 23, 2007

Hello,I am trying to develop a database solution for an organisation inIndonesia.This organization has a number of offices and users throughout thecountry. They all need to maintain their own data, but I also need tocreate a central database, to store all of the data, and share databetween the individual users. The problem is that the internetconnections are not reliable, so a online solution isn't possible. Iam planning to implement stand alone databases in Access, which "sync"with the central server. This sync could happen automatically (maybedaily), or could be initiated by the user. This Sync would/could takeplace when the internet connection is working.I am very familiar with Access, but I suspect that I will need to useSQL Server for the central database. I have not used SQL Serverbefore, and have a few questions:Is it possible to host a SQL Server, so that it is "Online"? What do Ineed to do for this? Does this need to be hosted by an ISP, or couldit been hosted on a computer in our office? What are the securityconsiderations?Is it then possible to connect to this SQL Server from the Accessdatabases in the various locations to "Sync" the data? If I could runSQL statements from the stand alone databases which could access theonline SQL Server I could write the code for the Sync procedure. Thebit that I am unsure of is how to connect to the SQL Server?Could anyone point me in the right direction? Examples? References?What sort of technology to use?I know VB and how to write SQL statements, it's just the connectivitythat I am unsure of.Thanks in advance.CheersMichael

View 1 Replies View Related

SQL Server Express Books Online

Dec 1, 2007

are a mess, reminiscent of the structurless "goto" programming of days past. One of you brainiacs need to erect a "real" getting started section, with procedural steps on how a first time user can successfully download, install, and use SQL Server Express. Not all of us are working in corporations where the guy in the next cubicle can answer questions for newbies.

I will try once again, nicely, to ask a question about installing SQL Server Express Edition SP2 onto a Windows Vista machine. That drama will take place in another post.

View 1 Replies View Related

SQL Server T-SQL - Bring Database Online...?

Oct 11, 2006

Hi there, i would please like to know how to get a database online in T-SQL, I managed to get it offline in T-SQL, but know I can't get the database back online.

Please help.

If someone can please help me with the T-SQL command.

Or direct me to a link where I can get more information.

Thanks

View 5 Replies View Related

Online Get Data From MS Acces To SQL Server

Mar 28, 2008



Hi All,
I have MS Access 97 database and SQL Server 2005 Express Edition (or SQL Server 2005 Developer Edition).
I want online get data from MS Access and upload to SQL Server.

Help me, which way I select ?
Regards

View 3 Replies View Related

Remote Access Server Configuration Option And Remote Query Timeout?

Jun 2, 2015

- When I disable "allow remote connections to this server" from server properties>connection page, I can still remotely connect to the server from SSMS...so what is the impact of enable/disabling it?

- what is the impact of changing the remote query timeout (on the same page) from default value?

View 4 Replies View Related

SQL Server 2012 :: Find Missing Numbers In Continues Series

Dec 19, 2013

CategoryNos
A 1
A 2
A 3
A 5
A 6
A 9
A 10
B 23
B 24
B 25
B 27
B 28
B 29
B 31

Consider the above data...

I need following output... query ..

CategoryMin RangeMax Range
A 1 3
A 5 6
A 9 10
B 23 25
B 27 29
B 31 31

Logic Behind :

if any number is missing in the continues series the return the min and max of number in that range.

View 1 Replies View Related

SQL Server 2012 :: Adding A Number To A String To Create Series

Sep 3, 2014

add a number to the end of an ID to create a series.For example, I have an EventID that may have many sub events. If the EventID is 31206, and I want to have subEvents, I would like have the following sequence. In this case, lets say I have 4 sub Events so I want to check the EventID and then produce:

312061
312062
312063
312064

How can I check what the EventID is, then concatenate a sequence number by the EventID?

View 9 Replies View Related







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