Viewing 15 posts - 31 through 45 (of 283 total)
CrazyMan (10/10/2008)
I need to make the 2 SQL statements into one, is'nt there a MERGE statement on SQL 2005 🙂
Yeah, but in 2005 it's call UPSERT.
...tick...
...tock...
(Wait for it....)
...tick...
...tock...
Ok, before you...
October 10, 2008 at 4:54 pm
I know this is a 2005 thread, but here is a simple solution that will work anywhere. I'm a big fan of the KISS principle. 🙂 (I'll just shamelessly borrow...
October 10, 2008 at 4:41 pm
mazal0404 (9/29/2008)
"INSERT INTO tblDate (myDate , WorkerNum) VALUES ( ' + d + ','" + workerNum + "')";
According to this, you're trying to convert the string ' + d +...
October 1, 2008 at 6:50 pm
Steve Jones - Editor (9/16/2008)
Be curious to know why stored procs are a nightmare for insert/updates.
create proc dbo.UpdateTable( @Col1 int, @Col2 varchar(10))
as begin
update dbo.UnderlyingTable
set Col1 =...
September 16, 2008 at 4:03 pm
I generally (ok -- always) put parameters with default values at the end of the list:
create proc my_sp
@p1 varchar (20),
...
September 16, 2008 at 12:09 pm
Coming from the developer's perspective, I have not found a significant performance difference between views and SPs. And when the performance is close enough, I start emphasizing other characteristics such...
September 16, 2008 at 11:56 am
Use it any way you would use any function:
if DateDiff( dd, @Startdate, @EndDate ) > dbo.fn_Workdays( @Startdate, @EndDate ) begin
-- There is at least one weekend...
September 8, 2008 at 12:54 pm
One of the first problems I noticed with IntelliSense in 2008 is after altering a table. It doesn't display new columns in the drop-down and keeps underlining the newer columns...
September 8, 2008 at 12:42 pm
dulanjan (9/8/2008)
exec fn_WorkDays @startdate,@enddatehelp!
Use exec to call a stored procedure. When calling a function, you have to capture the returned value for further processing and/or display.
declare @WorkDayCount int;
set @WorkDayCount =...
September 8, 2008 at 11:59 am
Michael Valentine Jones (9/4/2008)
My solution was specifically meant to be NOT responsive to the setting of DATEFIRST.
Why? The purpose of DATEFIRST is to allow your functions and procedures to react...
September 5, 2008 at 2:27 am
ggraber (9/4/2008)
Paul Manning (9/2/2008)
September 4, 2008 at 11:56 am
Sergiy (9/3/2008)
THe beauty of the solution posted by Michael is it does not depend on DATEFIRST settings.
Moreover, it allows to set required "datefirst" as a parameter.
So, what's the point...
September 4, 2008 at 11:19 am
With a little less inline code, the query would look like this:set DateFirst 1; -- Set first day of week to Monday
select dbo.WeekBegins( SalesDate ) as WeekOf, Line, Count(*)...
September 3, 2008 at 6:14 pm
meichner (8/25/2008)
I am fairly new at this DB stuff...
Yes, that you are new was obvious from the fact that all your fields are strings, even though some contain dates and...
September 2, 2008 at 11:04 am
rbarryyoung (8/27/2008)
But it does not make sense, nor is it what was spec'ed.
Sigh! You can be so stubborn! You should be more like me and just have the courage of...
August 27, 2008 at 9:06 pm
Viewing 15 posts - 31 through 45 (of 283 total)