Home Forums SQL Server 7,2000 T-SQL Generate MAc addresses with a stored procedure RE: Generate MAc addresses with a stored procedure

  • so you need to generate just under a million rows;

    here's how i did it:

    DECLARE @StartRange BINARY(8)

    DECLARE @EndRange BINARY(8)

    SET @StartRange = 0x00000004A500114B

    SET @EndRange = 0x00000004A50F11FF

    --select convert(integer,+ @EndRange) - convert(integer,+ @StartRange) = 983220

    select convert(BINARY(8),RW + convert(integer, @StartRange))

    from

    (select row_number() over(order by a.id) As RW from syscolumns,syscolumns a,syscolumns b ,syscolumns c) b

    where RW between 1 and (convert(integer, @EndRange) - convert(integer, @StartRange))

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!