Forum Replies Created

Viewing 15 posts - 8,491 through 8,505 (of 19,560 total)

  • RE: Find first day of a week/month

    drew.allen (9/28/2011)


    SQLRNNR (9/28/2011)


    It appears there is an issue with how SQL handles dates that land on Sunday.

    Actually the problem lies with this piece of code:

    DATEADD(wk, DATEDIFF(wk, 0, GetDate()), 0)

    Similar code...

    Jason...AKA CirqueDeSQLeil
    _______________________________________________
    I have given a name to my pain...MCM SQL Server, MVP
    SQL RNNR
    Posting Performance Based Questions - Gail Shaw[/url]
    Learn Extended Events

  • RE: Can't connect with user which has trigger logon

    thang_ngo_2002 (9/28/2011)


    When I assign this user to "public" of master, and select for this log-table. I login successfully

    But how can I define which login with correct password, which login with...

    Jason...AKA CirqueDeSQLeil
    _______________________________________________
    I have given a name to my pain...MCM SQL Server, MVP
    SQL RNNR
    Posting Performance Based Questions - Gail Shaw[/url]
    Learn Extended Events

  • RE: count left and right node of parents in binary tree

    Sean Lange (9/28/2011)


    All I did was added some ddl and data in a consumable format and ran the query exactly as the OP posted it and it returned the exact...

    Jason...AKA CirqueDeSQLeil
    _______________________________________________
    I have given a name to my pain...MCM SQL Server, MVP
    SQL RNNR
    Posting Performance Based Questions - Gail Shaw[/url]
    Learn Extended Events

  • RE: Are the posted questions getting worse?

    WayneS (9/27/2011)


    Steve Jones - SSC Editor (9/27/2011)


    WayneS (9/27/2011)


    Hey Threadizens... I received an email for what looks like an interesting permanent/full-time DBA position in the Phoenix area (I know some of...

    Jason...AKA CirqueDeSQLeil
    _______________________________________________
    I have given a name to my pain...MCM SQL Server, MVP
    SQL RNNR
    Posting Performance Based Questions - Gail Shaw[/url]
    Learn Extended Events

  • RE: A Frank Exchange of Views

    It looks like Dereks chess algorithm needs an update. :-D:-D:-D

    Jason...AKA CirqueDeSQLeil
    _______________________________________________
    I have given a name to my pain...MCM SQL Server, MVP
    SQL RNNR
    Posting Performance Based Questions - Gail Shaw[/url]
    Learn Extended Events

  • RE: Bits Bound

    Good luck and may the plane be with you.

    Jason...AKA CirqueDeSQLeil
    _______________________________________________
    I have given a name to my pain...MCM SQL Server, MVP
    SQL RNNR
    Posting Performance Based Questions - Gail Shaw[/url]
    Learn Extended Events

  • RE: Find first day of a week/month

    You're welcome 😎

    Jason...AKA CirqueDeSQLeil
    _______________________________________________
    I have given a name to my pain...MCM SQL Server, MVP
    SQL RNNR
    Posting Performance Based Questions - Gail Shaw[/url]
    Learn Extended Events

  • RE: count left and right node of parents in binary tree

    dileep41011 (9/28/2011)


    what type changes required, plz suggest me, I am fresher

    As I said - I already noted it once. Maybe this is another good reason to hire a consultant....

    Jason...AKA CirqueDeSQLeil
    _______________________________________________
    I have given a name to my pain...MCM SQL Server, MVP
    SQL RNNR
    Posting Performance Based Questions - Gail Shaw[/url]
    Learn Extended Events

  • RE: Find first day of a week/month

    Kingston Dhasian (9/28/2011)


    This should work for you then..

    DECLARE @from_date DATETIME

    SET @from_date = '11-Sep-2011'

    SELECT CASE

    WHEN DATEADD( MONTH, DATEDIFF(...

    Jason...AKA CirqueDeSQLeil
    _______________________________________________
    I have given a name to my pain...MCM SQL Server, MVP
    SQL RNNR
    Posting Performance Based Questions - Gail Shaw[/url]
    Learn Extended Events

  • RE: Find first day of a week/month

    yubo1 (9/28/2011)


    You can use 'set datefirst 7' to set sunday is the first date of a week in you sql-query

    That wasn't working in this query. Only Sunday...

    Jason...AKA CirqueDeSQLeil
    _______________________________________________
    I have given a name to my pain...MCM SQL Server, MVP
    SQL RNNR
    Posting Performance Based Questions - Gail Shaw[/url]
    Learn Extended Events

  • RE: Find first day of a week/month

    It appears there is an issue with how SQL handles dates that land on Sunday. Here is a klugy workaround.

    DECLARE @from_date DATETIME

    --Set DateFirst 1 --tried this but it had...

    Jason...AKA CirqueDeSQLeil
    _______________________________________________
    I have given a name to my pain...MCM SQL Server, MVP
    SQL RNNR
    Posting Performance Based Questions - Gail Shaw[/url]
    Learn Extended Events

  • RE: count left and right node of parents in binary tree

    dileep41011 (9/27/2011)


    plz help me

    See my last reply where I provided the answer (the change needed to make Seans query work for you).

    Jason...AKA CirqueDeSQLeil
    _______________________________________________
    I have given a name to my pain...MCM SQL Server, MVP
    SQL RNNR
    Posting Performance Based Questions - Gail Shaw[/url]
    Learn Extended Events

  • RE: SQL Join, Joining Two Tables

    Please provide sample data so we can test solutions.

    Jason...AKA CirqueDeSQLeil
    _______________________________________________
    I have given a name to my pain...MCM SQL Server, MVP
    SQL RNNR
    Posting Performance Based Questions - Gail Shaw[/url]
    Learn Extended Events

  • RE: SQL Join, Joining Two Tables

    Does the Rooms table have arrival dates and departure dates? You could also try throwing on the where clause:

    or ClientRoom.ArrivalDate is null

    Jason...AKA CirqueDeSQLeil
    _______________________________________________
    I have given a name to my pain...MCM SQL Server, MVP
    SQL RNNR
    Posting Performance Based Questions - Gail Shaw[/url]
    Learn Extended Events

  • RE: count left and right node of parents in binary tree

    dileep41011 (9/27/2011)


    its query produce left node = 0 and right node = 15, while left node will be 2 and rightnode will be 13

    The fix for that is quite simple....

    Jason...AKA CirqueDeSQLeil
    _______________________________________________
    I have given a name to my pain...MCM SQL Server, MVP
    SQL RNNR
    Posting Performance Based Questions - Gail Shaw[/url]
    Learn Extended Events

Viewing 15 posts - 8,491 through 8,505 (of 19,560 total)