Forum Replies Created

Viewing 15 posts - 2,161 through 2,175 (of 4,080 total)

  • RE: Linked Server - Update Query Not Working

    FROM SQLSERVER.SourceDatabase.dbo.Employee_Master Employee_Master

    INNER JOIN DestinationDatabase.dbo.Prempl Prempl ON CONVERT(int,Employee_Master.Empno) = Convert(int,Prempl.fempno)

    WHERE Prempl.fempno IS NULL

    What is performance like on the base query, that you say is running? ...

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: grouping case statements

    Yes, I know 😀

    GROUP BY z.ZipCode, z.CountyName

    Zip codes are just convenient distribution areas for the federal postal service. Counties are governmental boundaries defined by the states. ...

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: Can you put a declare statement in a view?

    It seems to me that this came up in another thread this spring, but I can't recall now whether the functions being compared to their stored proc counterparts were ITVFs...

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: Can you put a declare statement in a view?

    Yes, there is a world of difference between inline table-valued functions and multi-statement table-valued functions. I believe that stored procedures execute faster than ITVFs, but dang if the...

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: IDENTITY Columns, INSERT INTO, and ORDER BY

    This is unreliable under SQL2000. See here.

    The identity values that are generated depend on the position of the GetIdentity() function in the query tree (showplan), which may...

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: How to get the rest of top 5 records?

    I can't find any contrary authority to that, and I hadn't realized what parallelism would do to the IDENTITY function, so let's play it safe. Here is a...

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: Can you put a declare statement in a view?

    Steve is right, sorry I forgot to mention that.

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: How to get the rest of top 5 records?

    Hey Seth,

    From somewhere I got the idea that by using an ORDER BY in the load of data to the temp table, I was in fact making sure the...

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: Query out parameter

    You need to examine the final query which is to be executed. It is obviously returning no rows when it runs. I can't see your...

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: Can you put a declare statement in a view?

    Dave's right. What you are doing is usually done in a stored procedure. You can direct output from the stored procedure to a table using...

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: Datetime Problem

    You've been watching Johnny Depp in "Charlie and the Chocolate Factory" haven't you? 😛

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: How to get the rest of top 5 records?

    Couldn't test these, but the idea is to make one pass to take your totals and store them in a temp table that has a sequence number you can test....

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: Datetime Problem

    Even a blind squirrel finds some nuts, Jack. 😀

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: @@INDENTITY; SCOPE_IDENTITY() or OUTPUT INSERTED.[column]

    You say "probably" heaviest, which means you haven't tested it.

    Why not set up a test of 100000 inserts into a dummy table and see how much...

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: Datetime Problem

    The most efficient in terms of CPU cycles is probably the following:

    dateadd(day,datediff(day, 0,getdate()),0)

    This strips hours, minutes, seconds and milliseconds from the date. Just replace GETDATE() with the name...

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

Viewing 15 posts - 2,161 through 2,175 (of 4,080 total)