Forum Replies Created

Viewing 15 posts - 57,031 through 57,045 (of 59,066 total)

  • RE: how to remove ''''bad'''' characters from field?

    Don't need it... N is the clustered Primary Key.  Yeah, I know what you're going to say...

    Anyway, the length in the substrings is hardcoded... surely you're not suggesting that I...

  • RE: how to remove ''''bad'''' characters from field?

    If you have a Tally table, here's a possible solution, as well...

     CREATE FUNCTION dbo.StripNonDigit(@Input VARCHAR(8000))

    RETURNS VARCHAR(8000)

         AS

      BEGIN

            DECLARE @Result VARCHAR(8000)

             SELECT @Result = ISNULL(@Result,'')

                 ...

  • RE: how to remove ''''bad'''' characters from field?

    Yep... I agree with Serquiy... if it's for an automatic dialer (or ever could be) or for humans to actually know whether it might be an international call just by...

  • RE: Stored Procedure + Parameter list

    True enough , Serqiy, but if you want to name variables for flexibility, it is an error to name them after the actual...

  • RE: Select top groups

    I'm with PW... I normally use "Derived Tables", as well.  And, I normally don't like correlated subqueries because they can be difficult to troubleshoot.  But their use seems appropriate just...

  • RE: Creating fixed-length tables

    Got a code example for this particular "keep last 50" problem so we can see what you're talking about?  I think you're talking about pre-assigning constants as variables which also...

  • RE: Stored Procedure + Parameter list

    Nicely done... although I do hope no one actually tries to pass a billion characters worth of parameters

    By the way... you hardcoded the 2's...

  • RE: how to remove ''''bad'''' characters from field?

    Some of the solutions on the link seem, well... a bit bulky...  I don't remember where I got it from but this works and it's nasty fast...

    USE NorthWind

    GO

     CREATE...

  • RE: Creating fixed-length tables

    No "error"... Think of it as an "interation step" "that I hope will never be changed in my lifetime"...

    ...unless you'd rather see...

    WHERE RowNum <=...

  • RE: Minimum of top two values

    This is SO much easier if you have a RowNum column....

    SET NOCOUNT ON

    DECLARE @MyTable TABLE

    (

    RowNum INT IDENTITY(1,1) PRIMARY KEY,

    ItemName VARCHAR(6),

    ItemNo  INT,

    ItemValue NUMERIC(20, 2)

    )

    January 19, 2007 at 11:52 pm

    #684498

  • RE: Logic to determine Gender based on FirstName

    Shoot.... in this day an age of supposed equal opportunity, why would you need to know?  Might even be against the law if it's for college admissions, for example...

  • RE: Insert #Temp Exec Server.Master.dbo.xp_fixeddrives

    The column names in the #Drives table must be the same as those returned by the xp.  You have FreeMB as one of the column names... you need to either...

  • RE: Creating fixed-length tables

    You might be able to do the count thing with a RowNum IDENTITY column... have the trigger delete...

    WHERE RowNum < IDENT_CURRENT('table_name')-49

  • RE: Parse delimited column into multiple records

    Stef,

    These types of problems are incredibly simple if you have the right kind of tools.  Fortunately, there is one tool that has tremendous utility as just such a tool.  It...

  • RE: String Manipulation Help

    I screwed up... that's what I get for late night programming... I don't know what on Earth made me think that @@ROWCOUNT would ever be a NULL.  If you want...

Viewing 15 posts - 57,031 through 57,045 (of 59,066 total)