Forum Replies Created

Viewing 15 posts - 916 through 930 (of 2,171 total)

  • RE: Tally Table

    Run this query instead

    SELECT DISTINCTMID,

    MM AS mm,

    YYYY AS yyyy,

    DATEADD(MONTH, 12 * YYYY - 22801 + mm, '19000101') AS DateStart,

    DATEADD(MONTH, 12 * YYYY - 22800 + mm, '19000101') AS monthEndDate,

    'M' AS...


    N 56°04'39.16"
    E 12°55'05.25"

  • RE: Tally Table

    Karthik, you really don't pay attention to earlier suggestions made to you, do you?

    Here is your code

    SELECTMID,

    MIN(YYYY * 100 + MM) % 100 AS mm,

    MIN(YYYY * 100 + MM) /...


    N 56°04'39.16"
    E 12°55'05.25"

  • RE: Index Scan Vs. Index Seek

    SQL Server 2005.


    N 56°04'39.16"
    E 12°55'05.25"

  • RE: Triangular Join

    I think people are tired of answering same question over and over again.


    N 56°04'39.16"
    E 12°55'05.25"

  • RE: Index Scan Vs. Index Seek

    Sandy (5/15/2008)


    FORCESEEK is available in SQL Server 2008, not SQL Server 2005.

    here I wants to know, Is there any new join concept added to SQL Server 2008. (apart from Inner...


    N 56°04'39.16"
    E 12°55'05.25"

  • RE: Index Scan Vs. Index Seek

    It was just an example.

    An index seek is more likely to be faster than index scan.

    So when you investigate the query using index seek and see that index seek occupies...


    N 56°04'39.16"
    E 12°55'05.25"

  • RE: Index Scan Vs. Index Seek

    Hasan Mansur (5/14/2008)


    In these situations , you can use FORCESEEK table hint. For more details look http://msdn.microsoft.com/en-us/library/bb510478(SQL.100).aspx

    FORCESEEK is available in SQL Server 2008, not SQL Server 2005.

    http://sqlserver.ro/blogs/cristians_blog/archive/2007/11/02/forceseek-hint.aspx


    N 56°04'39.16"
    E 12°55'05.25"

  • RE: Index Scan Vs. Index Seek

    The percentages are RELATIVE to the query.

    88% of 2 seconds are still hell a lot better than 54% of 111 seconds.


    N 56°04'39.16"
    E 12°55'05.25"

  • RE: Return maximum concurrent users

    DECLARE@Sample TABLE (Date DATETIME, ConcurrentUsers INT, Application NVARCHAR(256))

    INSERT@Sample

    SELECT'20080514 11:00:00', 19, 'Peso' UNION ALL

    SELECT'20080514 15:15:14', 21, 'Peso' UNION ALL

    SELECT'20080514 15:17:14', 11, 'Yak' UNION ALL

    SELECT'20080515 15:10:10', 8, 'Peso'

    SELECTApplication,

    theDate,

    ConcurrentUsers,

    Date

    FROM(

    SELECTDate,

    DATEADD(DAY, DATEDIFF(DAY, '19000101', Date), '19000101')...


    N 56°04'39.16"
    E 12°55'05.25"

  • RE: Return maximum concurrent users

    May I cut in?

    DECLARE@Sample TABLE (Date DATETIME, ConcurrentUsers INT, Application NVARCHAR(256))

    INSERT@Sample

    SELECT'20080514 15:15:14', 21, 'Peso' UNION ALL

    SELECT'20080514 15:17:14', 11, 'Yak' UNION ALL

    SELECT'20080515 15:10:10', 8, 'Peso'

    SELECTDATEADD(DAY, DATEDIFF(DAY, '19000101', Date), '19000101') AS theDate,

    MAX(Date)...


    N 56°04'39.16"
    E 12°55'05.25"

  • RE: Index Scan Vs. Index Seek

    What was the solution in your case.

    I think other users in same dilemma might benefit from the knowledge gained here.


    N 56°04'39.16"
    E 12°55'05.25"

  • RE: Rownumber

    Already asked and answered here

    http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=102805


    N 56°04'39.16"
    E 12°55'05.25"

  • RE: Index Scan Vs. Index Seek

    Do you also have

    1) Same edition and service pach of SQL Server

    2) Same number of records in all underlying tables

    3) Updated statistics

    To mention a few insoection points.


    N 56°04'39.16"
    E 12°55'05.25"

  • RE: Max Date in a row with multiple dates

    SELECT... ,

    (SELECTMAX(Created_Date)

    FROM(

    SELECT a.created_date UNION ALL

    SELECT b.created_date UNION ALL

    SELECT c.created_date UNION ALL

    SELECT d.created_date UNION ALL

    SELECT e.created_date

    ) AS d

    ) AS MaxCreatedDate

    FROMTable1 AS a

    INNER JOINTable2 AS b ...

    INNER JOIN...


    N 56°04'39.16"
    E 12°55'05.25"

Viewing 15 posts - 916 through 930 (of 2,171 total)