Forum Replies Created

Viewing 15 posts - 901 through 915 (of 1,229 total)

  • RE: Strange performance boost by query rewrite

    I'd try adding IvTo to that clustered index on IvFrom. Guessing wildly, both versions of the query would take about the same time, and rather less than you're currently getting....

  • RE: SET ROWCOUNT

    This...

    SET ROWCOUNT 2;

    INSERT INTO #Test_Rowcount (Value)

    SELECT TOP 4 * FROM (

    SELECT 'One' V UNION ALL ...

  • RE: Update table with values from the same table

    Hi Martin, sorry for not making it sufficiently clear. What I'm after is data in both tables, and your query, to replicate your findings. So...

    INSERT INTO Company ([columnlist]) VALUES ([Valuelist])

    INSERT...

  • RE: Diagonal matching of data (wanted vlookup like concept in sql)

    -- Correct result, dodgy logic

    (SELECT *

    FROM #TABLE1

    EXCEPT

    SELECT * FROM #TABLE2)

    UNION ALL

    (SELECT *

    FROM #TABLE2

    EXCEPT

    SELECT * FROM #TABLE1)

    -- correct result, correct logic

    SELECT t1.*

    FROM #TABLE1 t1

    WHERE EXISTS (

    SELECT 1...

  • RE: Opinion on working for small company, directly for owner(s)

    Dorian Gray (4/21/2011)


    I'm still stuck on "higher steaks" - would that be rare, medium or well done?! :hehe:

    ps: Sorry - couldn't resist. I'd say go with your gut instinct. Typically...

  • RE: Opinion on working for small company, directly for owner(s)

    You will get a wide range of responses from folks who've been in this position. Here's my experience, from being there twice in 20 years of contracting.

    If you don't mind...

  • RE: Can I add extra columns to CTEs

    v-anand (4/21/2011)


    Hello all,

    I need to create a temporary table so as to do some calculation.

    For example there is a table named Product having columns -ProductID, ProductName, Price and there is...

  • RE: Update table with values from the same table

    Also, INSERT statements to create data in both tables which will generate this result:

    CompanyName StreetNumber StreeName StreetType Suburb Postcode State

    123 Acc Brisbane 4000 QLD

    123 Acc 123 Pitt Street Brisbane 4000...

  • RE: procedure not define - Begin Trans and commit trans (urgent)

    ananda.murugesan (4/21/2011)


    Hi ChrisM,

    In SQL SERVER 2000.

    Blocked process not clear after restarting SQL SERVICES, please tell me what could be reason? once restart the service all transaction will be terminated...

  • RE: Sql doubt

    Dynamic SQL isn't necessary:

    ALTER PROCEDURE dbo.MyTest

    AS

    SELECT TOP 10 [name] FROM sys.columns ORDER BY [name]

    RETURN 0

    GO

    CREATE TABLE #ColumnNames ([name] VARCHAR(200))

    INSERT INTO #ColumnNames ([name]) EXEC dbo.MyTest

    SELECT * FROM #ColumnNames

  • RE: TSQL Logic help needed-- Nested IF

    David Burrows (4/21/2011)


    Jeff Moden (4/20/2011)


    If we don't know the length, then we can force the max length for positive BIGINTs and simply remove all spaces afterwards.

    Also if you append the...

  • RE: procedure not define - Begin Trans and commit trans (urgent)

    Hi Ananda

    Your first point - rewriting the code - if the code you posted is a representative sample then I'd agree. Find the worst-performing code and begin there. Grant Fritchey...

  • RE: procedure not define - Begin Trans and commit trans (urgent)

    Hi Ananda

    Let's have a closer look at that stored procedure. It's a series of DELETE/INSERT statements separated by conditionals - depending on what's already in the db, one of them...

  • RE: Update table with values from the same table

    Hi Martin

    Please can you post CREATE TABLE statements for both tables. Some sample data for each would be awesome. Also, the simple query which returns:

    CompanyName, StreetNumber, StreeName, StreetType, Suburb, Postcode,...

  • RE: Return 0 From Function

    Michael Valentine Jones (4/20/2011)


    ChrisM@home (4/20/2011)

    ...

    @michael-2 - I can't believe you posted that!

    I'm just hoping to see someone use it in production code. :satisfied:

    Actually, I started wondering if a function...

Viewing 15 posts - 901 through 915 (of 1,229 total)