Forum Replies Created

Viewing 9 posts - 1 through 9 (of 9 total)

  • RE: Calculating 3 highest consecutive months spend over a period of a year

    You beat me...

    you can also do it like this:

    SELECT *,mSpent + (SELECT mSpent FROM @tmpTable WHERE nMonth = t1.nMonth + 1) + (SELECT mSpent FROM @tmpTable WHERE nMonth = t1.nMonth...

  • RE: Script to get response times

    I don't know how you would script this, but maybe you can use SQL Server Profiler?

    The problem here I think would be that you would need to constantly run Profiler,...

  • RE: SP to Search a table using optional input parameters

    Hi,

    I recommend using the COALESCE Function. It replaces a value with a new one if the value is null.

    For example:

    SELECT * FROM Employee WHERE Country = @Country AND Salary =...

  • RE: variable columns in select statements?

    Lucky you that I am fluent in German 😉

    Try using sp_executesql instead of Execute. Otherwise I can only recommend to move the bulk of the functionality into a Stored Procedure...

  • RE: Ascii code spaces

    Both SELECT statements are the same and return 32? Well this is the case on my Server.

    What exactly are you trying to do? Remove the spaces or are the 2...

  • RE: Am I stupid? Version History

    So am I understandin this correctly in saying you need to return all issues that where open on the 1st of July, so all issues where the data is smaller...

  • RE: variable columns in select statements?

    Can you post the error that you are getting? Also the code in the Trigger so I can have a look at it?

    In theory you can write something like this:

    DECLARE...

  • RE: sql_variant

    Just my quick 2 cents worth.

    If you have to capture chagnes in the database on multiple Columns (and hence Column types) in one table, it would come in handy.

    I...

  • RE: variable columns in select statements?

    Am I right in understanding that the Trigger that gets called will call your stored procedure?

    If this is the case, all you need to do is get the identity (Good...

Viewing 9 posts - 1 through 9 (of 9 total)