How to copy a table?

  • 1) How do I create a table based on another table using SQL/TSQL? (I think it's a two-line statement, but I can't recall it).

    2) Is there a way to disable a trigger in SQLServer 2000 (through TSQL or otherwise)?

    Thank you.

  • 1. select * into TableB From TableA

    2.

    For all of them:

    ALTER TABLE tablename

    DISABLE TRIGGER ALL

    For a specific trigger:

    ALTER TABLE tablename

    DISABLE TRIGGER triggername

  • 1) You'd be thinking of "SELECT <fields> INTO <new table name> FROM <table>"

    2) You can use the ALTER TABLE command to disable triggers. Check Books Online for syntax and specifically example H.

     

    --------------------
    Colt 45 - the original point and click interface

  • Thanks!

  • Now what are the odds of that. Exactly the same time

     

    --------------------
    Colt 45 - the original point and click interface

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply