Results 1 to 6 of 6

Thread: Truncate?

  1. #1
    Join Date
    Feb 2004
    Location
    Bangalore, India
    Posts
    250

    Unanswered: Truncate?

    can TRuncate statement be rolled back ?
    Cheers....

    baburajv

  2. #2
    Join Date
    Jul 2002
    Posts
    229
    Just test a

    BEGIN TRAN

    TRUNCATE... etc

    ROLLBACK TRAN

    on some test table.

  3. #3
    Join Date
    Jan 2003
    Location
    India
    Posts
    523
    u can rollback a truncate.

  4. #4
    Join Date
    Feb 2004
    Location
    Bangalore, India
    Posts
    250
    create table a
    (
    empno integer,
    empname varchar(25)
    )

    insert into a values(1,'test1')
    insert into a values(2,'test2')
    ...
    insert into a values(10,'test10')


    BEGIN TRANSACTION

    SELECT * FROM A

    TRUNCATE TABLE A

    SELECT * FROM A

    ROLLBACK TRANSACTION

    SELECT * FROM A


    i tried this ...

    as mentioned in the post, all the 10 rows must be displayed
    but i got 0 rows from my last select statement

    can any 1 comment on this?
    Cheers....

    baburajv

  5. #5
    Join Date
    Jan 2003
    Location
    India
    Posts
    523
    Quote Originally Posted by baburajv
    create table a
    (
    empno integer,
    empname varchar(25)
    )

    insert into a values(1,'test1')
    insert into a values(2,'test2')
    ...
    insert into a values(10,'test10')


    BEGIN TRANSACTION

    SELECT * FROM A

    TRUNCATE TABLE A

    SELECT * FROM A

    ROLLBACK TRANSACTION

    SELECT * FROM A


    i tried this ...

    as mentioned in the post, all the 10 rows must be displayed
    but i got 0 rows from my last select statement

    can any 1 comment on this?


    tried the same thing.. but it shows me the 10 rows after i rollback.

  6. #6
    Join Date
    Feb 2004
    Location
    Bangalore, India
    Posts
    250
    confused.....
    Cheers....

    baburajv

Posting Permissions

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