Forum Replies Created

Viewing 14 posts - 16 through 30 (of 30 total)

  • RE: Trigger to capture data before and after an update

    Lowell (4/6/2012)


    here's an example i put together for a different post;

    it's getting inserted items, putting them into a comma delimited string(because of course the trigger could have multiple rows!)

    for your...

  • RE: Trigger to capture data before and after an update

    Mike01 (4/6/2012)


    You can query the Inserted and Deleted tables within the trigger, but I'm not sure this is a good solution. How often are records added/modified in this table....

  • RE: getting value based on data in other fields

    Sean Lange (5/2/2011)


    ok so here is what I have for some sample ddl and data...

    create table dummy

    (

    data varchar(25),

    VDate varchar(25),

    ID int

    )

    insert dummy select 'xyz', 'Jan 1, 1990', '1'

    union all

    select 'pdq','','2'

    union all

    select...

  • RE: getting value based on data in other fields

    Sean Lange (5/2/2011)


    So given your example what do you want the output to be? Read the link in my signature for details about how to ask a question that is...

  • RE: Delete Trigger

    You are the KING! Thank you!

  • RE: Delete Trigger

    yes, that is correct.

  • RE: Delete Trigger

    Source table: dbo.[HCS_STG_CNSMR_APLCTN]

    [STG_DATA_PRCSS_TMSTMP] [datetime] NULL,

    [STG_DATA_ROW_ID] [int] NOT NULL,

    [CNSMR_APLCTN_CD] [char](3) NULL,

    [PRCSS_STATUS_CD] [char](3)

    Target table:

    [dbo].[deleted_HCS_STG_CNSMR_APLCTN]

    [STG_DATA_PRCSS_TMSTMP] [datetime] NULL,

    [STG_DATA_ROW_ID] [int] NOT NULL,

    [CNSMR_APLCTN_CD] [char](3) NULL,

    [PRCSS_STATUS_CD] [char](3),

    ...

  • RE: Alias on 2000 to 6.5

    Yes, just server name.

    The hope is the code would work without changes - since we cannot locate the source (written 9 yrs ago, when we didn't have effective...

  • RE: Enabling FKs in SP - not working

    OK Ok. Now, I feel foolish!

    Rowcount was still set to one!

    A simple 'set rowcount 0' fixed my problem. Man, am I foolish!

    Thank you for all your...

  • RE: Enabling FKs in SP - not working

    OK. After going through the million lines between the exec statement and the completion, I notice that only one of the tables has its FKs enabled during step four....

  • RE: Enabling FKs in SP - not working

    From the trace:

    SP:StmtCompletedUse [Specialty_Marine_ljb]; Microsoft SQL Server Management Studio - Query

    SP:StmtStartingexec sp_msforeachtable "ALTER TABLE ? CHECK CONSTRAINT all"Microsoft SQL Server Management Studio - Query

    ...

    Then a million (exaggeration) lines for the...

  • RE: Enabling FKs in SP - not working

    1. The data is actually being inserted on the target DB. Otherwise, if they were enabled, it would violate the FK constraint.

    2. I have manually checked...

  • RE: Enabling FKs in SP - not working

    Added the ; with no change in execution. Step 1, disabling the FKs, works just fine as is.

    The code works outside of the SP.

    No error appears,...

  • RE: incorporating time constraints on NT security

    Thanks, this is a great article! THANK YOU!

    This particular instance is SP1, but the alternatives mentioned in the article would work... EXCEPT for one issue. The instance...

Viewing 14 posts - 16 through 30 (of 30 total)