Viewing 15 posts - 46 through 60 (of 136 total)
Ew... stupid mistake.
select t1.*, datediff(second, (select max(t2.timestamp) from table1 t2 where t2.timestamp < t1.timestamp), t1.timestamp) as secondsdifferent
from table1
Max if we're looking at earlier records. min if we're looking at later...
August 9, 2006 at 2:19 am
In SQL2005, you could easily do this. Alter this a little to make it fit your needs.
with records as (select *, row_number() over (order by timestamp) as rn from table1)
select...
August 9, 2006 at 2:04 am
True, I should've used numeric. I said in the article it was out of laziness.
I chose float originally because that's the type that the trigonometry functions use. Ideally I'd have...
July 31, 2006 at 12:48 am
Sean - (without trying it yet - I've just got back from 3 weeks away, and am just going through messages today) try pressing home a second time. So... holding...
July 31, 2006 at 12:33 am
Well, the equivalent to osql is sqlcmd.
I know it feels like the various tools for MS products are just getting slower and slower, but that's largely because we all have...
July 21, 2006 at 10:28 pm
Start by downloading the Feature Pack from http://www.microsoft.com/downloads/details.aspx?FamilyID=df0ba5aa-b4bd-4705-aa0a-b477ba72a9cb&DisplayLang=en
You will at least need the "Microsoft SQL Server 2000 DTS Designer Components" bit of it.
Once that's installed, open the Object Explorer window...
June 30, 2006 at 12:54 am
SQL2005 objects are still owned by people, it's just that the ownership is hidden slightly by the fact that objects are also in schemas. In fact, I have another article...
June 28, 2006 at 5:54 pm
Hmm... this thing lost my post.
Anyway - here's a solution. It only works for smallish trees, because of the way the ordering is done.
/* --This is just to populate my...
June 28, 2006 at 12:34 am
You shouldn't have any problems with SQL2005 and VS1.x. I still use VS2003 for quite a few projects, and I've never had any conflicts between .Net 1.1 and 2.0.
June 26, 2006 at 12:27 am
I know there are plenty of things that I didn't mention in the article. The plan was to help persuade people who are still using the SQL2K tools to consider...
June 23, 2006 at 8:21 pm
True. But if you wanted indexing, you could use a computed column and index (and query) that.
May 24, 2006 at 3:06 am
You wouldn't need to use a view. You could just say:
select distinct dbo.uf_stripnonalpha(colname)
from table
--Rob
May 24, 2006 at 2:44 am
Seems odd. I would start by using:
delete a from localhost_test.test.dbo.Spot as a inner join
bica.tmpspot as b on a.spotid=b.spotid
Instead of the comma. But I can't guarantee this will offer different...
May 17, 2006 at 6:42 pm
Yeah, you can just do:
update megan_tmp
set oppcode = dbo.find_megans_oppcode(id)
where oppcode is null
after importing the data.
March 21, 2006 at 2:26 am
--You can create a function to do something similar:
create function dbo.find_megans_oppcode(@id int) returns int
begin
declare @res int
select top 1 @res = oppcode from megan_tmp t2
where t2.id <= @id
and not t2.oppcode is...
March 20, 2006 at 6:15 pm
Viewing 15 posts - 46 through 60 (of 136 total)