Forum Replies Created

Viewing 15 posts - 1,081 through 1,095 (of 1,413 total)

  • Reply To: stored procedure return values

    Instead of returning the SSN (which is being sent to the procedure already) could you return COUNT(*)?  Count always returns a value.

    Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können

  • Reply To: insert random value from predefined list of possible values

    marchello wrote:

    It's data obfuscation project, thus no strict rules what value should be, rather it should be random. Each row should have its own value. When we are out of...

    Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können

  • Reply To: insert random value from predefined list of possible values

    It randomly picks one of the words

    ;with data_cte(which_word) as (
    select 'some' union all select 'word' union all select 'here')
    select top(1)
    which_word
    from
    ...

    Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können

  • Reply To: Query help for special condition

    This is a beginning and it might get the OP past the id assignment issue.

    drop table if exists #src_data;
    go
    create table #src_data(
    EmpId ...

    Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können

  • Reply To: Query help for special condition

    sqlenthu 89358 wrote:

    Now while i was trying to implement merge, problem is how to assign new identifier value for new record (it should be max value +1 , and this column...

    Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können

  • Reply To: expand field and fill with zeros

    Jeff Moden wrote:

    Right there with you.  I wouldn't bother on that other thread, though.  That subject keeps cropping up over and over and over and some of the participants do too. ...

    Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können

  • Reply To: expand field and fill with zeros

    Jeff are the results reversed?  It lists FORMAT d14 method as 802ms.  Maybe copy/paste gone off?

    Jeff Moden wrote:

    And, please... for the love of your servers and your customers, stop all the...

    Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können

  • Reply To: Replacing / Removing All Text In Multiple Sets of Characters in SQL

    Jeffrey Williams wrote:

    @scdecade - your solution will not work for the OP.  The trim function is not available on SQL Server 2016 and would need to be replaced with a rtrim(ltrim(...)). ...

    Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können

  • Reply To: Replacing / Removing All Text In Multiple Sets of Characters in SQL

    If using nested replace then this could be done in the select list.  What if the list of replacements is variable?

    select 
    ltrim(rtrim(replace(replace(replace(replace(replace(Employee, '<td><br>', '||'), '<td>',...

    Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können

  • Reply To: Replacing / Removing All Text In Multiple Sets of Characters in SQL

    Here's a table based scalar function approach.  Actually, I had a very similar issue this week and this code is lifted from that solution.  Which I'm not super happy with...

    Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können

  • Reply To: Basic SQL Question

    porterdl wrote:

    VIN as ID makes more sense to me too.

    porterdl wrote:

    I kept thinking that IDs would automatically fill but my confusion was mostly with surrogate keys i think.

    Imo there is...

    Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können

  • Reply To: expand field and fill with zeros

    mbatchelor wrote:

    I am trying to create a row in a table that is created as: CREATE TABLE tax_table ( Data char(275)).  Within this table the "Data" consist of 4 fields that...

    Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können

  • Reply To: expand field and fill with zeros

    Jeff Moden wrote:

    Steve Collins wrote:

    Jeff Moden wrote:

    Lordy, no.  That's one of the slowest methods possible.  I'll be back to prove it.  Just don't use FORMAT!

    Jeff, maybe so, maybe so.  It appears the OP's...

    Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können

  • Reply To: Replacing / Removing All Text In Multiple Sets of Characters in SQL

    One way to do this would be to do search and replace.  It would nice to have a regex but it depends on your faith in a single pattern.  Per...

    Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können

  • Reply To: expand field and fill with zeros

    mbatchelor wrote:

    I am trying to create a row in a table that is created as: CREATE TABLE tax_table ( Data char(275)).  Within this table the "Data" consist of 4 fields...

    Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können

Viewing 15 posts - 1,081 through 1,095 (of 1,413 total)