Viewing 15 posts - 61 through 75 (of 181 total)
Whenever possible, you should avoid putting 'functions' in the 'WHERE' clause. Things like 'convert', 'datediff', 'upper', etc.
It isn't a problem for small datasets, but can be for large datasets....
April 4, 2008 at 8:32 am
SteveH2455 (4/3/2008)
I have the following syntax within a cursor - (getdate() - getutcdate()) as date_Time,
Have you looked at what this returns...
select getdate()
select getutcdate()
select getdate() - getutcdate()
Execute that in Query...
April 4, 2008 at 6:26 am
Geeeshhh...stop whining already...
This was a fun question that made you think and do some research.
Don't make more out of it than that. If missing the question ruined your day,...
April 4, 2008 at 6:10 am
Very good point...
This is why many people use...
where somedate >= '04/01/2008' --target date
and somedate < '04/02/2008' --target date + 1
to get all records that...
April 3, 2008 at 11:15 am
OK, I'm feeling stupid here...
I knew the script 'select' was there, but for some dumb reason, I have been scripting the 'create' lately. Its as if I totally forgot...
April 2, 2008 at 11:19 am
If I need a 'select' that has a lot of columns, I'll script out the source table 'create', then manually edit out the extra stuff.
Deleting the extra is...
April 2, 2008 at 11:00 am
bill.humphrey (4/2/2008)
set @start_date = '24/07/2007 00:00:00'
I don't believe you need to add the time when setting your start_date, as that is implied...
'24/07/2007 00:00:00' = '24/07/2007' (when datatyped as datetime)
The...
April 2, 2008 at 8:34 am
Does the datetime field in the database have a time component? Or is the time 00:00.
If the time is not 00:00, you won't get a match.
[Edit: it won't...
April 2, 2008 at 6:00 am
bill.humphrey (4/2/2008)
where (dbo.cadcasedetails.dt_arrive is not null)and (priority_text = 'A')
and (dbo.cadcasedetails.report_date = @start_date)
order by timediff asc
If you are not getting an error and just getting no records, check that...
April 2, 2008 at 5:46 am
Shaun McGuile (4/1/2008)
SQL server 2000 is flawed and SQL server 2005 (mode 80) is flawed.Mode 90 SQL2005 implements SQL correctly therfore the correct answer is (d)!
I run a query in...
April 1, 2008 at 5:47 am
Since no version specified, I thought that wasn't an issue...WRONG!
This was a good exercise as it pointed out something that wasn't obvious.
I'm working on SQL 2000 right now...
March 31, 2008 at 6:58 am
Steve, I really enjoy reading your editorials about non-computer subjects and hearing about life on the farm and other things like your Prius update.
I live in a banking...
March 31, 2008 at 6:43 am
I'm not 100% positive, but I think SET ANSI_WARNINGS ON can go INSIDE the stored procedure (after the CREATE), so that when the SP runs, it sets ANSI_WARNINGS ON for...
March 27, 2008 at 6:03 am
AVB (3/25/2008)
SET @LineItemBody = '"LI' +'","'+ --Record ID
.....
IF isnull(@LineItembody,'') = '' --Line Item Body will be null if an Order Number doesn't have any rows in the transaction tables...
March 26, 2008 at 8:55 am
You can still use the stored procs to return the data, I was saying build a function to parse out a comma-delimited string, such as containing multiple Order Numbers.
For...
March 26, 2008 at 7:41 am
Viewing 15 posts - 61 through 75 (of 181 total)