Forum Replies Created

Viewing 15 posts - 1 through 15 (of 17 total)

  • RE: Using SQL Profiler to analyse performance

    Edit:

    I think Ive got it now. I was selecting the TSQL:Statement Completed event instead of SP:Statement Completed Event.

    Fantastic. I see what you mean about the output.

    Thanks for your help everyone.

  • RE: Using SQL Profiler to analyse performance

    Thanks for the input. Unfortunately the Statement Completed still doesnt help me.

    The problem is that the trace only shows one entry (ie the original stored proc being called).

    In actually fact,...

  • RE: Encrypting Stored Procs

    My mistake you're right actually.

    We have some in house software which takes all our stored procs, adds WITH ENCRYPTION to them, adds them to a db, then scripts the db...

  • RE: Comparing and deleting

    yes, that it!

    many thanks

  • RE: Comparing and deleting

    Failed aswell.

    Incorrect syntax near 't2'

    However. If I replace the first bit:

    DELETE FROM

    with

    SELECT * FROM

    Do I get a list of the correct records im wishing to delete

  • RE: Comparing and deleting

    Hmmm

    Unfortunately that didnt work either. 0 rows affected.

    And I definitely have 2 rows in table2 that arent in table1.

  • RE: Find a second record

    So do I duplicate the first half in the second half?

    select cutomer_id,max(orderdate) from mytable group by customer_id

    UNION

    select customer_id,max(orderdate) from mytable where custorders.id not in

    select cutomer_id,max(orderdate) from mytable group by customer_id

    I...

  • RE: Insert missing records

    Actually I just solved it, but probably alot longer way around.

    I did

    DELETE FROM TableB WHERE EXISTS (SELECT * FROM TableA WHERE TableA.ID=TableB.ID)

    INSERT INTO TableB SELECT * FROM TableA

    I guess basically...

  • RE: Retrieving Date Formats

    aaha, fantastic. Thankyou

    Andy

  • RE: Update From Select

    Yep, thats it. Many thanks JeffB

  • RE: Update using sub queries

    Many Thanks that fixed it!

  • RE: Summary of 2 date periods in one table

    Hello again,

    I've run into abit of a problem with this query.

    To summarise all the above, here's the final query:

    DECLARE @Current table (StoreName varchar(50) not null, sales money not null)

    INSERT @Current...

  • RE: Summary of 2 date periods in one table

    Noel,

    Actually I fixed it another way.

    The original declaration had:

    DECLARE @Current table (StoreName varchar(50) not null, sales int not null)

    I changed the int to money:

    DECLARE @Current table (StoreName varchar(50) not null,...

  • RE: Summary of 2 date periods in one table

    Unfortunately that doesnt work.

    If I had to the second half of the sp, I get an aggregate error message on the a.StoreName and b.Sales

    SELECT a.StoreName, SUM(a.Sales * 1.0) as ThisPeriod,...

  • RE: Summary of 2 date periods in one table

    Actually, just one final thing.

    The results I get look something like this:

    Store ThisPeriod LastYear

    StoreA 20 ...

Viewing 15 posts - 1 through 15 (of 17 total)