Viewing 15 posts - 166 through 180 (of 434 total)
Jeff Moden (10/18/2007)
mrpolecat (10/18/2007)
declare @startdate datetime, @days int
set @startdate...
October 18, 2007 at 8:17 pm
This works as well though it can only go 1 year out. Not sure about the perfomance with the self join.
declare @startdate datetime, @days int
set @startdate = '1/1/2007'
set @days...
October 18, 2007 at 9:00 am
with char datatypes between (and > or < for that matter) do a character by character comparison not looking at the whole field as it would with numbers. If...
October 18, 2007 at 7:44 am
Doesn't that bring us back to Jeff Moden's function?
October 17, 2007 at 9:26 pm
Tally is a table that you need to create with the column N. The fill it with the numbers 1 to whatever you think you need. This is...
October 17, 2007 at 4:02 pm
if you msgbox(DTSDestination("ProcessingDateDate").Value) after you create it what do you get?
October 17, 2007 at 2:13 pm
I just ran into this yesterday, got fed up and used EM to import my file. Thanks for the info.
October 17, 2007 at 2:03 pm
you could put an insert trigger that sets it to "CAT" and an update trigger that disallows the update if it is set to "CAT" assuming that this is...
October 17, 2007 at 11:55 am
You will need a derived table to join the 2 tables
select s.*,a.*
from students s
join
(select studentid,max(historyid) as maxhist from address) lastaddress
on s.studentid = lastaddress.studentid
join
address a
on a.studentid = lastaddress.studentid...
October 17, 2007 at 10:21 am
It should actually be
WHILE @@FETCH_STATUS = 0
From BOL
@@FETCH_STATUS
Returns the status of the last cursor FETCH statement issued against any cursor currently opened by the connection.
Return value Description
0...
October 16, 2007 at 2:54 pm
Jeff Gray just posted this on another topic which might help you out as well.
Another good trick for cursors:
Declare cursor foo....
Declare @someVariable INT
open foo
While (1=1)
BEGIN
Fetch foo into @someVariable
IF @@Fetch_Status <>...
October 16, 2007 at 2:19 pm
Also the select * for you cursor will come back to bite you when someone adds a column to your table and your fields don't line up.
October 16, 2007 at 2:11 pm
I think what Jason meant was that you needed to add another fetch inside your while loop and close and deallocate outside the while loop. Try this
declare cSource cursor...
October 16, 2007 at 2:08 pm
There is probably a better way to do it but this seems to work.
SELECT di.Item, di.d_Date, #Values.Value
FROM (select distinct d_date,item from #Dates ,#Values ) di LEFT OUTER JOIN...
October 12, 2007 at 9:31 am
Please post the DDL of your tables, what you have written so far, and your desired results. That will make it easier to help you out.
October 10, 2007 at 10:35 am
Viewing 15 posts - 166 through 180 (of 434 total)