Forum Replies Created

Viewing 15 posts - 16 through 30 (of 1,419 total)

  • Reply To: find whether a upper case letter is there in a given string

    This is an ancient topic.  Doesn't matter to me tho.  Looking through these answers I don't see one I like.  The LOWER() solutions express the test indirectly.  The _CS_ collations...

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

  • Reply To: What Can AI Really Do?

    David.Poole wrote:

    I used Claude to help write a "skill"  to carry out a task.  The actual code worked fine, ...  

    It seems reasonable to infer there was a detailed prompt...

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

  • Reply To: What Can AI Really Do?

    David.Poole wrote:

    I'm finding that in some cases, Claude absolutely amazes me.  In others, it fails and not in situations where you'd expect it to struggle.

    Claude's a prickly pear. I've found...

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

  • Reply To: Dynamic Unpivot

    Afaik if the column list is variable it's not possible to unpivot without dynamic SQL.  On a per table (or schema) basis if the columns are known then you could...

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

  • Reply To: Dynamic Unpivot

    Yes that answers it.  It seems possible to create an iTVF per table/schema (if it's hard coded explicitly referencing columns and table(s)) that gives users what they're looking for.  Not...

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

  • Reply To: Dynamic Unpivot

    The design is annoying but maybe not unfixable if you could encapsulate access (queries, views, etc.). Imo the bigger issue is whether the table(s) store when things happened (datetime per...

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

  • Reply To: Dynamic Unpivot

    Hi Pieter,

    Once you unpivot into (Symptom, Grade, Causality, Relatedness) you’ve gotten rid of the original “slot” number (the 1, 2, 3 suffixes). Maybe that matters? It might if you later...

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

  • Reply To: Case part is sloooooow

    Maybe the issue is the query could possibly be more efficiently evaluated if expressed as two queries.  It always depends on the actual situation with cardinalities and indexes etc.  If...

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

  • Reply To: Two foreign keys to the same table. Can't cascade deletes.

    1.  It's not allowed.
    2. SQL Server wants to guarantee a single parent delete cannot reach the same target row by more than one cascade route.  Multiple cascade paths are not...

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

  • Reply To: Simplifying WHERE Condition with LIKE test on multiple columns

    Sure redesign if possible.  As far as the task at hand it depends on the number of rows really.  If there are a good many rows then allocating a temp...

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

  • Reply To: Need to overload tempdb

    Ha yeah I was reluctant to test it out.  Sorry for the syntax issues.  Originally I had a table CREATE statement but then switched to SELECT INTO because that's more...

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

  • Reply To: Need to overload tempdb

    How about creating a giant temp table from a CROSS JOIN using 2 fnTally functions.  Then join the temp table to itself forcing a HASH JOIN with tiny memory grants...

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

  • Reply To: Beginner in sql server

    Assuming this is dev or the table is empty, DROP and recreate with the proper column type and default.  Something like this

    drop table if exists dbo.latest_info;
    go
    create table...

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

  • Reply To: Beginner in sql server

    You're looking to set the DEFAULT value of the publish_date column to be the current Unix timestamp?  If so the proper column type would be BIGINT.  SQL Server’s native datetime...

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

  • Reply To: Varchar(max) to lines

    Summary
    + Input: long varchar text; max line width W.
    + Walk left-to-right, one word at a time.
    + Separators: space; CR/LF are hard line breaks.
    + For each word:
    ...

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

Viewing 15 posts - 16 through 30 (of 1,419 total)