Forum Replies Created

Viewing 10 posts - 1 through 10 (of 10 total)

  • RE: The Work of the Ancients

    One database that I'm working with has been in continuous use since SQL Server 7 in 1999. The major app on top of it has been totally rewritten 5...

  • RE: SET TABLE VARIABLE FROM FUNCTION CALL

    As to your question...

    Looks like table types will work with table variables to get to what you're after:

    CREATE TYPE ttypeTestTab AS TABLE (

    TABLE_CATALOG ...

  • RE: Formatted output

    What a great hack! It solves a problem that I've had shelved for some time now.

    Thanks, Keith!

  • RE: Formatted output

    Ah. Another human SQL parser error. The text() as a red herring alias really worked well.

    Thanks, Raul.

  • RE: Formatted output

    Sometimes my skills as a SQL parser could be a bit more...thorough.

    I missed the leading "N" in DepartmentName's definition.

    Your explanation makes great sense--now knowing that it...

  • RE: Formatted output

    SELECT

    SUBSTRING(Ms, 1, DATALENGTH(Ms)/ 2 - 1)

    FROM

    ( SELECT

    DepartmentName + ';' AS [text()]

    ...

  • RE: While loop Testing

    I couldn't get PRINT to show the entire script. This really bugged me -- I had to see it. For those who are also morbidly curious about trivial...

  • RE: display values upto 1 decimal without function.

    Perhaps this:

    SELECT val, SUBSTRING(val,1,CHARINDEX('.', val)+1)+'%'

    FROM (VALUES ('99.87'), ('99.96'), ('8.67')) sampledata(val)

  • RE: display values upto 1 decimal without function.

    Perhaps this:

    SELECT val, SUBSTRING(val,1,CHARINDEX('.', val)+1)+'%'

    FROM (VALUES ('99.87'), ('99.96'), ('8.67')) sampledata(val)

  • RE: Reverse string without built in functions

    Just modify the next iteration call a bit, and the recursive solution works:

    ALTER function dbo.StringReverse

    (

    @InString varchar(20)

    )

    returns varchar(20)

    AS

    begin

    declare @RevString varchar(20)

    IF len(@InString) in (0,1)

    set @RevString = @InString

    ELSE

    set @RevString =

    (

    ...

Viewing 10 posts - 1 through 10 (of 10 total)