Monday, March 19, 2012
Check for existence of server
of SQL Server is present? I already call a method to check for connection --
if no connection, I have the user re-enter server settings (server name and
database name). But the connection check is made by calling for a scalar
value in the database. What I'd rather do is graduate the error messages:
1. No server installed
2. Specified database name not installed
3. Specfied table or sproc not available
Any thoughts?Earl
1) if not exists (select * from sysservers where svrname ='blblb')
print 'Server does not exist'
2) if not exists (select * from sysdatabases where name ='blblb')
print Database does not exist'
3) if object_id('test') is null
print 'An object does not exist'
"Earl" <brikshoe@.newsgroups.nospam> wrote in message
news:%23obJi4vLHHA.1008@.TK2MSFTNGP06.phx.gbl...
> Is there any sort of check that can be done to see if a particular
> instance of SQL Server is present? I already call a method to check for
> connection -- if no connection, I have the user re-enter server settings
> (server name and database name). But the connection check is made by
> calling for a scalar value in the database. What I'd rather do is graduate
> the error messages:
> 1. No server installed
> 2. Specified database name not installed
> 3. Specfied table or sproc not available
> Any thoughts?
>|||Sure as shown on page 565, you can use the dbProviderFactories.GetFactory
method to return a list of (visible) servers based on a specific provider.
These same classes can be used to start, stop or pause the server service as
well (in addition to others).
hth
--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
INETA Speaker
www.betav.com/blog/billva
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
Visit www.hitchhikerguides.net to get more information on my latest book:
Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)
and Hitchhiker's Guide to SQL Server 2005 Compact Edition (EBook)
------
"Earl" <brikshoe@.newsgroups.nospam> wrote in message
news:%23obJi4vLHHA.1008@.TK2MSFTNGP06.phx.gbl...
> Is there any sort of check that can be done to see if a particular
> instance of SQL Server is present? I already call a method to check for
> connection -- if no connection, I have the user re-enter server settings
> (server name and database name). But the connection check is made by
> calling for a scalar value in the database. What I'd rather do is graduate
> the error messages:
> 1. No server installed
> 2. Specified database name not installed
> 3. Specfied table or sproc not available
> Any thoughts?
>
Check for existence of server
of SQL Server is present? I already call a method to check for connection --
if no connection, I have the user re-enter server settings (server name and
database name). But the connection check is made by calling for a scalar
value in the database. What I'd rather do is graduate the error messages:
1. No server installed
2. Specified database name not installed
3. Specfied table or sproc not available
Any thoughts?Earl
1) if not exists (select * from sysservers where svrname ='blblb')
print 'Server does not exist'
2) if not exists (select * from sysdatabases where name ='blblb')
print Database does not exist'
3) if object_id('test') is null
print 'An object does not exist'
"Earl" <brikshoe@.newsgroups.nospam> wrote in message
news:%23obJi4vLHHA.1008@.TK2MSFTNGP06.phx.gbl...
> Is there any sort of check that can be done to see if a particular
> instance of SQL Server is present? I already call a method to check for
> connection -- if no connection, I have the user re-enter server settings
> (server name and database name). But the connection check is made by
> calling for a scalar value in the database. What I'd rather do is graduate
> the error messages:
> 1. No server installed
> 2. Specified database name not installed
> 3. Specfied table or sproc not available
> Any thoughts?
>|||Hi Earl
"Earl" wrote:
> Is there any sort of check that can be done to see if a particular instanc
e
> of SQL Server is present? I already call a method to check for connection
--
> if no connection, I have the user re-enter server settings (server name an
d
> database name). But the connection check is made by calling for a scalar
> value in the database. What I'd rather do is graduate the error messages:
> 1. No server installed
> 2. Specified database name not installed
> 3. Specfied table or sproc not available
> Any thoughts?
>
It sounds like you are not handling any errors that are given when you try
and connect to the server. You may want to look at:
http://msdn2.microsoft.com/en-us/library/ms677489.aspx
John|||Sure as shown on page 565, you can use the dbProviderFactories.GetFactory
method to return a list of (visible) servers based on a specific provider.
These same classes can be used to start, stop or pause the server service as
well (in addition to others).
hth
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
INETA Speaker
www.betav.com/blog/billva
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
Visit www.hitchhikerguides.net to get more information on my latest book:
Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)
and Hitchhiker's Guide to SQL Server 2005 Compact Edition (EBook)
----
---
"Earl" <brikshoe@.newsgroups.nospam> wrote in message
news:%23obJi4vLHHA.1008@.TK2MSFTNGP06.phx.gbl...
> Is there any sort of check that can be done to see if a particular
> instance of SQL Server is present? I already call a method to check for
> connection -- if no connection, I have the user re-enter server settings
> (server name and database name). But the connection check is made by
> calling for a scalar value in the database. What I'd rather do is graduate
> the error messages:
> 1. No server installed
> 2. Specified database name not installed
> 3. Specfied table or sproc not available
> Any thoughts?
>
Thursday, March 8, 2012
Check connectivity Sql Server
Hello all, I am hoping this is the correct place for this. I have an application that depends on an active connection to Sql Server Express 2005. I am looking for a way is any to check for the existance ofthe server I defined and wether it is online or not. I know I can just catch the error on connection but it takes a bit and I have customers trying to cancel it before it's finished because they think it's locked up. I would like a quick way to check without trying to create a connection if it's online, then if it is, proceed, if not, let the customer know. I was hoping for something like a database server ping of sorts.
Thank you,
Jim
Still, the best/reliable way to check whether you can reach the server instance is connect to it. If you think the lock up time is too long considering that the server is down, you can adjust the connection timeout to be smaller than on-default value. There is caveat to this approach if your target machine is unreachable in the network, which may cause a single physical operation, tcp connection to take long time to finish.
Another way on top of my head is to check service manager of your targeted machine using console commmand "SC" and check the server status, an example is the following. The
>sc \\servername query mssqlserver
SERVICE_NAME: mssqlserver
TYPE : 10 WIN32_OWN_PROCESS
STATE : 4 RUNNING
(STOPPABLE, PAUSABLE, ACCEPTS_SHUTDOWN)
WIN32_EXIT_CODE : 0 (0x0)
SERVICE_EXIT_CODE : 0 (0x0)
CHECKPOINT : 0x0
WAIT_HINT : 0x0
-HTH
Check Connection Exist
During/Before runtime, I have deleted the file.
Is there any way for me to detect if the connection exists or not, and if the connection does not exist, skip a particular data flow process?Hi there,
You have a couple of options:
1. Use a script task to call out to System.IO.File.Exists to confirm the file exists. This will mean you'll have to get the file name from the connection string or use a variable that the connection manager's connection string uses itself.
2. Use a script task to call AcquireConnection on the connection to see if that succeeds.
Either way, put the result of the check into a variable and use that variable as a condition on the precedence constraint that goes from the script task to the data flow task.
Regards,
ash
Friday, February 10, 2012
channel for SSL/TLS ????
"The underlying connection was closed: Could not establish secure channel
for SSL/TLS."
any idea'?when ?
when they open a report?
or when they try to access the web server http://server/reports?
Does your reportserver is protected by a firewall?
does the user can access the http://server/reportserver web site?
"Soan" <Soan@.discussions.microsoft.com> wrote in message
news:00C1B137-5CA9-4FD3-B6AA-86E464145CA8@.microsoft.com...
> My users are getting the following error
> "The underlying connection was closed: Could not establish secure channel
> for SSL/TLS."
>
> any idea'?|||Just a guess, but something is probably out of sync in one of your *.config
files. Either an SSL setting or report server name. Check them out under
the MSRS install folders.
--
Cheers,
'(' Jeff A. Stucker
\
Business Intelligence
www.criadvantage.com
---
"Jéjé" <willgart_A_@.hotmail_A_.com> wrote in message
news:OAEFqys5EHA.3416@.TK2MSFTNGP09.phx.gbl...
> when ?
> when they open a report?
> or when they try to access the web server http://server/reports?
> Does your reportserver is protected by a firewall?
> does the user can access the http://server/reportserver web site?
> "Soan" <Soan@.discussions.microsoft.com> wrote in message
> news:00C1B137-5CA9-4FD3-B6AA-86E464145CA8@.microsoft.com...
>> My users are getting the following error
>> "The underlying connection was closed: Could not establish secure channel
>> for SSL/TLS."
>>
>> any idea'?
>