Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 2004

    Lightbulb Unanswered: Magic Tables with Text Columns

    Hi folks,

    I need to execute some kind of

    select a,b,c into #inserted from inserted

    a = int
    b = varchar(50)
    c = text

    Easy so far. But I what I need is to find out whether the audited table contains text(or nText / image) columns or not. If it contains any text columns the statement should automatically be changed to

    select a,b into #inserted from inserted

    Remember that the trigger must be usable for any table in the database without manually entering the tables structure or the column names.

    Best would be fetching the structure fropm the system views (INFORMATIONSCHEMES)

    Any suggestions ?

    Thanks a lot!


  2. #2
    Join Date
    Nov 2002
    TRIGGERS are built for a table, and as such are a "property" of that table.

    The only way would be to build dynamic sql with each trigger for each table.

    Meaning you would still have to build a trigger per table anyway.

    So why not just build them the way they need to be per table?

    And what's with the temp table?

    It's a Great Day for America everybody!

    dbforums Yak CorralRadio 'Rita
    dbForums Member List
    I'm Good Once as I ever was

    The physical order of data in a database has no meaning.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts