Forum Replies Created

Viewing 15 posts - 5,791 through 5,805 (of 7,597 total)

  • RE: How to disable and enable the store procedure?

    The problem with a table is that one option must apply to everyone. Parameter or other methods allow customized runs, so that your own special cases can still run...

  • RE: How to disable and enable the store procedure?

    Eirikur Eiriksson (9/15/2014)


    ScottPletcher (9/15/2014)


    All of those seem far too disruptive to me.

    Two quick possibilities:

    1) Add an optional parameter to the proc which requires a certain value or the proc just...

  • RE: SQL Query Taking Too Long

    That GROUP BY is gonna kill your performance. See if the code below is close to what you need.

    I've added clustered indexes on the temp tables prior to loading...

  • RE: Missing Indexes Table

    You can't consider missing index info in isolation. At the very least, you also need to look at index usage stats. Both of those are the minimum needed...

  • RE: which insert is faster? with identity_insert on or identity_insert off

    The big delay is likely in allocating and formatting log space, not in the identity number assignment, which is trivial.

    Thus, before you run the big INSERT, pre-allocate sufficient log space...

  • RE: How to disable and enable the store procedure?

    All of those seem far too disruptive to me.

    Two quick possibilities:

    1) Add an optional parameter to the proc which requires a certain value or the proc just exits (or does...

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

    Luis Cazares (9/11/2014)


    Your little example is really nice, real life isn't like that.

    Please find the errors in the following code:

    INSERT INTO dbo.FactInternetSalesCopy

    (ProductKey, OrderDateKey, DueDateKey, ShipDateKey, CustomerKey,...

  • RE: where id <> 3 skips NULL value

    thomashohner (9/9/2014)


    I'm a noob but Predicates only evaluate to TRUE. Also NULL is not a value. Query 3 is correct as far as my very limited knowledge goes.

    So it skips...

  • RE: Adding File

    Most likely is that a database backup is in progress, and you can't alter the database files during a backup. Check running processes for a backup, dbcc check, or...

  • RE: linked server - delete hangs

    EXEC ('DELETE FROM onedb.stg.tab1') AT [linkserv]

  • RE: How to Round a date to the nearest second

    You'll also need to decide if you're willing to allow the rounding to change the day/date or not. That is, if the time is, say, "20140908 23:59:59.670", do you...

  • 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...

Viewing 15 posts - 5,791 through 5,805 (of 7,597 total)