Viewing 15 posts - 1,906 through 1,920 (of 1,957 total)
SELECT STUFF(a.[description],1,1,'')
FROM (
SELECT '/'+dbo.classstructure.description AS [description]
FROM dbo.classancestor
INNER JOIN dbo.classstructure
...
January 22, 2010 at 12:13 am
try something like this
SELECT STUFF(a.[description],1,1,'')
FROM (
SELECT '/'+dbo.classstructure.description
FROM dbo.classancestor
INNER JOIN dbo.classstructure
...
January 21, 2010 at 5:00 pm
If you do have to use a categories table (and I agree that you do), how about something like this,
which uses a categories table, but with a sort of...
January 21, 2010 at 4:56 pm
I think what the OP is getting at is a replacement for this structure:
--= some very high performance sql set based code
--....
--....
IF @result = 1
BEGIN
SET...
January 16, 2010 at 6:13 pm
There is no reason in sql why you cannot put a parameter in the WHERE clause...
..... WHERE Department=@Dept ...
for example as long as your reporting tool can handle that...
January 7, 2010 at 5:20 pm
--= set up some test data
declare @ids table(id int identity(1,1))
insert @ids default values
insert @ids default values
insert @ids default values
insert @ids default values
insert @ids default values
insert @ids default values
insert @ids...
January 7, 2010 at 5:14 pm
the execution plan says it all:
With the WHERE clause:
|--Filter(WHERE: (CONVERT(decimal(10,5),substring(CONVERT_IMPLICIT(varchar(max),'1.2,11.1,1,1,1.1',0),[Expr1006],charindex(',',CONVERT_IMPLICIT(varchar(max),'1.2,11.1,1,1,1.1',0)+',',[Expr1006])-[Expr1006]),0)>(1.00000) AND [Expr1006]<=CONVERT_IMPLICIT(bigint,CONVERT(int,len(CONVERT_IMPLICIT(varchar(max),'1.2,11.1,1,1,1.1',0)),0),0) AND substring(','+CONVERT_IMPLICIT(varchar(max),'1.2,11.1,1,1,1.1',0),[Expr1006],(1))=','))
Without the WHERE clause:
|--Filter(WHERE: ([Expr1006]<=CONVERT_IMPLICIT(bigint,CONVERT(int,len(CONVERT_IMPLICIT(varchar(max),'1.2,11.1,1,1,1.1',0)),0),0) AND substring(','+CONVERT_IMPLICIT(varchar(max),'1.2,11.1,1,1,1.1',0),[Expr1006],(1))=','))
The "s>1" predicate is being "inlined" into the string splitting function...
January 6, 2010 at 5:46 pm
select *
from names
where TheName like '%[ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ]%'
Why mess about with functions and stuff?
January 6, 2010 at 4:55 pm
Justin James (1/4/2010)
January 4, 2010 at 6:07 pm
Justin,
I think you may still have some work to do as the change you made will be excluding the final grouping - I think...
moving the ISNULL the way you have...
January 4, 2010 at 9:59 am
I agree that is HORRENDOUS!
If you can get away with a fixed query then do so.(One of the other examples)
If you have to cater for dynamic columns then let us...
January 4, 2010 at 7:11 am
Jeff Moden (1/1/2010)
January 1, 2010 at 11:51 am
Thanks Jeff, yet another built in function I have never noticed!
The problem with all of this of course is that you are leaving yourself in the hands of SQL and...
January 1, 2010 at 3:23 am
DECLARE @input decimal(17,3)
DECLARE @decs tinyint
SELECT @input=1234.123,@decs=2
SELECT
CASE WHEN @decs = 2 THEN CAST(CAST(@input as decimal(17,2)) AS VARCHAR(19))
WHEN @decs = 1 THEN CAST(CAST(@input as decimal(17,1)) AS VARCHAR(19))
ELSE CAST(@input AS VARCHAR(19))
END
SELECT CAST(@input...
December 31, 2009 at 11:34 am
For the sake of it, a solution which copes with new "ColumnName" values by using dynamic sql (go ahead - pork chop me or whatever you do :-D)
If you don't...
December 30, 2009 at 6:36 pm
Viewing 15 posts - 1,906 through 1,920 (of 1,957 total)