Forum Replies Created

Viewing 15 posts - 1 through 15 (of 15 total)

  • RE: Check DB Status using ADO

    I assume you are using VB Script in an ASP page, not an actual VB project? If this is the case, then you will need to create an instance of...

  • RE: Check DB Status using ADO

    I dont belive you can actually do this using ADO, you will need to use SQLDMO for this...

    For example you could have a function like:

    Public Function chkDBStatusNormal() As Boolean

    Dim...

  • RE: need help

    use a select Case statement i.e.

    Select Result = Case col2

    when 0 then 0

    else col1/col2

    end

    From table

  • RE: need help

    aaahhh then I belive this should give the required results:

    Select Count(orderNo) as TMOrders, [Month] as theMonth into #TempTMonthOrders

    From Orders

    Group by [Month]

    Select Count(OrderNo) as CustOrders, [Month] as theMonth into #TempCOrders

    From Orders

    Where...

  • RE: need help

    In that case try:

    Select Count(orderNo) as COrders, Month as theMonth into #TempCustOrders

    From Orders

    Where CustId = @CustId

    Group by Month

    Select t.COrders as CustOrders, Count(OrderNo) as TotalMonthOrders, Month

    From Orders

    inner Join #TempCustOrders t...

  • RE: need help

    You could do something along the lines of:

    Declare @CustMonthOrders numeric

    Declare @TotalMonthOrders numeric

    Declare @Month numeric

    Set @Month = 1

    Set @CustId = 20

    Set @CustMonthOrders = (Select Count(orderNo) From Orders

    Where Month = @Month and...

  • RE: Running a DTS package from VB.

    Check that your server is set up for Mix authentication mode and that the login under which you application will run has access writes to run the package, alternativley you...

  • RE: Connecting to VPN from SQL

    You Could try adding an Execute Process Task to the start of your Package that calls the VPN Executable. However if your VPN software is anything like ours and requires...

  • RE: How to select date based on range period.

    You could use something like:

    Select aDate from TableA

    Where (Month(aDate) >= 5 And Year(aDate) >= 2002)

    And ((Month(aDate) <= 5 And Year(aDate) <= 2003)

  • RE: Running a DTS package from VB.

    First of all you need to add a reference to the Microsoft DTSPackage Object Library.

    Then in your app do something along the lines of:

    Dim oDTSPackage as DTS.Package2

    Set oDTSPackage =...

  • RE: check constraint violation occurred

    I am assuming that you are using ADO and have error handling in the application but are not getting any errors from executing the SP!

    If this is the case then...

  • RE: Query from other database

    Use

    Select * from [db1].[dbo].[tablename]

  • RE: Bug in implicit_transactions (Insert) SQL Server

    Is that a case of far to much information...

    Your problem is that you can only have the identity insert on for one table at a time so you would need:

    SET...

  • RE: Date formats

    Why not just use explicit dates in the format of '20/Sep/2003' this will get around any differences in the regional settings....

  • RE: Set Variable

    Do you mean something like this:

    declare @aCountry as varchar(16)

    Set @aCountry = 'Mexico'

    Select * From Customers where Country = @aCountry

Viewing 15 posts - 1 through 15 (of 15 total)