Viewing 6 posts - 1 through 6 (of 6 total)
If you don't mind having an intermediate help table (temporary or otherwise) you could use something like this - FillList may even prove usefull.
/*
Create Table ItemBin (
Item varchar(80),
BinId...
June 5, 2003 at 6:07 am
nice one - efficient as well.
quote:
--Here is the function I was thinking of writing. It seems to work pretty well. It could...
May 28, 2003 at 11:32 am
does this qualify as surreal?
/*
assuming that all the elements are separated by a space ' ' and
the string is left justified (does NOT begin with a space)this should...
May 28, 2003 at 3:54 am
CREATE TABLE #test (ID INT, letr varchar(1))
INSERT INTO #test (ID, letr) VALUES(1, 'A' )
INSERT INTO #test (ID, letr) VALUES(2, 'A' ) ...
May 24, 2003 at 3:46 pm
This variation (using UNION) halves the number of table scans since you only need to scan each table once
create table Site (id int,CreateDate datetime,DateChgd datetime)
create table contact (id int,site_id int,...
April 16, 2003 at 12:34 pm
--try this
declare@WeekDays int,
@StartOnDate datetime,
@FinishOnDate datetime
select@StartOnDate = '04/05/2003',
@FinishOnDate = '04/28/2003'
select @WeekDays = DATEDIFF(day, @StartOnDate, @FinishOnDate)+1
- (1-abs(sign(1-datepart(weekday, @StartOnDate))))
- (1-abs(sign(7-datepart(weekday, @FinishOnDate))))
- DATEDIFF(week, @StartOnDate, @FinishOnDate)*2
-- result
select datename(weekday, @StartOnDate)StartOnDay, datename(weekday, @FinishOnDate)FinishOnDay, @WeekDays...
April 1, 2003 at 6:22 am
Viewing 6 posts - 1 through 6 (of 6 total)