Forum Replies Created

Viewing 15 posts - 5,896 through 5,910 (of 6,036 total)

  • RE: Old style Join conversion

    SELECT     t2.data,t2.id,t1.data

    from table2 t2 left outer join table1 t1

        on t1.id=t2.id and t1.data=5

    where t2.data=2

    Having "t1.data=5" in where clause you eliminate NULLs and make it INNER JOIN.

  • RE: Selecting all the row values together

    Any subquery is actually "sort of cursor logic".

    But here you do group by TableId first, so it's mix of "cursor" and "set" logic.

    Nothing to worry about.

  • RE: Can this be done with xp_sendmail?

    SET @MeetingName = '1st Trace Reminder for ' + @MeetingName

    EXEC MASTER..xp_sendmail @Recipients = 'jbloggs',

       @Message = @Message,

       @Subject = @MeetingName

    Would help?

  • RE: Querying time values spanning 2 days

    And even better create computed columns

    CALLTME_HDW%7 (for weekly periods) and

    CALLTME_HDW%1(for dayly periods)

    and set up indexes on it.

  • RE: SP slower than ad-hoc sql

    Are you sure everybody can see images from your local folder?

  • RE: Querying time values spanning 2 days

    What do you mean "decimal format"?

    Is it number of days from any "zero day"?

    If yes, there is no any problem.

    1. Don't convert data in column you are filtering. SQL Server...

  • RE: SELECT Empty value on first record

    SELECT '' as AccountID, '' as AccountName

    UNION ALL

    SELECT convert(varchar(20), AccountID), AccountName

    WHERE AccountID Between 1 AND 100

    ORDER BY AccountId

  • RE: It is possible?

    select E1.name, E.name as Manager
    from dbo.employee E1

       LEFT JOIN dbo.employee E ON E.id = E1.mag_id

  • RE: Stored Procedure will not populate table

    Can you actually read your post?

  • RE: How to read ntext

    Look for READTEXT on BOL.

  • RE: incremental in second column

    "Computed columns don't store their value." - where did you read this?

    If value is not deterministic and cannot be used in index it does not mean this value does not...

  • RE: incremental in second column

    If result of the function will be stored in computed column it will not affect SELECT performance at all.

    And clustered index is not mandatory because this function counts only rows...

  • RE: T-SQL How-to Question

    I probbly did not understand you dat right, but there must be something what can distinguish one WorkOrder from another.

    I assumed it is WorkOrderId, but you set them equal in...

  • RE: T-SQL How-to Question

    Join table to itself and filter data for each joined part of the table.

    Select WO1.SiteId, ...

    FROM WorkOrders WO1

    INNER JOIN WorkOrders WO2 on WO1.SiteId = WO2.SiteId

    INNER JOIN WorkOrders WO3 on WO1.SiteId...

  • RE: calculations in sql

    Wrong by design.

    It must be like this:

    Material  | Action  |    Product   |   Usage

    ---------------------------------------

    After this you may join rows in order you like and do whatever calculations you need.

Viewing 15 posts - 5,896 through 5,910 (of 6,036 total)