Forum Replies Created

Viewing 15 posts - 1,426 through 1,440 (of 2,171 total)

  • RE: 10 Top 1 rows chosen at random

    NEWID() is guaranteed to be unique within the database.

    This gives two hints. Date and Time is involved and so is the Database name.

    Others are (by rumour) MAC address, bios information...

  • RE: 10 Top 1 rows chosen at random

    We have to wait for OP to return with results.

    And about NEWID() as random generator? We have had several tests (incluing me, Jeff and Michael) to see if ABS(CHECKSUM(NEWID())) generated...

  • RE: patindex in datetime field

    DATETIME is a FLOAT? Since when?

    I thought DATETIME was a 64-bit binary integer value, where the lowest four bytes is the data portion, and the higher 4 bytes is the...

  • RE: 256 byte long value in varchar field returns 255 bytes and a 0

    Yes, when I used ODBC 256 characters was the default max length of returning strings.

    Changing to the newer OLEDB solved that problem.

     

  • RE: Row_number() in SQL 2000 ...

    Well, the sample data was ordered so I thought this was the case in production environment.

    Now OP finally seems to have released all information necessary.

     

  • RE: Row_number() in SQL 2000 ...

    -- Prepare sample data

    DECLARE    @Sample TABLE (RowID INT IDENTITY(1,1), col1 int, col2 int)

     

    INSERT     @Sample

    SELECT     1, 1 UNION...

  • RE: Word count

    And the wonder of Google cache!

    Hi,

    I was hoping somone could help. I need to count the number of words in a specfic column in a table if i didn'rtknow...

  • RE: Word count

    The magic of post editing...

     

  • RE: Calcuating median values

    select  bookingsource,

      bookingtype,

      operatingunit,

      avg(dailyrate) as average

    from  (

       select bookingsource,

        bookingtype,

        operatingunit,

        row_number() over (partition by bookingsource, bookingtype, operatingunit order by dailyrate) as sort_asc,

        row_number() over (partition by bookingsource, bookingtype, operatingunit order by dailyrate desc) as sort_desc,

        dailyrate

       from testmedian2

     &nbsp

  • RE: Cursor for update result in loop...

    DECLARE

    @TCOUNT INT,

    @BARCODE VARCHAR(100),

    @NEWBARCODE VARCHAR(100)

    BEGIN

    DECLARE CFB CURSOR FOR

    SELECT BARCODE FROM FOLDERSBOX ORDER BY RECORDID FOR UPDATE OF BARCODE;

    OPEN CFB

    FETCH FROM CFB INTO @BARCODE

    WHILE @@FETCH_STATUS = 0

    BEGIN

    EXEC [dbo].[SPGetNextSequence] @TABLENAME = N'FOLDERSBOX',...

  • RE: 10 Top 1 rows chosen at random

    Running Carr's suggestion reveals that the movies are always the same for every genre.

    Why? Because there is a clustered index on MovieID. That means that TOP 1 always return the...

  • RE: table datatype Problem

    I don't think you can reseed table variables.

    CREATE

    table #table (primary_key INT IDENTITY(1

  • RE: best practice for returning when matching a MAX()

    SELECT     d.TopicID,

               d.LastPosterID,

               d.PostDate

    FROM       (

                          SELECT     TopicID,

                                     LastPosterID,

                                     PostDate,

              ...

Viewing 15 posts - 1,426 through 1,440 (of 2,171 total)