Forum Replies Created

Viewing 15 posts - 106 through 120 (of 160 total)

  • RE: Can you perform 3 actions in one trigger?

    CREATE TABLE [dbo].[PAT_ACCOUNT_MANAGER](

    [PAT_ACCOUNT_MANAGER_ID] [int] NOT NULL,

    [NAME_ID] [int] NULL,

    [LOGIN_ID] [char](20) NULL,

    [ROLE_TYPE_ID] [int] NULL,

    CONSTRAINT [pk_pat_account_manager] PRIMARY KEY CLUSTERED

    (

    [PAT_ACCOUNT_MANAGER_ID] ASC

    )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF,...

  • RE: Can you perform 3 actions in one trigger?

    First table that I am deleting from, i'm inserting the new values into. The reason I have to delete from that table is to avoid duplicate values, because this table...

  • RE: Can you perform 3 actions in one trigger?

    USE [Patricia]

    GO

    /****** Object: Trigger [dbo].[INSERT_TK_NameIDExtendedTAB] Script Date: 08/29/2014 01:53:44 ******/

    SET ANSI_NULLS ON

    GO

    SET QUOTED_IDENTIFIER ON

    GO

    CREATE TRIGGER [dbo].[INSERT_TK_NameIDExtendedTAB]

    ON

    [dbo].[PAT_ACCOUNT_MANAGER]

    FOR

    INSERT

    AS

    DECLARE @PAMID int, @RoleID int,@NameID int, @Signature varchar(3),@MaxID int

    SET @PAMID...

  • RE: Can you perform 3 actions in one trigger?

    I do, it only goes up to step one, it never continues to step two.

    DELETE FROM NAME_ADD_FIELDS

    WHERE NAME_ID = @NameID

    AND NAME_FIELD_NUMBER = @RoleID

    INSERT INTO NAME_ADD_FIELDS

    SELECT

    @NameID,

    @RoleID,

    @Signature,

    NULL,

    NULL

    DELETE FROM PAT_ACCOUNT_MANAGER

    WHERE...

  • RE: Query returning more than 1 value????

    Hey guys, sorry I've been quiet but I'm in hospital. As soon as I'm better I can start testing again. Thanks a lot

  • RE: Query returning more than 1 value????

    We hired people to develop a billing system for us. They can't get our Case id imported that's why I'm using a random one to test with. When a user...

  • RE: Query returning more than 1 value????

    Yeah that's exactly how I have it. That's why I only use one record at a time. If I select more, it gives all of them the same increment, for...

  • RE: Query returning more than 1 value????

    Yeah but it needs to increment according to case number, so It wont start at one, it will start at the max seq number in there and add one. That's...

  • RE: Query returning more than 1 value????

    I have tested you code, it returns more than one row and then the B_L_SEQ_Number doesn't increment. That's why I wrote mine to return only one at a time, so...

  • RE: Query returning more than 1 value????

    I'll try this code now thanks...If I may ask a stupid question that would make future queries easier for everyone, how do I post a block with the code in...

  • RE: Query returning more than 1 value????

    The one where it is the same in both tables. Im not sure If I can do it like this? Can this same variable contain different values at different times?

  • RE: Query returning more than 1 value????

    Because it is the only id at the moment in both tables. I set the default case in the cat_transactions table to 121 for the moment so that I can...

  • RE: Query returning more than 1 value????

    It can be any case ID, depends what the user is working on. Here is the whole script. I need to increment the @LineNumber per CaseID, and right it into...

  • RE: Query returning more than 1 value????

    Hey GilaMonster,

    Your right as usual hehe. It was my @case id. It work if I hard code it , but this exercise is pointless if I hardcode the case id,...

  • RE: Query returning more than 1 value????

    Hey sorry man, the problem was where I define the case id like

    SET @CaseID = (

    SELECT

    bl.CASE_ID

    FROM

    Patricia.dbo.BUDGET_LINE bl

    JOIN cat_transaction ct ON bl.EXT_REFERENCE...

Viewing 15 posts - 106 through 120 (of 160 total)