Forum Replies Created

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

  • RE: Update null to unknown in a table for all the columns

    Is this requirement to show null column value to 'unknown' then I will suggest to check null value whenever you write select query on null columns and use IsNull(<col_Name>,'unknown')

    If your...

  • RE: Update null to unknown in a table for all the columns

    Is this requirement to show null column value to 'unknown' then I will suggest to check null value whenever you write select query on null columns and use IsNull(<col_Name>,'unknown')

    If your...

  • RE: Date Issue

    hi, You can write a query like

    select Case When Month(getdate()) <=3 Then '31-03-'+ Convert(Varchar(4),Year(GetDate()))

    When Month(getdate()) > 3 AND Month(getdate()) <=6 THEN '31-06-' + Convert(Varchar(4),Year(GetDate()))

    When Month(getdate()) > 9 AND Month(getdate()) <=9...

  • RE: Output of Query

    great 🙂

    I am happy with this answer.

    Thankd stewartc-708166.

  • RE: Output of Query

    Thank you very much for your reply.

    Yes, considering this example, it will work fine.

    But what if I already have space in Col1.For that value too, it will show me 'Is...

  • RE: Output of Query

    I tried and got wrong in first select case 🙂

    But wanted to know that

    How can we chack null in this case then?

  • RE: Date function in sql server 2005

    Hi Alok,

    Updated this as per expected requirment

    Case 1 ::

    DECLARE @date DATETIME

    set @date = '04/22/2011'

    SELECT DATEADD(DAY,7-DATEPART(dw,@date) - 1,@date)

    output :: 2011-04-22

    But actually , it should be :2011-04-22(that is friday of...

  • RE: SET ROWCOUNT

    Now, "executed from right to left"? WTF?

    In the new example the top has been mentioned in INSERT statement so as per BOL, it will not get overwrite by SET...

  • RE: SET ROWCOUNT

    BOL is right, Ser rowcount overwrites the TOP function used in select statement. The statements will get executed from right to left so first Select statement will get executed and...

  • RE: Transaction

    I guess the other user can not able to access Table A until second commit get executed.

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