Forum Replies Created

Viewing 15 posts - 1 through 15 (of 413 total)

  • RE: Performance of joins across filegroups

    Thanks everyone, I learned a lot

    The idea was to place the file groups on different disks as the new table B will become...

  • RE: Performance of joins across filegroups

    Sounds reasonable, although I suspected it was the other way round. Thanks.

     

  • RE: Finding Primes

    I have tested my code against Ryan's code on SQL Server 2000 and it seems to be equally fast (with the same output).

    If the Numbers table is preconstructed, I guess...

  • RE: Finding Primes

    My suggestion, on our SQL Server 2000 installation it finds all primes less than 5000000 in 54 seconds. But of course it depends on the hardware...

  • RE: Searching Syscomments Accurately

    I modified your last query a bit and obtained something that seems to be faster on SQL Server 2000:

    SELECT distinct O.Name, O.Type

    FROM

    (

     select

     s1.id,

     cast(coalesce(s1.text, '') as varchar(8000)) +

     cast(coalesce(s2.text, '') as varchar(8000))

     as [text]

     from...

  • RE: A Look at GUIDs

    Thanks for a great article, Andy. I am in the process of designing a client/server system (.NET and SQL Server 2000/2005) in which GUIDs are used as clustered primary keys throughout the...

  • RE: How many more Mondays until I retire?

    I believe the following function is faster than all the above suggested:

    CREATE FUNCTION dbo.fnSeqDates

    (

        @LowDate DATETIME,

        @HighDate DATETIME

    )

    RETURNS @Dates TABLE

            (

                SeqDate DATETIME

            )

    AS

    BEGIN

     DECLARE @Temp DATETIME

     DECLARE @NumberOfDays int

     IF @LowDate...

  • RE: How many more Mondays until I retire?

    Do you really need dates that old?

    You could use

    select datediff(d, '18000106', @dateTo)/7 - datediff(d, '18000107', @dateFrom)/7

    instead. Note that

    select datediff(d, '18000106', '1900-01-03')/7 - datediff(d,...

  • RE: How many more Mondays until I retire?

    No, no, use the formula above:

    select datediff(d, '19000101', '20060724')/7 - datediff(d, '19000102', '20060717')/7

    returns 2, i.e 2 Mondays between the 17th and the 24th.

  • RE: How many more Mondays until I retire?

    Calculating the number of Mondays between two dates was the subject of the following thread:

    http://www.sqlservercentral.com/forums/shwmessage.aspx?forumid=8&messageid=258968

    My suggestion was the following:

    select datediff(d, '19000101', @dateTo)/7 - datediff(d, '19000102', @dateFrom)/7

    I still believe this...

  • RE: Stored Procedure Within Stored Procedure - Getting the result set

    It might also be a possibility to replace procedure B with a function that returns a table. It depends on what you are doing in procedure B. If you e.g...

  • RE: select not (value) in returno 0 row

    I agree with paramind, but would like to elaborate a little further (to help myself understand it better ). Consider the following queries...

  • RE: select not (value) in returno 0 row

    That's probably because

    select vendorref from intranet.dbo.mprod

    returns (among other things) a null value

     

    Try this instead:

    select * from appmis.cambio_icg.dbo.nuevos_productos_ingram_temp

    where not partno in(select vendorref from intranet.dbo.mprod where vendorref is not null)

  • RE: shipping system - stored procedure - self-referencing table

    ang, I still don't know what you want...

    Do you have a complete route from origin to destination (including all intermediate stops), and want...

  • RE: Passing a Table as a Parameter

    Why not simply create one temp table with the same structure, then add an InstanceId column to it? This column could be 1 for data in the first temp table,...

Viewing 15 posts - 1 through 15 (of 413 total)