Forum Replies Created

Viewing 15 posts - 361 through 375 (of 1,413 total)

  • RE: Minus in SQLServer

    I have my copy of Inside SQL 2000 at my client's office where I won't be until thursday, so I can't check exactly what it says there. However, like I...

  • RE: Array as parameter to Stored procedure

    Perhaps this one is simpler. It's more or less the same thing, only it does not return rank and uses a virtual numbers table instead of a real one.

    CREATE FUNCTION...

  • RE: Stored Procedure Error Handling Best Practice

    A great resource for error handling in stored procedures is Erland Sommarskog's article Implementing Error Handling with Stored Procedures.

  • RE: what''''s wrong with my cursor!!!!

    Great, happy to help. But why where you using a cursor in the first place? In SQL Server cursors are extremely seldomly necessary (if ever).

  • RE: Grouping And RollUp

    I prefer to answer here instead of via PM, since then other experts can also help. Like I said, the query I provided above should really work. With the data...

  • RE: Minus in SQLServer

    I think you have misunderstood how the query engine in SQL Server works. One query is always one query, what is interesting is to look at the execution plans that...

  • RE: Ensuring only one record selected

    Yes, I am always looking to have declarative constraints, so I think this solution is quite nice but unorthodox I guess.

  • RE: Grouping And RollUp

    What error are you getting? Or is it just the wrong results? I forgot to mention that I also changed the not equals 0 in the case to equals 0....

  • RE: what''''s wrong with my cursor!!!!

    Why are you using a cursor for this??

    UPDATE empt

    SET job_id = CASE WHEN @qurstr IN ('1', '3') THEN '999' ELSE '456' END

    WHERE job_id = @qurstr

  • RE: Ensuring only one record selected

    See this old thread where I provided a solution for the same problem.

  • RE: CPU v duration

    Yes, good call. In this case with such large difference I assume there is more in play, but in general it is as simple as CPU shows how many milliseconds...

  • RE: Grouping And RollUp

    Here is the query:

    SELECT [Jenis Barang],

    CASE WHEN (GROUPING([Nama Barang]) = 0) THEN [Nama Barang] ELSE 'Total' END AS 'Nama Barang',

    SUM(Harga)

    FROM TaBarang

    GROUP BY [Jenis Barang], [Nama Barang]

    WITH ROLLUP

    HAVING [Jenis Barang] IS...

  • RE: xp_readmail in sql 2005?

    Yep, I guess there is no real alternative that is safer in itself.

  • RE: Truncate table

    Lets say we have this (simplified) page owned (allocated to) by object 2123456:

    Header:

    PageID=123 ObjectId=2123456 NextPID=124 PrevPID=122 ...

    Data:

    0x60: AAAA 1234

    0x80: BBBB 5678

    ...

    Slot offset array:

    0 - 0x60

    1 - 0x80

    ...

    In hex, this would...

  • RE: xp_readmail in sql 2005?

    I guess I will just stick to using xp_readmail. There's not much point writing a CLR procedure when xp_readmail will work

    Sure, as long as you are aware that it...

Viewing 15 posts - 361 through 375 (of 1,413 total)