Forum Replies Created

Viewing 15 posts - 2,221 through 2,235 (of 15,381 total)

  • RE: Help with variables NULL in cursor

    agerard (10/1/2015)


    re: moving the declare / deallocate outside of the try. That might help, thanks. In the mean time I ditched the cursor for another method and it seems to...

  • RE: Help with variables NULL in cursor

    agerard (10/1/2015)


    tweaked the catch block to return the error message (duh), but now i'm even more confused:

    ERROR_MESSAGE = A cursor with the name 'SetFirstLast' already exists.

    There is no other looping...

  • RE: Help with variables NULL in cursor

    agerard (10/1/2015)


    Sure, I could use something else other than a cursor. maybe that'd fix the issue. But... in this case the dataset i am looping through is small so a...

  • RE: how do I fine tune this query

    To further what Alan stated about NOLOCK. When you use that hint you can and will get missing and/or duplicate data from time to time. If that is acceptable then...

  • RE: Help with variables NULL in cursor

    agerard (10/1/2015)


    Hi folks,

    I have used cursors in a similar way 100 times (but not in a couple years). I am selecting 4 columns from a table and inserting them into...

  • RE: Find Invalid Combinition

    thbaig (10/1/2015)


    This is the only thing left.

    Case-1

    DECLARE @ProdId varchar(10) = 'Prod1',

    @color varchar(max) = NULL, -- Will make it optional and logic will work on all available color ...

  • RE: Find Invalid Combinition

    thbaig (10/1/2015)


    Thank you Sean , it worked.

    How can we make color and Size optional ? if either one or both provided it should return on input . If both not...

  • RE: Pagination in T-SQL to be done on 50000 records . Display 20 rows at single time

    myzus2004 (10/1/2015)


    Hi Sean, Can you please point out the function name to be used from Jeff Moden splitter attachment.

    Did you actually read the article or did you just want me...

  • RE: Find Invalid Combinition

    This produces the expected output based on the sample data provided.

    DECLARE @ProdId varchar(10) = 'Prod1',

    @color varchar(max) = 'Black,Blue,bbc',

    @size varchar(max) = 'L,S,M,MM';

    with AllSizesAndColors as --this gets all combinations of color...

  • RE: Find Invalid Combinition

    thbaig (9/30/2015)


    sean, I want to get output like following

    -- If color invalid status should be 100

    -- if color is valid but size is invalid status should be 101

    -- if valid...

  • RE: How to tune this query

    Grace09 (9/30/2015)


    I have a simple query, Select Max(Substring(nd_num, 12,3) from NDE where datepart(dd, nd_adate)=2. The query plan is attached. How should I tune this query? It comes to the top...

  • RE: Updating statment depending on 2 fields

    luissantos (9/30/2015)


    Hello comunity

    I need to build an update query for all my article beginning with '0.%' for my varchar field refkey, but depending on some conditions.

    For example.

    Case st.base <> ''...

  • RE: Find Invalid Combinition

    Just a shot in the dark here. From the title it sounds like you want to find invalid combinations among the values being passed in. There are a number of...

  • RE: Find Invalid Combinition

    What is the desired output from the values you are using? Also, as stated previously ordering by ordinal position is just bad. Don't do it. And throw that splitter in...

  • RE: t-sql 2012 data stays the same with different parameters

    Perhaps you could also post the actual query? And please do all of us a favor and the IFCode shortcuts on the left side when posting so you can format...

Viewing 15 posts - 2,221 through 2,235 (of 15,381 total)