Forum Replies Created

Viewing 15 posts - 406 through 420 (of 482 total)

  • RE: unique column in 2 tables - interesting problem

    I just want to know how the app knows which of the two tables to insert.

  • RE: unique column in 2 tables - interesting problem

    How about 1 parent table A with identity, 2 child tables with foreign key and check constraints: table B, all the ids must be divisible by 2 with...

  • RE: Order a varchar field

    Here's the correct version (single column in select, ordering not by ordinal position - is that still to be deprecated?)

    SELECTcVal

    FROM #tmp_holding

    ORDER BY CONVERT(INTEGER, STUFF(cVal, 1, PATINDEX('%[0-9]%', cVal) -1, '')), cVal

    P

  • RE: Order a varchar field

    Try this:

    SELECTcVal, CONVERT(INTEGER, STUFF(cVal, 1, PATINDEX('%[0-9]%', cVal) -1, ''))

    FROM #tmp_holding

    ORDER BY 2, 1

    HTH,

    P

  • RE: Need script to UPDATE 1000 Rows then COMMIT, Iteratively

    Jeff,

    VERY COOL!!!!

    Never seen that UPDATE...SET construct before.

    Not so fast here, tho, took 1m11s.

    Thanks,

    Paul

  • RE: Convert to For/Next

    You say this is called from an update trigger, and then give an example involving one 1000 row insert (or 1000 single row inserts). Either way, unless the trigger is...

  • RE: Same changes on many databases

    Save all your changes in a script file, then cursor through your DBs calling OSQL using xp_cmdshell.

  • RE: Alter Table

    Michael,

    You're too funny!!! You say we're not here to preach, yet you're preaching at me!!!!

    I just read your solution to the original question: update syscolumns????? IMHO, that's preaching suicide....

  • RE: Alter Table

    Michael,

    In that case, it's not the ordinal position that breaks things, it's the poor code.

  • RE: Alter Table

    The ordinal position cannot matter. If you want to see columns in a specific order, select them in that order.

  • RE: How to compare text columns

    Hmmn, I put the greater-than / less-than brackets in last post, they were stripped out....

    WHERE CHARINDEX(The_Text, TextCol) = 1

  • RE: How to compare text columns

    Not especially efficient, but you can do

    WHERE CHARINDEX(, ) = 1

  • RE: Poor Performance Query

    Also, make sure your variable datatypes match up to your column datatypes. This has oft been reported as the cause of performance degradation between 7 and 2000.

  • RE: Help! - Removing non-alpha and spaces from a field script..

    Try this function.

    @cStripPat is the chars to remove. In your case, '%[^a-zA-Z]%'

    HTH

    P

    IF OBJECT_ID('dbo.ufn_XU_PatStrip') IS NOT NULL

    DROP FUNCTION dbo.ufn_XU_PatStrip

    GO

    CREATE FUNCTION dbo.ufn_XU_PatStrip

    (@cStringNVARCHAR(4000),

    @cStripPatNVARCHAR(4000))

    RETURNS NVARCHAR(4000)

    AS

    BEGIN

    DECLARE @nposINTEGER

    SELECT @npos = PATINDEX(@cStripPat, @cString)

    WHILE @npos...

  • RE: Sql Sever Installation

    If you can see it in programs, but not in services, likely you've only installed the client tools.

    Look for file named master.mdf on local drives. If it's there, you may...

Viewing 15 posts - 406 through 420 (of 482 total)