Forum Replies Created

Viewing 15 posts - 5,746 through 5,760 (of 6,036 total)

  • RE: Triggers for Auditing

    Another issue nobody noticed ( ):

    IT'S NESTED TRIGGER

    INSTEAD OF UPDATE trigger makes UPDATE to the same table and fires itself.

    I don't see in...

  • RE: Select CASE

    CREATE PROCEDUERE dbo.<Name>

    @Text nvarchar(1000), @Subject nvarchar(50), @OrgId int

     Update NotificationTemplate

     Set Text = @Text,

     Subject = @Subject

     Where OrganizationID = @OrgId

     Insert into dbo.NotificationTemplate (OrganizationID, Subject, Text)

    SELECT @OrgId,  @Subject, @Text

    WHERE NOT EXISTS (select 1...

  • RE: very complicated stored proc

    It's easy.

    Type

    CREATE VIEW dbo.<name>

    AS

    and put there whole block of those horrible

    Select ...(including region, school, etc)

    FROM ....

    INNER JOIN ...

    INNER JOIN ...

    ....

    without WHERE...

  • RE: very complicated stored proc

    You welcome!

    Seems you're over the ditch.

    If you are anyway refactoring this SP I would suggest to put all those joins into view...

  • RE: very complicated stored proc

    Congratulations!

  • RE: Maximum rows in a table variable ?

    It depends.

    Small table variables arer placed in memory, so it's really fast to access data in it.

    But as soon as size of the table variable becomes significant comparing to available...

  • RE: Help Using @@error and @@rowcount together

    SELECT @ErrorNo = @@Error, @inscount = @@Rowcount

    Than do whatever checks you need.

  • RE: very complicated stored proc

    I cannot see any difference between 1st option of the code and "region 0" part in 2nd one. Probably I miss some tiny detail, but you must have used...

  • RE: very complicated stored proc

    It's for you to decide.

    If count(*) = 4 then 4 rows will be returned by normal select.

    As I understand you get empty resultset, and that's a problem. So keep moving...

  • RE: very complicated stored proc

    Yes, copy text of SP to Query Analiser, make it ALTER PROCEDURE, and add execution string at the end.

    Now you can play with it, no application involved anymore.

    After you have...

  • RE: very complicated stored proc

    Looks all right, it must be data.

    Run this:

    select count(*)

    from pod_Events

    and comment all futher joins.

    If result will be > 0 uncomment 1st join and rerun.

    Finally you'll find the join...

  • RE: very complicated stored proc

    And no errors???

    Did you include this part for debug table?

    Why it does not create the table, if there are no errors?

  • RE: very complicated stored proc

    OK, what happens when you run it from QA?

    I mean

    exec stpEventsSearchResult @searchstring = '%%', @dtFrom = 'Jan 1 2000 12:00AM', @dtTo = 'Jan 1 2099 12:00AM', @searchtype = -1,...

  • RE: very complicated stored proc

    Run the query you've got from Profiler in Query Analiser, and it will tell you everything, if you don't beleive in my words.

  • RE: set-based way to apply a rounding adjustment to the largest share

    ContractPayment.Amount - sum (ContractPartyPayment.Amount) >= +0.01

    will not use index definetely, operator "-" is a function as well.

    So, you have nothing to loose.

Viewing 15 posts - 5,746 through 5,760 (of 6,036 total)