Forum Replies Created

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

  • RE: Help with query

    That's pretty awesome query... have to try it out though...

    Thanks a lot for your time!

  • RE: Help with query

    Both scripts are OK, thank you very much 🙂

  • RE: Help with query

    That works, thanks Pyay!

  • RE: Help with query

    Thanks Pyay, almost what I want. With your query I get this:

    1 10.00 10.00 2009-06-02 00:00:00.000

    1 10.00 15.00 ...

  • RE: Help with query

    Hey, of course this are sample data 🙂

    Maybe this is better representation of actual data:

    if object_id('tempdb..#temp') is not null drop table #temp

    create table #temp (item varchar(10), price1 money, price2 money,...

  • RE: Help with query

    I see I wrote incorrect result in my first post, now it is correct.

    Christopher and Pyay, your query returns only distinct sets of item, price1 and price2. That's not ok...

  • RE: Help with query

    With 'ordered by date desc' I mean that if there are two rows with same data (item, price1 and price2), then the returned row should be the one with greater...

  • RE: Comparing the Different combination of numbers

    The only reason I see why somebody would need this kind of comparison is solving some of the problems from Project Euler/[/url]. There are a lot of problems involving combinations...

  • RE: Indexes

    Thanks, that explains a lot. It looks like I have to learn execution plans prior to indexes... now I am studying Execution plans on SQL in the Wild, nice and...

  • RE: how to use select into without adding duplicate records

    Maybe you can create a view based on your query and then select data from it?

  • RE: Create table

    OK, I removed unique constraint on Customer table.

    Ramesh, you're right, I will change it back, it is more readable that's way 🙂

    This is my own Project for learnign purposes (IS...

  • RE: Create table

    Thanks for your reply, I changed my code, hope it is OK now:

    create table [Country](

    [CountryID] int identity(1,1) not null,

    [Country] varchar(50) not null,

    ...

  • RE: Debug SP

    I think you can use breakpoints in SQL Server 2008.

    In 2005, no.

  • RE: Debug SP

    You can put 'print' commands in SP, run SP and watch for output (in Management Studio)

    Or use xp_logevent in SP for writing to eventlog

    Or insert data inside of SP into...

  • RE: updates

    Try something like this:

    select last_user_update

    from sys.dm_db_index_usage_stats

    where database_id = db_id( 'databasename' )

    and object_id = object_id('tablename')

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