Forum Replies Created

Viewing 15 posts - 46 through 60 (of 136 total)

  • RE: finding absolut values from cumulative values in sql server

    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...

    Rob Farley
    LobsterPot Solutions & Adelaide SQL Server User Group
    Company: http://www.lobsterpot.com.au
    Blog: http://blogs.lobsterpot.com.au

  • RE: finding absolut values from cumulative values in sql server

    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...

    Rob Farley
    LobsterPot Solutions & Adelaide SQL Server User Group
    Company: http://www.lobsterpot.com.au
    Blog: http://blogs.lobsterpot.com.au

  • RE: A Fix() Function in T-SQL

    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...

    Rob Farley
    LobsterPot Solutions & Adelaide SQL Server User Group
    Company: http://www.lobsterpot.com.au
    Blog: http://blogs.lobsterpot.com.au

  • RE: Management Studio with SQL Server 2000

    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...

    Rob Farley
    LobsterPot Solutions & Adelaide SQL Server User Group
    Company: http://www.lobsterpot.com.au
    Blog: http://blogs.lobsterpot.com.au

  • RE: Management Studio with SQL Server 2000

    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...

    Rob Farley
    LobsterPot Solutions & Adelaide SQL Server User Group
    Company: http://www.lobsterpot.com.au
    Blog: http://blogs.lobsterpot.com.au

  • RE: Management Studio with SQL Server 2000

    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...

    Rob Farley
    LobsterPot Solutions & Adelaide SQL Server User Group
    Company: http://www.lobsterpot.com.au
    Blog: http://blogs.lobsterpot.com.au

  • RE: Management Studio with SQL Server 2000

    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...

    Rob Farley
    LobsterPot Solutions & Adelaide SQL Server User Group
    Company: http://www.lobsterpot.com.au
    Blog: http://blogs.lobsterpot.com.au

  • RE: Nested/Hierarchical table query

    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...

    Rob Farley
    LobsterPot Solutions & Adelaide SQL Server User Group
    Company: http://www.lobsterpot.com.au
    Blog: http://blogs.lobsterpot.com.au

  • RE: Management Studio with SQL Server 2000

    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.

    Rob Farley
    LobsterPot Solutions & Adelaide SQL Server User Group
    Company: http://www.lobsterpot.com.au
    Blog: http://blogs.lobsterpot.com.au

  • RE: Management Studio with SQL Server 2000

    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...

    Rob Farley
    LobsterPot Solutions & Adelaide SQL Server User Group
    Company: http://www.lobsterpot.com.au
    Blog: http://blogs.lobsterpot.com.au

  • RE: Alternative to Distinct

    True. But if you wanted indexing, you could use a computed column and index (and query) that.

    Rob Farley
    LobsterPot Solutions & Adelaide SQL Server User Group
    Company: http://www.lobsterpot.com.au
    Blog: http://blogs.lobsterpot.com.au

  • RE: Alternative to Distinct

    You wouldn't need to use a view. You could just say:

    select distinct dbo.uf_stripnonalpha(colname)

    from table

    --Rob

    Rob Farley
    LobsterPot Solutions & Adelaide SQL Server User Group
    Company: http://www.lobsterpot.com.au
    Blog: http://blogs.lobsterpot.com.au

  • RE: How delete data from linkedserver table join with local table .

    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...

    Rob Farley
    LobsterPot Solutions & Adelaide SQL Server User Group
    Company: http://www.lobsterpot.com.au
    Blog: http://blogs.lobsterpot.com.au

  • RE: Sum records if Null is present in second record

    Yeah, you can just do:

    update megan_tmp

    set oppcode = dbo.find_megans_oppcode(id)

    where oppcode is null

    after importing the data.

    Rob Farley
    LobsterPot Solutions & Adelaide SQL Server User Group
    Company: http://www.lobsterpot.com.au
    Blog: http://blogs.lobsterpot.com.au

  • RE: Sum records if Null is present in second record

    --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...

    Rob Farley
    LobsterPot Solutions & Adelaide SQL Server User Group
    Company: http://www.lobsterpot.com.au
    Blog: http://blogs.lobsterpot.com.au

Viewing 15 posts - 46 through 60 (of 136 total)