Forum Replies Created

Viewing 15 posts - 136 through 150 (of 1,468 total)

  • Reply To: SSMS: Remove highlight in current cell of grid output

    Looking at this from a different angle ....

    If you click on the upper left corner, it highlights all the cells.  That way you wont have a highlighted cell in the...

  • Reply To: CASE statement with multiple conditions (trimming & detecting spaces in between)

    Try this

    WHEN LTRIM(S1UPSP) LIKE 'RIOUS%' THEN '0'

     

    or this

    WHEN PATINDEX( '%RIOUS%', S1UPSP) > 0 THEN '0'

    Is it possible that leading "spaces" are not char(32), but...

  • Reply To: CASE statement with multiple conditions (trimming & detecting spaces in between)

    Something like this ...

    CASE
    WHEN CHARINDEX(' ', S1UPSP) > 0 THEN '0' /* S1UPSP Contains spaces */
    WHEN LEN(S1UPSP) = 10 THEN RIGHT(S1UPSP, 8) /*...
  • Reply To: Please help to get the data from 3rd to 4th under score i.e 20200912175059319

    You can read THIS ARTICLE on Splitter functions by Jeff Moden.

    At the end of the article, you will find a link "The New Splitter Functions.zip" that will...

  • Reply To: SQL server help with counting

    Perhaps a small tweak to Piet's 1st answer

    SELECT src.*, v.val
    FROM #t1 AS src
    CROSS APPLY (SELECT val = COUNT(DISTINCT(NULLIF(RTRIM(x.val), '')))
    ...
  • Reply To: How to give unique number to every different group of numbers ?

    I believe that this can be simplified as follows

    CREATE TABLE #parts ( PartNumber   varchar(50)
    ...
  • Reply To: How to give unique number to every different group of numbers ?

    I stand to be corrected, but the pattern appears to be as follows

    • P1 is the only PartNumber that has PartValue in (1,2,3,4), therefor has its own UniqueNumber
    • P2 and...
  • Reply To: Column names for each of Merge update Statement

    I gave you an example of how to use the OUTPUT clause, leaving you to modify it to work with your MERGE statement.

    These links should help you further

  • Reply To: Column names for each of Merge update Statement

    Doing this with a simple UPDATE, you can construct an output as follows

    CREATE TABLE #Employee (
    Emp int...
  • Viewing 15 posts - 136 through 150 (of 1,468 total)