Forum Replies Created

Viewing 15 posts - 466 through 480 (of 8,416 total)

  • RE: Weird Parameterized Query Behavior

    david.castillo4 (5/30/2012)


    So for future queries where I am using declared variables I should include "recompile" as in below right??

    If a good enough query plan depends sensitively on the parameter value,...

  • RE: Multiply two columns in SQL nd store

    vinu512 (5/30/2012)


    You can use a CTE to update your table as follows:

    No! Try that with this data:

    Insert Into Ex1(id, product, price, qty) Values(1, 12, 13, 3)

    Insert Into Ex1(id, product,...

  • RE: Figuring out NSF payments

    Recursive solution (updated):

    -- Important index (could also cluster on ID_CASH_TRAN, ACCT_NUM, TS_PMT)

    CREATE UNIQUE INDEX

    [UQ dbo.PAYMENTS ID_CASH_TRAN, ACCT_NUM, TS_PMT (AT_PMT, CD_PMT_SRC)]

    ON dbo.PAYMENTS

    (ID_CASH_TRAN,...

  • RE: Update Recursively

    DECLARE @Sample AS TABLE

    (

    id_task integer NOT NULL PRIMARY KEY CLUSTERED,

    id_parent integer NULL,

    value...

  • RE: Multiply two columns in SQL nd store

    Stewart "Arturius" Campbell (12/15/2011)


    if there is need (e.g. the column to be indexed), you could even PERSIST said calculated column

    Precise and deterministic computed columns can be indexed without marking them...

  • RE: May affect "CardinalityEstimate" in Plan Estimate - What would be the fix for this?

    isuckatsql (5/30/2012)


    Type conversion in expression (CONVERT(varchar(20),[p].[InputDate],0)) may affect "CardinalityEstimate" in query plan choice.

    The warning is probably not too important in this specific case, but you should try to specify date/time...

  • RE: Weird Parameterized Query Behavior

    The execution plans look superficially the same, but they are quite different in the details.

    The first query plan (using a literal string value) is based on the specific LastName value...

  • RE: Clustered Indexes

    ScottPletcher (5/30/2012)


    It claims it does, but seems to work only under certain conditions.

    Sounds interesting, do you have a repro?

    edit: On reflection, I wonder if you saw this behaviour with TF...

  • RE: Question on REPLACE function

    REPLACE will replace all occurrences of the search string, which may not be what you want. One way to replace just the first occurrence is to use STUFF instead....

  • RE: Clustered Indexes

    ScottPletcher (5/30/2012)


    Personally I don't like SQL's mixed extents, but I can't really prevent it. The relevant trace flag helps some, but it's not 100%.

    TF 1118 removes almost all allocations...

  • RE: Clustered Indexes

    opc.three (5/30/2012)


    ... It sounds fairly consistent with yours and given that you have a much deeper knowledge in this area I take comfort in that.

    Ha well I don't know about...

  • RE: Bulk Insert Use a format file stored in SQL

    opc.three (5/30/2012)


    Nice paper, I can tell a lot of work went into producing it, but I have a few issues with it.

    You should comment on Alberto's blog and discuss it...

  • RE: Generating n-Tuples with SQL

    ChrisM@Work (5/30/2012)


    This quaint snippet runs in (only) about 40% more time than the usual inline CTE tally table - which is itself no longer the fastest kid on the block.

    Hey...

  • RE: identity gaps

    shilpaprele (5/30/2012)


    in syabse we faced an issue that when server was resatrted before stopping the service there was jump in identity value.

    This can happen with SQL Server too. Be...

  • RE: Bulk Insert Use a format file stored in SQL

    ashley.wardell (5/30/2012)


    Or maybe write a new bulk insert CLR.

    I've seen this done before, and it worked very well using SqlBulkCopy. You might be tangentially interested in http://sqlblog.com/blogs/alberto_ferrari/archive/2009/11/30/sqlbulkcopy-performance-analysis.aspx

Viewing 15 posts - 466 through 480 (of 8,416 total)