Forum Replies Created

Viewing 15 posts - 106 through 120 (of 197 total)

  • RE: to cursor or not to cursor

    > So ordering the #temp1 source table is really not necessary and may actually be slowing down the sp?

    Yes, that is correct.  An order by on the cursor declaration is required anyway,...

  • RE: to cursor or not to cursor

    HI there,

    An observation is that the cursor as written is not guaranteed to do what you think it is doing.  You mention up front that the data is sorted into...

  • RE: Unable to Insert Data

    Ok.  Next test to see what happens:

    INSERT INTO B.dbo.TempOrders
    (
    [OrderID],
    [EmployeeID],
    [OrderDate],
    [EmployeeDept]
    )
    select '1', '1', GetUTCDate(), 'x'

    Replace the sample values with valid ones and run the insert. ...

  • RE: Unable to Insert Data

    Hmmmm....  By process of elimination, if the "select" portion of the code works, then there must be some problem with the "insert" portion.  Try removing [dbo]. from the column names...

  • RE: Case Else logic question

    Melanie,

    We are here to help people of all skill levels, backgrounds etc.  This is an open forum, with global participation, and there are times when some communication may not come...

  • RE: full joins with composite keys and subqueries

    It sure does.  Thanks for your patience.  The code to retrieve the first result set is:

    SELECT X.store_id, sa2.activity_id as store_activity_id, X.activity_id

    FROM TestStore_Activity sa2 RIGHT OUTER JOIN

    (

    SELECT DISTINCT SA.Store_id, A.activity_id

     ...

  • RE: XML type question, I''''m stuck! XPERT help needed

    Tim,

    The simple answer is "no".  You cannot easily do what you are asking in SQL Server 2000.  There are ways to export the result to a text file, which can...

  • RE: Error on one server but works on another

    Couple of thoughts...

    Can you comment out individual lines in the select to identify exactly which line is causing the error?  In dev of course, not production.

    I would suspect an issue...

  • RE: full joins with composite keys and subqueries

    Sorry...  I did not actually take the code to Query Analyzer.  Reverse the join.  This will give you all activity for all stores, whether completed or not.  Then filter the...

  • RE: full joins with composite keys and subqueries

    SELECT SA.store_id, A.activity_id AS missing_act

      FROM Activity AS A

           left outer JOIN

           Store_Activity AS SA

           ON A.activity_id = SA.activity_id

     WHERE A.release = '5.0'

    order by sa.store_id, missing_act

    This might be closer to...

  • RE: How to check whether cusor is open or not?

    There may also be another hidden issue here.  Lets assume a cursor is the "right thing" to do in this case.  In normal SQL, one should know whether a cursor is...

  • RE: How to Update information in multiple tables in the same database

    In the where clause the columnname is currently timeRkeeper.  Remove the extra R?

    G'day

    Wayne

  • RE: full joins with composite keys and subqueries

    In the activity table in your post, there is no column named "release".  Please repost the correct DDL.  Lets assume that there is a column called release defined as a...

  • RE: Case Else logic question

    Something like the following may work:

    create table testtable (

        SomeID       varchar(10),

        Gender       varchar(1)

    )

    INSERT INTO TestTable (SomeID, Gender)

    SELECT 'RED', 'M' UNION

    SELECT 'BLUE', 'M' UNION

    SELECT 'YELLOW', 'F' UNION

    SELECT 'GREEN', 'F'

    DECLARE @Preference VARCHAR...

  • RE: Fuzzy logic matching routine problem

    Couple more thoughts as I checked the post to make sure it wasn't truncated...

    With this implementation, the rows must be inserted into the TestRule table in sequence of evaluation.  A...

Viewing 15 posts - 106 through 120 (of 197 total)