Forum Replies Created

Viewing 15 posts - 16 through 30 (of 35 total)

  • RE: Eliminating duplicate records in join

    SELECT *

    FROM tsoDSInvoiceCOGS_SSSI

    WHERE POLineKey = 2266

    ORDER BY InvoicePostDate

    RESULTS:

    SOLineKey   POLineKey   ShipLineKey QtyShipped         InvcUnitCost      InvoicePostDate                                        InvoiceTranDate                                        InvoiceTranID SOExtCOGS        

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

           5399        2266        8229        ...

  • RE: Yet another Dynamic SQL question

    Thanks everyone for the help.  I'm learning!

  • RE: Yet another Dynamic SQL question

    You're right!  I discovered this and was just coming back to let everyone know I had found the problem.

    Now, can you tell me WHY the (...) make a difference in...

  • RE: Yet another Dynamic SQL question

    That catch helped a lot!  I'm almost there.

    Here's what the query looks like now--with a line of debugging code added:

    SET QUOTED_IDENTIFIER ON

    DECLARE @arrayvar varchar(8000),

     @select_stmnt varchar(8000)

    DECLARE @k int,  

     @i int,

     @l int,

     @c int

    SET @select_stmnt...

  • RE: Yet another Dynamic SQL question

    Actually, I believe the comma should be present.  Note the error message.

    The Results set should read something like:

    Guitarist0       Guitarist1        Guitarist3...

    ================ ================= ================

    Les Paul         Buddy...

  • RE: A senior moment?

    Well, it is getting clearer:  Are you saying that 2.0 <> 2 in SQL Server because when SQL Server evaluates record counts, it is looking not ONLY the VALUE of the...

  • RE: A senior moment?

    I agree with your reasoning entirely.  However, what I am uncertain regarding is WHY using '2.0' in dividing the COUNT() would result in an empty result set.  Division by '2'...

  • RE: A senior moment?

    Okay.  I don't mean to be hard to get along with here, but I need to understand more clearly:

    Here is a script from The Guru's Guide to Transact SQL--

    SELECT Median...

  • RE: A senior moment?

    Okay, I vaguely recall something now about SQL Server using the data types of origin in doing calculations.  So when I entered

    SELECT 99/2

    SQL Server assumed I was doing Integer math...

  • RE: A senior moment?

    BP, you're right.  I misquoted in my original post.

  • RE: Can you match text rows using LIKE in a join?

    How about using:

    WHERE CHARINDEX(table1.name,table2.name) > 0

    Will that work for you?

  • RE: Rankings in T-SQL

    Perfect!  Thanks for the reference.

     

  • RE: Value IN a Variable

    Thanks.  Looks like a valuable article.  I'm sure I'll gain a lot from it.

  • RE: Value IN a Variable

    Okay.  That works.  Now, to carry the question one step further for my project:

    I don't want to do a bunch of CASE statements and I want to evaulate an UPDATE along...

  • RE: Value IN a Variable

    Thanks for the quick response.  I'll give it a try.

Viewing 15 posts - 16 through 30 (of 35 total)