Viewing 10 posts - 1 through 11 (of 11 total)
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...
October 5, 2015 at 7:48 am
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 ...
August 24, 2015 at 9:26 am
What a great hack! It solves a problem that I've had shelved for some time now.
Thanks, Keith!
October 29, 2014 at 11:14 am
Ah. Another human SQL parser error. The text() as a red herring alias really worked well.
Thanks, Raul.
October 29, 2014 at 9:09 am
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...
October 29, 2014 at 9:05 am
SELECT
SUBSTRING(Ms, 1, DATALENGTH(Ms)/ 2 - 1)
FROM
( SELECT
DepartmentName + ';' AS [text()]
...
October 29, 2014 at 8:28 am
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...
September 30, 2014 at 10:03 am
Perhaps this:
SELECT val, SUBSTRING(val,1,CHARINDEX('.', val)+1)+'%'
FROM (VALUES ('99.87'), ('99.96'), ('8.67')) sampledata(val)
September 17, 2014 at 8:59 am
Perhaps this:
SELECT val, SUBSTRING(val,1,CHARINDEX('.', val)+1)+'%'
FROM (VALUES ('99.87'), ('99.96'), ('8.67')) sampledata(val)
September 17, 2014 at 8:56 am
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 =
(
...
January 24, 2013 at 8:15 am
Viewing 10 posts - 1 through 11 (of 11 total)