Forum Replies Created

Viewing 15 posts - 5,821 through 5,835 (of 7,616 total)

  • RE: Updating data in one table dependent upon FK match on another table.

    The first, most obvious though is "don't do this". Why are you denormalizing one table's data into thousands of other tables? Why not just join to the original...

  • RE: Convert string to Date

    terry999 (9/5/2014)


    Nice one..

    Why date_input + '0'

    I think it works without concatenating '0' at the end?

    That's in case you get an entry like:

    'Saturday'

    Without the " + '0'", the entire string gets...

  • RE: Convert string to Date

    You could skip all non-numeric chars at the front of the string, viz:

    SELECT

    date_input,

    SUBSTRING(date_input, PATINDEX('%[0-9]%', date_input + '0'), 30) AS adjusted_date_input

    FROM (

    ...

  • RE: Create Periods Transaction Dates and make them columns

    select

    g_a.id as GLAcct,

    g_a.descr as GLDesc,

    sum(case when g_l.transaction_date >= '20140101' AND g_l.transaction_date < '20140201' THEN g_l.amount_n ELSE 0 END) AS Jan,

    --...

    sum(case when g_l.transaction_date >= '20140701' AND g_l.transaction_date < '20140801' THEN g_l.amount_n...

  • RE: Using COALESCE and also trying to multiply and divide

    CELKO (9/4/2014)


    He put each element into its own schema. A curious design, I admit, but not one that breaks any rules I know of.

    Attribute splitting. You...

  • RE: Using COALESCE and also trying to multiply and divide

    CELKO (9/3/2014)


    the truncated YYYY-MM-DD is allowed in ISO 8061. But DD is constrained to be in the range 01 to 31 so the CELKO YYYY-MM-00 is guaranteed non-conformant...

  • RE: Using COALESCE and also trying to multiply and divide

    TomThomson (9/3/2014)


    CELKO (9/3/2014)


    Do you have you copy of the ANSI/ISO Standards? Read them. The only display format allowed is ISO-8601, 'yyyy-mm-dd' and not your punctuation free version. Sorry....

  • RE: Using COALESCE and also trying to multiply and divide

    CELKO (9/3/2014)


    Vastly more important, "we" do not store editing chars within the data! Even if one insists on storing dates as (var)char, why on earth would there ever...

  • RE: Trigger or Not Trigger

    LutzM (9/3/2014)


    ScottPletcher (9/3/2014)


    ...

    There are 3rd party solutions that do that, but they are rather expensive. At least one we investigated uses its own "black box" to hold the data...

  • RE: memory settings from default to 4500 MB

    If you want to verify the current setting, run this statement:

    EXEC sp_configure 'max server memory'

  • RE: Using COALESCE and also trying to multiply and divide

    CELKO (9/3/2014)


    You doing everything wrong. Where is the DDL? That is minimal Netiquette in SQL forums. Is this all INTEGER math? I hope not! But that is what your coalesce...

  • RE: Using COALESCE and also trying to multiply and divide

    SQL Server has a feature called computed columns that could be very useful here. Basically you can create a virtual column based on a computation, and it becomes effectively...

  • RE: Trigger or Not Trigger

    LutzM (9/3/2014)


    One of the issues when using triggers to audit changes is the ability to disable the trigger, apply the change and re-enable the trigger.

    Without any audit for DDL changes...

  • RE: Trigger or Not Trigger

    Triggers can capture the originating user as well if you provide that info to the trigger. This can be passed in several ways, including CONTEXT_INFO, APP_NAME or even a...

  • RE: Index analysis

    Agreed, there's no easy way to tell if an index has extra columns. You can use the missing index stats to get a feel for missing column(s) though. ...

Viewing 15 posts - 5,821 through 5,835 (of 7,616 total)