Showing posts with label determine. Show all posts
Showing posts with label determine. Show all posts

Sunday, February 19, 2012

C# - Need to find instances of SQL Server on client

How can I determine using C# which instances of SQL Server 2000,
MSDE, 2005 or 2005 Express, if any, are installed on a client
computer?
For instance, by knowing the computer's name, I could
guess at a named instance of the data provider and use
it in a connection string, assuming Windows Integrated
Security, and attempt a connection. But this is klutzy.
Is there a method of *discovery* that returns the info?
In Visual Studio 2003/2005 when attempting a new connection
in Server Explorer, an applet appears which does something
like this. Ditto in SQL Server Manager.
The intent is to use DDL, embedded in ADO.Net library
calls, to create a data schema for an application
with stored procedures. This part is easy. But first,
I need to know "who's" there.
Hi,
This enum in C# can help you.
http://blogs.msdn.com/sushilc/archive/2004/10/14/242395.aspx
Thanks
Omar
"Stratum" wrote:

> How can I determine using C# which instances of SQL Server 2000,
> MSDE, 2005 or 2005 Express, if any, are installed on a client
> computer?
> For instance, by knowing the computer's name, I could
> guess at a named instance of the data provider and use
> it in a connection string, assuming Windows Integrated
> Security, and attempt a connection. But this is klutzy.
> Is there a method of *discovery* that returns the info?
> In Visual Studio 2003/2005 when attempting a new connection
> in Server Explorer, an applet appears which does something
> like this. Ditto in SQL Server Manager.
> The intent is to use DDL, embedded in ADO.Net library
> calls, to create a data schema for an application
> with stored procedures. This part is easy. But first,
> I need to know "who's" there.
>

Sunday, February 12, 2012

Business Hours

Does anyone know how to program a "business hours" datetime subtraction? I
have a table with business hours and want to determine the # of business
hours from now to a starting date. Below is what I am using now, but need
to only add in business hours between WorkDayStarts and WorkDayEnds.
SELECT dbo.RepairOrder.RepairOrderID, DATEDIFF([Hour],
dbo.RepairOrder.EstimateLockDate, GETDATE()) AS BusHrs,
dbo.BodyShop.WorkdayStarts, dbo.BodyShop.WorkdayEnds,
dbo.RepairOrder.EstimateLockDate
FROM dbo.BodyShop CROSS JOIN
dbo.RepairOrder
WHERE (dbo.RepairOrder.EstimateLockDate IS NOT NULL)
Thanks.
DavidMight want to read this too:
http://www.aspfaq.com/show.asp?id=2519
Adam Machanic
Pro SQL Server 2005, available now
http://www.apress.com/book/bookDisplay.html?bID=457
--
"David Chase" <dlchase@.lifetimeinc.com> wrote in message
news:Of$uHcj6FHA.1184@.TK2MSFTNGP12.phx.gbl...
> Does anyone know how to program a "business hours" datetime subtraction?
> I have a table with business hours and want to determine the # of business
> hours from now to a starting date. Below is what I am using now, but need
> to only add in business hours between WorkDayStarts and WorkDayEnds.
> SELECT dbo.RepairOrder.RepairOrderID, DATEDIFF([Hour],
> dbo.RepairOrder.EstimateLockDate, GETDATE()) AS BusHrs,
> dbo.BodyShop.WorkdayStarts, dbo.BodyShop.WorkdayEnds,
> dbo.RepairOrder.EstimateLockDate
> FROM dbo.BodyShop CROSS JOIN
> dbo.RepairOrder
> WHERE (dbo.RepairOrder.EstimateLockDate IS NOT NULL)
>
> Thanks.
> David
>

Friday, February 10, 2012

Bulk-Logged Recovery - Data Loss?

Folks,
Version: SQL Server 2000 SP3
I've been trying to determine from the documentation if there is any
potential for data loss while a database is in Bulk-Logged Recovery Mode
(BLRM), assuming that the server does not experience anything out of the norm.
Just prior to a DBREINDEX on several tables during minimal user activity, I
plan on putting the database into BLRM. I will return it to Full Recovery
Mode (FRM) upon completion of the reorg. My concern is that if there is a
user transaction during this DBREINDEX will it be logged, and therefore
recoverable? I'm thinking yes. Would just like confirmation.
Much obliged.
--
Scott H.Scott H.,
If the backup of the log include bulk-logged operations, then you will not
be able to restore to a point-in-time within that log backup; you can restore
only the whole log backup.
If something happend during the bulk operation and you need to backup the
log, then the data files that contain the bulk-logged transaction should be
accesible. If any affected data file is inaccessible, the transaction log
cannot be backed up and all operations committed in that log are lost.
Backup Under the Bulk-Logged Recovery Model
ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/udb9/html/c6bce51b-f401-408e-a1d6-f53866cd7351.htm
AMB
"Scott H." wrote:
> Folks,
> Version: SQL Server 2000 SP3
> I've been trying to determine from the documentation if there is any
> potential for data loss while a database is in Bulk-Logged Recovery Mode
> (BLRM), assuming that the server does not experience anything out of the norm.
> Just prior to a DBREINDEX on several tables during minimal user activity, I
> plan on putting the database into BLRM. I will return it to Full Recovery
> Mode (FRM) upon completion of the reorg. My concern is that if there is a
> user transaction during this DBREINDEX will it be logged, and therefore
> recoverable? I'm thinking yes. Would just like confirmation.
> Much obliged.
> --
> Scott H.