Forum Replies Created

Viewing 15 posts - 301 through 315 (of 533 total)

  • RE: special scenario join

    It would probably be better if you had a more real-word scenario (and please see the instructions in the link below) so we can understand what exactly you're trying to...

    └> bt



    Forum Etiquette: How to post data/code on a forum to get the best help[/url]

  • RE: Getting Run-around on well deserved raise

    I'll never again try to convince my company not to be stupid. Don't get me wrong, there are times when even intelligent managers just need a simple reminder and...

    └> bt



    Forum Etiquette: How to post data/code on a forum to get the best help[/url]

  • RE: How to capture changes?

    declare @t_temp table (ID int, Value INT, Value2 VARCHAR(20))

    insert into @t_temp

    select 1, 5, 'Win32' union

    select 2, 5, 'Win32' union

    select 3, 7, 'Win32' union

    select 4, 7, 'Win32' union

    select 5, 7, 'Win32'...

    └> bt



    Forum Etiquette: How to post data/code on a forum to get the best help[/url]

  • RE: count(masterId), count(detail.ID) to produce master and detail counts in one single query

    Eugene Elutin (6/18/2010)


    I am assuming this query is run for reporting purposes, therefore dirty reads might be acceptable.

    It depends on the reporting ... in many cases the fact that it...

    └> bt



    Forum Etiquette: How to post data/code on a forum to get the best help[/url]

  • RE: Where CreatedOn = dateadd(day, -1, getdate()) {exclude weekend}

    Add this above your code

    declare @dt_today datetime,

    @dt_theDateIWant datetime

    select @dt_today = DATEADD(dd, DATEDIFF(dd,0,GETDATE()), 0)

    select @dt_theDateIWant...

    └> bt



    Forum Etiquette: How to post data/code on a forum to get the best help[/url]

  • RE: How to capture changes?

    declare @t_temp table (ID int, Value int)

    insert into @t_temp

    select 1, 5 union

    select 2, 5 union

    select 3, 7 union

    select 4, 7 union

    select 5, 7 union

    select 6, 7 union

    select 7, 9 union

    select...

    └> bt



    Forum Etiquette: How to post data/code on a forum to get the best help[/url]

  • RE: Where CreatedOn = dateadd(day, -1, getdate()) {exclude weekend}

    declare @dt_today datetime,

    @dt_theDateIWant datetime

    select @dt_today = DATEADD(dd, DATEDIFF(dd,0,GETDATE()), 0)

    select @dt_theDateIWant = case DATEPART(DW,@dt_today)

    when 2 then DATEADD(dd, -3, @dt_today)

    when 1 then DATEADD(dd, -2, @dt_today)

    else DATEADD(dd, -1, @dt_today) end

    select somedata

    from sometable

    where somedatefield...

    └> bt



    Forum Etiquette: How to post data/code on a forum to get the best help[/url]

  • RE: SQL 2008 Default DateTime format

    If you are concerned about formatting output, you would be far better off handling all of that through whatever application you're using for the user interface. If you must...

    └> bt



    Forum Etiquette: How to post data/code on a forum to get the best help[/url]

  • RE: Stroed Procedure for Executing Dynamic Sql Query with Pagination

    Palanivelrajan (6/17/2010)


    Dear Lawrence Moore,

    ROFL

    └> bt



    Forum Etiquette: How to post data/code on a forum to get the best help[/url]

  • RE: Datediff versus Convert for datetime comparison (ignoring time part)

    scott.pletcher (6/16/2010)


    However, as you are working in a larger environment, the optimizer may even choose to use a non-covering index with less than fantastic selectivity just because the cost of...

    └> bt



    Forum Etiquette: How to post data/code on a forum to get the best help[/url]

  • RE: Are the posted questions getting worse?

    Lynn Pettis (6/11/2010)


    Lynn Pettis (6/11/2010)


    Anybody out there know much about this individual, scott.pletcher?

    I know we have several MVP's here on SSC, but most of you don't advertise it, and perhaps...

    └> bt



    Forum Etiquette: How to post data/code on a forum to get the best help[/url]

  • RE: Non Disclosure Agreements (What's the point?)

    Very few non-competes hold up in court. Their usage has more to do with the psychological impact than the reality of their enforceability.

    But yeah ... anything in a normal...

    └> bt



    Forum Etiquette: How to post data/code on a forum to get the best help[/url]

  • RE: Datediff versus Convert for datetime comparison (ignoring time part)

    Overall, for SQL to use any index, it has to highly selective or a covering index: I suspect that's unlikey here.

    In a smaller environment you'll see the optimizer frequently...

    └> bt



    Forum Etiquette: How to post data/code on a forum to get the best help[/url]

  • RE: How To count Number of NULLS in a row

    As ColdCoffee said, your SET_ANSI_NULLS setting will matter. This is one way to get your counts:

    SET ANSI_NULLS ON

    go

    declare @t_temp table

    (

    ID int,

    Column1 int,

    Column2 int,

    Column3 int,

    Column4 int,

    Column5 int

    )

    insert into @t_temp(ID, Column1,...

    └> bt



    Forum Etiquette: How to post data/code on a forum to get the best help[/url]

  • RE: Mentor

    IMO, best way to get a good SQL mentor is by way of a job at the right company. The challenge is finding that right company and then beating...

    └> bt



    Forum Etiquette: How to post data/code on a forum to get the best help[/url]

Viewing 15 posts - 301 through 315 (of 533 total)