Forum Replies Created

Viewing 15 posts - 5,146 through 5,160 (of 6,036 total)

  • RE: Tricky SELECT problem with WHERE and HAVING

    SELECT count(name), objectId, date

    FROM tbl_objects

    INNER JOIN tbl_commands ON tbl_objects.id = tbl_commands.objectId

    WHERE name = 'name1'

    GROUP BY name, date

    HAVING count(commandId) > 5

    UNION

    SELECT count(name), objectId, date

    FROM tbl_objects

    INNER JOIN tbl_commands ON tbl_objects.id =...

  • RE: compared two table with

    > Probably more efficient

    Did you compare?

  • RE: how to write a function

    Why you need CONVERT?

    Just to avoid using index and make this query heavy?

  • RE: Id of the last inserted

    I see it everyday in all projects I designed.

    Probably there is no need to tell you that everything is set based.

    Don't know about high-speed. You tell me. 1 second to...

  • RE: Id of the last inserted

    I'm just trying to get back to live the DB built on SCOPE_IDENTITY apprach.

    You know, it's very good while it's in developer's sandbox.

    But when it goes to production, it ends...

  • RE: how to write a function

    There is a topic "CREATE FUNCTION" in BOL.

    There are some examples down there.

    What's not clear for you in this topic?

  • RE: how to reference a table in a variable?

    Open BOL and find the difference between variables and identifiers.

  • RE: Id of the last inserted

    I use IDENTITY column, of course.

    But I never use SCOPE_IDENTITY() to get CustId for table Order.

    Because probably this Customer has been inserted when I processed previous order from the same...

  • RE: Id of the last inserted

    I have asked many people and still got no answer:

    Why on the earth you would need to insert a row into a table if there is already one with exactly...

  • RE: Help with declare

    Yes, too many to mention.

    Start from the flow. Where do you enter the loop, what will get you out of there?

    Then why do you need 2 cursors?

    Status of which one...

  • RE: Help with declare

    And I better kep silence about the rest of your code.

    I can only guarantee that you could not pass even entry level test on any programming course presenting this kind...

  • RE: Help with declare

    You have @dbname inside of your dynamic script.

    I don't see where you have it declared in this script.

  • RE: Row Size is too large?

    You have MAX() and MIN() for some columns, and you are definetely not allowed (and probably don't intend) to group you text notes.

    I could help you with this query if...

  • RE: locking - update statement

    I'm afraid, to enable dirty reads you need to rewrite all SP's (and ad-hoc queries from application?) accessing this table.

    That's not what I'd like to do.

  • RE: Trigger fire sequence

    Just open topic "Triggers" or "Create Trigger".

    It's highlighted there.

Viewing 15 posts - 5,146 through 5,160 (of 6,036 total)