Forum Replies Created

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

  • RE: BASE64 Encode and Decode in T-SQL - optimized

    Fixed version below.

    -- Original functions Created By Daniel Payne

    -- Modified by Aaron West, tallpeak@hotmail.com

    -- About 3X encode speed, 7X decode speed for 'Hello World'

    -- Fixed a bug...

  • RE: BASE64 Encode and Decode in T-SQL - optimized

    Remove whitespace before calling the function. Use SUBSTITUTE

    If you uncomment this code it would return null:

    --IF @encoded_text COLLATE LATIN1_GENERAL_BIN

    -- LIKE '%[^ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=]%'

    -- COLLATE LATIN1_GENERAL_BIN

    -- RETURN NULL

    try:

    ...

  • RE: My Own Custom Table Partitioning

    I know this whole subject may have been beaten to death, but I don't buy the argument that 64-bit integers are a big cost. I would estimate less than 1%...

  • RE: My Own Custom Table Partitioning

    It seems to me any custom partitioning method for a new system which isn't even built yet is premature optimization. Now perhaps learning the techniques of partitioning is best done...

  • RE: search time ~18 seconds in a 5Gb DB

    The multiplications (column * 1) are only in the SELECT column list, not in the WHERE clause or the JOINs, so they should have no effect on what indexes (indices)...

  • RE: search time ~18 seconds in a 5Gb DB

    I think SSMS makes creating full-text indexes easier, through its wizard. You will need to change your queries to use proper full-text search syntax with CONTAINS, eg:

    CONTAINS(column,'"term1" AND "term2" AND...

  • RE: 8.5 million records 9 indexes

    The script as designed only shows actively-running SQL batches with high CPU (greater than 1 second), so you'll need to find a slow-running batch to test it.

  • RE: 8.5 million records 9 indexes

    I believe the parent is the complete SQL text. Here's a fun script I run sometimes, which writes an HTML to the local filesystem and opens it in Internet Explorer,...

  • RE: Avg. Disk Queue Length from 0.025 to 310.8 to 0.025

    Make sure DMA is enabled on the drive, if it's an IDE/EIDE drive. I used to check by timing a copy of a large file; on modern (say 80GB and...

  • RE: CPU - Quad Core or Not

    I would probably go for a quad core and minimum of about 4GB RAM for any SQL server I were to build, or dual-core if I have some reason to...

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

    For multiple fields, you could retrieve the concatenated chunk in a subquery, then break it into pieces in the parent query.

    Instead of Peter's technique, I think you could use TOP...

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

    There's a method of converting everything to strings, then finding the MAX, then separating out substrings and casting back as necessary. It can be rather cumbersome for multiple columns, however....

  • RE: Need help developing quick way to search millions of records...

    I've had an idea for this sort of situation that I've never implemented, but I think should work well: turn all searches into text-searches (CONTAINS). Create keywords for range queries....

  • RE: TSQL Loop to Select Top 2 Records for each iteration

    SQL 2005 row_number might help:

    --top 2 Biggest orders by salesperson

    SELECT rank, SalesPersonID, SalesOrderID, TotalDue

    FROM (SELECT CAST(ROW_NUMBER()

         ...

  • RE: Binary_Checksum

    I'll add that I experimented with the checksum functions and am disappointed. Something like CRC would be much better, and even a simple shift-and-add would work much better.

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