Forum Replies Created

Viewing 15 posts - 3,691 through 3,705 (of 4,087 total)

  • RE: hi

    opc.three (6/29/2011)


    Itzik has it down, use the APPLY operator for this. UNION ALL will scan the data multiple times, APPLY will only scan it once, and it's cleaner than the...

  • RE: hi

    Here is why UNPIVOT doesn't work with multiple sets of data.

    Suppose you have the row:

    JOB Name1 Name2 ...

  • RE: hi

    Abhijit More (6/29/2011)


    Use UNPIVOT operator.

    The UNPIVOT operator doesn't work well when you want to unpivot multiple sets of data. Here the OP wants to unpivot three sets of data:...

  • RE: Formatting a date to YYYYMMDD

    repicurus (6/27/2011)


    select replace(convert(char(10), getdate(), 120), '-', '')

    How is this an improvement over the code listed below that the OP is already using?

    select convert(varchar,getdate(),112)

    I can't imagine that the efficiency of converting...

  • RE: how to Avoid the intervals

    thava (6/27/2011)


    hope fully this is not a clean one but now it satisfies my condition so any one simplify it

    This is a variation of the overlapping date ranges problem. ...

  • RE: Cartesian product sql query

    Selahattin SADOGLU (6/24/2011)


    insert into #Personel values('deneme1'),('deneme2'),('deneme3')

    insert into #Masa values('Masa1'),('masa2'),('masa3')

    This syntax was introduced in SQL 2008. Since you're posting in the SQL 2005 forum and you're getting error messages about...

  • RE: Reverse arguments in an IN statement?

    Actually what you are looking for is IN itself. There's nothing that requires the left side to be a field and nothing that prevents the right side from being...

  • RE: counting records and summing money amount

    Both WITH CUBE and WITH ROLLUP require that you have a GROUP BY clause, which I don't think that you want to use in this case. The COMPUTE clause...

  • RE: Unfamiliar Date format not recognized by ISDATE()

    One caveat is that in SQL 2008, it automatically takes DST into account, so you'll need to make sure that your UDF also takes that into account.

    Drew

  • RE: Unfamiliar Date format not recognized by ISDATE()

    This is datetimeoffset data. It was introduced in SQL2008. It combines datetime data with a time zone offset.

    Drew

  • RE: Problem with year break between birthdate query

    Jeff Moden has previously posted about how inefficient it is to convert datetime data to varchar. His most recent post is here http://www.sqlservercentral.com/Forums/FindPost1119797.aspx.

    There is a solution that only uses...

  • RE: Issue with NULL or some white space character

    T-SQL does not use the ASCII null character to represent a NULL string. As far as SQL is concerned, there is no difference between ASCII 0 and any other...

  • RE: get minutes from datetime with leading zero

    Andrew Westgarth (6/21/2011)


    I didn't need to do this for presentation it was for comparison against a varchar field. Basically I have a user input varchar of time e.g. 02:32:53...

  • RE: get minutes from datetime with leading zero

    You probably shouldn't be doing this in T-SQL at all. This is a presentation issue and should be left to the presentation layer.

    What are you ultimately trying to achieve?...

  • RE: batch insert question- One Transaction?

    This sounds suspiciously like a homework assignment. Why don't you tell us your thoughts?

    Drew

Viewing 15 posts - 3,691 through 3,705 (of 4,087 total)