Forum Replies Created

Viewing 15 posts - 2,131 through 2,145 (of 6,036 total)

  • RE: SQL Calculation

    It does not do it for me.

    Can you post your actual data to use with the test script above?

  • RE: DELETE against same table that has INSERTS

    JP10 (2/7/2013)


    Any other concerns do you guys see that I am missing?

    Do not shrink transaction log file.

    Just empty it by running log backup, but do not shrink it.

    Release/alocate space on...

  • RE: NOT makes query never complete?

    holyforce (2/1/2013)


    SELECT *

    FROM

    (

    SELECT CASE WHEN cus_no IN ('1','2')

    AND product_type <> 'BIKE' THEN 1 ELSE 0 END AS the_column

    FROM [aforementioned tables]

    ) subq

    WHERE the_column = 1

    Run just the inner subquery, it...

  • RE: Antipathy for Entity Attribute Value data models

    long_shanks64 (1/23/2013)


    The 'alternative' is to model all known attributes correctly in the first place using declarative referential integrity and constraints.

    Sometimes it's just not possible.

    Classic example is recording addresses.

    Here in NZ...

  • RE: Get distinct value

    SELECT p.ProductID,

    CASE WHEN R1.FirstProductID IS NULL and R2.SecondProductID IS NULL then 'Not Linked' ELSE 'Linked' END Relation

    FROM @product p

    LEFT JOIN @ProductRelation R1 ON R1.FirstProductID = p.ProductID

    LEFT JOIN...

  • RE: Indexed Views - why don't they improve performance?!!!!

    Gazareth (1/23/2013)


    If you change your indexed view definition to:

    CREATE UNIQUE CLUSTERED INDEX [idxTest] ON [dbo].[withClusteredIdx]

    (

    [yy] ASC,

    [mm] ASC,

    [Reference] ASC,

    [MPAN] ASC,

    [ElementID] ASC

    ) go

    I think you'll see this view being used in...

  • RE: How Can I know calling procedure origin?

    You may use @@NESTLEVEL.

    If the proc is called from outside @@NESTLEVEL will be = 1.

    If it's called from another procedure it will be 2 or more.

  • RE: where fldValue=123 vs join to table with one row

    souLTower (1/24/2013)


    That helps but still doesn't explain why the

    where IN (sub select)

    has such a different execution plan than

    WHERE IN (constants)

    What I've done to improve the performance (and I'm not...

  • RE: No Wildcards Characters

    zombieisdead2020 (1/22/2013)


    How can I fix the first query?

    You do not need escape the closing square brackets.

    This should work:

    Declare @string varchar(50) = 'abcd [[% SQL Server %]]' -- Matched

    /* LIKE...

  • RE: How can we calculate Age of employee?

    r_slot (1/23/2013)


    The following combinations give a negative result

    What are you using?

  • RE: How to Make Scalar UDFs Run Faster (SQL Spackle)

    Can't believe it.

    Turn out the SQL2000 solution is not that straight forward.

    Or, should I say, is very limited.

    If we change the function a little bit:

    CREATE FUNCTION dbo.TimesN

    ...

  • RE: Antipathy for Entity Attribute Value data models

    Eric M Russell (1/21/2013)


    I still don't see the practical benefit of seperating phone / fax numbers from emails and twitter accounts.

    There were no twitter accouns several years ago.

    Database designed using...

  • RE: Antipathy for Entity Attribute Value data models

    Using SQL_variant data type for Value sends half of the article's concerns to rubbish.

    Including data size calculations.

    Filtering by comparing to a datetime value will show only records having datetime base...

  • RE: How to Make Scalar UDFs Run Faster (SQL Spackle)

    Jeff Moden (8/5/2012)


    mmilodragovich (8/1/2012)


    Thanks for the detailed and METHODICAL analysis. I once was troubleshooting a performance problem in a large, complicated application and it came down to a "set...

  • RE: determine if any error occurs in trigger from out of trigger

    In a trigger it's pretty easy to check if the data could cause PK violation prior to running INSERT.

    And divert execution if that's the case.

    Or exclude the data which may...

Viewing 15 posts - 2,131 through 2,145 (of 6,036 total)