Forum Replies Created

Viewing 15 posts - 631 through 645 (of 1,217 total)

  • RE: Trigger only executing second time

    Oh... then the only thing you can do is to find out why it is there, what it should do and so on... otherwise you're stuck. You can not rewrite a...

  • RE: Trigger only executing second time

    Something like this should be closer to the correct result, but I still have no idea what the trigger should do, as it is not apparent for your code -...

  • RE: Trigger only executing second time

    OK, to start with, how do you expect this will work if multiple rows are updated? You are trying to assign multiple values to one variable.

    declare

    @incidentID varchar(50)

    set @incidentID =...

  • RE: Sql how to

    What's DOD? The only thing that comes into my mind is Dead On Delivery... which somehow seems to be appropriate as I read what you are asked to do. We'll...

  • RE: Trigger only executing second time

    Yes please, post the trigger code and table structure. It will be a lot easier to look for solution and explain problems if we all know what it is about.

    What...

  • RE: trigger help needed

    Well, if existing rows are your problem, what about something like

    INSERT INTO audit_table

    SELECT * FROM inserted

    WHERE NOT EXISTS (select * from audit_table where primary_key = inserted.primary_key)

    You may be better...

  • RE: Can this function be Tuned

    That's right, John didn't say anything about special holidays and long weekends - but Calendar table is a universal solution that can be used on many places, not just in this...

  • RE: Can you query against a CURSOR?

    Interesting coincidence... this weekend I decided to look at a stored procedure I wrote some 2 years ago. Original version of this procedure I inherited was unusable, because it ran...

  • RE: Can you query against a CURSOR?

    OK, try this as first step:

    SELECT a.MatNum,

    a.VerNumMat,

    a.MatDesc,

    a.SpecSta,

    a.OldMatID,

    ...

  • RE: Can you query against a CURSOR?

    I will try to reproduce what I understood so far, please correct me if I'm wrong.

    1) You have a table dbo.tb_MatSpec, which has 200k rows. Column MatNum identifies an "object"; there can...

  • RE: Column Name as a Parameter Value

    I suggest to read some articles on http://www.sommarskog.se, dealing with Dynamic SQL and usage of parameters in stored procedures, before you decide which way to go.

  • RE: Can you query against a CURSOR?

    Hi,

    unfortunately you didn't supply DDL and the cursor is uncommented, so it is quite hard to understand what you are trying to do. Could you please somehow describe what is...

  • RE: Data from Previous Row

    If you need to work with a table that already holds such values, you are in problems. You can try to calculate something, but you have no guarantee that it will work...

  • RE: Can this function be Tuned

    Hello,

    functions don't work well when used in a select across a large number of rows. Maybe you could post your entire query that's using this function, plus DDL of respective...

  • RE: create procedure date

    Hi

    CREATE procedure_name @start_dte datetime = NULL, @end_dte datetime = NULL, @all varchar(1) bit = 0

    1. IF @end_dte IS NULL SET @end_dte = GETDATE()

    2. IF @start_dte IS NULL SET @start_dte = GETDATE()...

Viewing 15 posts - 631 through 645 (of 1,217 total)