Forum Replies Created

Viewing 15 posts - 1 through 15 (of 19 total)

  • RE: select multiple identity values after insert?

    Username may be sufficient for the original authors problem, but for mine it really isn't. I often can't guarantee that I have anything that is uniquely identifiable that I...

  • RE: select multiple identity values after insert?

    RBarryYoung said

    A much better way is to use the OUTPUT clause,like this:

    ...

    INSERT into InsertIDTst(ColName, object_id)

    Output INSERTED.ID Into @IDList(ID)

    Select name, object_id

    From sys.columns

    ...

    When I first found out about...

  • RE: Change Where clause causes HUGE performance problem

    Do INSERTs really help? They just have a tendency to fill up tables with data.

    Even though table variables do not have any statistics or indexes, I have found that...

  • RE: Change Where clause causes HUGE performance problem

    The wierd thing is that the where clause is on a table that only has 170+- rows in it.

    It seems that the problem is coming in when it joins that...

  • RE: Not Equal

    It is easy to get confused with Boolean logic. An easy way to visualize what is going on is to create a table (spreadsheet) of your data. ...

  • RE: Subquery returned more than 1 value - SQL 2000

    I don't see the need for a cursor at all here. I don't know enough about your tables, and I also don't know where you added your extra conditions,...

  • RE: displaying year (YY) as YY-YY format

    Assuming that you had a tally table, you could do it like this. This allows you to easily make your range of years anything you want it to be.

    SELECT...

  • RE: Help needed in removing dynamic SQL

    My take on this is that it is inappropriate for any front-end to build your WHERE clause for you. A procedure can easily be written to take a parameter...

  • RE: A different Distinct Query

    That may be a simple function, but you have just killed your performance. If your table has 1000 rows in it, that function (and the select inside of it)...

  • RE: Its very urgent : Time Out Error

    I haven't look in detail at what your dynamic queries are doing, but by looking at the bottom of your proc I believe that you could easily convert this to...

  • RE: Index scans and nested queries.

    I have found that sometimes it helps performance to break up a problem into smaller, easier to solve, sub-problems. Also, nested SELECTs that reference the outer SELECT can cause...

  • RE: multiple LEFT OUTER self joins and a View

    Given that you are trying to "retrieve multiple points of 'survey data' to the application in a single row", that sounds to me like you are pivoting the data. ...

  • RE: Nested Cursors

    Ever since I found out about how to do Running Totals (a couple of years ago), that has been my Hammer for so many things. I haven't yet had...

  • RE: Nested Cursors

    In INNER_MOST_LOOP I believe your OR clause is going to cause you trouble. I don't think it is

    going to do what you are thinking it is. I have...

  • RE: I need to add a suffix to duplicate values

    I Believe this will do what you are wanting to do. It makes use of the Running Total (or whatever it is called) pattern to identify the proper suffix...

Viewing 15 posts - 1 through 15 (of 19 total)