Forum Replies Created

Viewing 15 posts - 556 through 570 (of 5,356 total)

  • RE: Top 4 Subquery

    Next guess...

    set nocount on

    use northwind

    select

     t1.CustomerID

     , t1.OrderDate

    from

     orders t1

    where

     t1.OrderDate in

    (

     select top 2 --with ties

      t2.OrderDate

     from

      orders t2

     where

      t2.CustomerID = t1.CustomerID

     order by

      t2.OrderDate desc

    )

    order by

     t1.CustomerID

     , t1.OrderDate desc

    set nocount...

  • RE: Can someone verify this for me?

    Yes, when you're explicite in your conversion it works. The commented line fails because SQL Server is trying to bring 999999 down to a DECIMAL(2,0) which obviously won't work. This...

  • RE: How to speed up the search

    I might be wrong, but I think this is an Indian measure.

  • RE: Privileges needed to delete Stored Procedure?

    Yes, ddl_admin (or owner of the proc should be sufficient)

    What happens when the user fires directly a DROP PROCEDURE statement?

  • RE: Privileges needed to delete Stored Procedure?

    db_owner should be fine. What error do you get?

  • RE: How are logs written?

    I'll join the club here.

    Since you have no control what is written to which log file, having multiple files will yield you nothing.

     

    ...except even more trouble in case...

  • RE: RSS feed

    No, not yet

    Btw, ...

    Anyoen esle with a similar behaviour?

    Already trying to pronounce "ASSUG" or "AUSSQLUG"?

  • RE: Error converting data type varchar to float.

    ISNUMERIC behaves very funny at times. SQL Server MVP Steve Kass has posted the following in the public MS newsgroups. Enjoy!

    SELECT

     ISNUMERIC('$') AS Money_1

     ,ISNUMERIC('2d3') AS Float_1

     , ISNUMERIC('$+,') AS Money_2

    Money_1     Float_1    ...

  • RE: Selection of Max value from 3 different columns?

    Yes, your

    SELECT

    CASE WHEN ScheduleTime1 > ScheduleTime2 THEN

    CASE WHEN ScheduleTime1 > ScheduleTime3 THEN ScheduleTime1

    ELSE ScheduleTime3

    END

    ELSE

    CASE WHEN ScheduleTime2 > ScheduleTime3 THEN ScheduleTime2

    ELSE ScheduleTime3

    END

    END

    FROM ...

    and the one I posted

    SELECT CASE

     WHEN...

  • RE: Can someone verify this for me?

    Amazing. Now I must find out what has changed in SP3a that caused this error

    Thank you both!

  • RE: How to speed up the search

    I also work in insurance business and the best thing you can do, is to properly design your schema right from the start. One single table should work just fine...

  • RE: Selection of Max value from 3 different columns?

    I agree that the *best* advise here is to properly design your schema. However, if you are stuck with this design, what about one of these?

    SET NOCOUNT ON

    IF OBJECT_ID('max_t') >...

  • RE: get the rowcount before issuing statement

    Well, this is a good guess and usually correct, although not guaranteed to.

    ...but the OP wants to include a WHERE clause and rowcnt will not give you the information how...

  • RE: get the rowcount before issuing statement

    SQL Server bases its guesses on its internal statistical informations. I doubt that you can query them so that they suit your needs. I don't know of a way to...

  • RE: Like Statement

    use tempdb

    create table #test

    (

     c1 varchar(10)

    )

    insert into #test values('charcoal')

    insert into #test values('c arco l')

    select * from #test where c1 like '%[ ]arco[ ]%'

    drop table #test

    c1        

    ----------

    c arco l

    (1 row(s) affected)

Viewing 15 posts - 556 through 570 (of 5,356 total)