Forum Replies Created

Viewing 15 posts - 6,811 through 6,825 (of 6,831 total)

  • RE: design question for "master" Item data structure

    All those LEFT JOINs will kill your performance.

    But, would you really ever need to process the Item master table?  Wouldn't you be more likely to be processing the Applications, etc.,...

  • RE: Effects of encrypting stored procedures

    I would think that the first time the proc is run, and any future time that it has been paged out of the cache, there will be more overhead for...

  • RE: A Fix() Function in T-SQL

    Very sweet!

    But why the extra overhead of declaring and setting a variable?  Why not just return the calc'd value?

    ...

    BEGIN

    RETURN CASE WHEN ...

    END

  • RE: Performance on full table scans

    Make sure the table is not fragmented.  You will have to add an index to check and/or adjust fragmentation.  Once the table is compacted, if necessary, you can drop the...

  • RE: group by 1/2 hour

    The method below creates and loads a table data type to hold the desired datetime ranges.  The defaults are as you specified -- from 17:00 the previous day to 17:00...

  • RE: Help me: position of column instead of name or alias column name

    If you want to check the identity column specifically, you can use the reserved name IDENTITYCOL, which will always refer to the identity column of any table:

    SELECT * FROM tableName

    WHERE...

  • RE: Database Commenting Guideline

    What about the overhead of the comments themselves?  This if often overlooked.  It's my understanding that SQL does load comments (even full-line/multi-line comments) into the proc cache.  So lots of...

  • RE: Generating a Sequential Pattern

    One of my concerns with a sequence table, aside from the additional I/O and other overhead, is that you cannot then easily insert multiple invoices in one statement. 

    If, for example,...

  • RE: Generating a Sequential Pattern

    >> "SET IDENTITY_INSERT ON" would be needed for prior year, with logic similar to above, but hopefully that would be relatively rare. <<

    In fact, in most systems, especially dealing with...

  • RE: Generating a Sequential Pattern

    Yes.  Or possibly even a single identity column that was re-seeded each year to yy00000[0]; the "-" could be added prior to display just for the "visual effect" for the user. ...

  • RE: Practical Uses of PatIndex

    Don't see any need for the "IF" at the start of the function.  I wrote an almost identical function for this purpose but with just the WHILE.

  • RE: check that a column exists or not on a table

    To check for existence of a column, don't think you need to do a system table query at all, just use a built-in SQL function:

    IF COL_LENGTH ('tableName', 'columnName') IS NULL

        --column...

  • RE: TSQL question

    DECLARE @v VARCHAR(200)

    SET @v = 'http://www.google.com/intl/en/images/logo.gif'

    SELECT SUBSTRING(@v, CHARINDEX('//', @v) + 2, CHARINDEX('/', @v, CHARINDEX('//', @v) + 2) - (CHARINDEX('//',

  • RE: Self selects galore - better way? subselects?

    Something like this should perform *much* better

     

    SELECT     a.procid, b.[ClientName] AS CName, b.[CompanyName], b.[CustRefNum] AS CRef,

                      b.[JobNumber] AS JNumber, --...,

                         b.[County] AS RCounty

    FROM      ...

  • RE: Question of the Day for 02 Jun 2005

    When you run code #1, it actually does seem to work, although I'm not exactly sure why it would.  Since punctuation falls within that range, it really shouldn't.  You can run...

Viewing 15 posts - 6,811 through 6,825 (of 6,831 total)