|
|
|
Valued Member
      
Group: General Forum Members
Last Login: Wednesday, January 23, 2013 5:36 AM
Points: 51,
Visits: 71
|
|
|
|
|
|
SSC-Enthusiastic
      
Group: General Forum Members
Last Login: Wednesday, May 09, 2012 4:22 PM
Points: 187,
Visits: 76
|
|
yikes... i chose error while truncating due to the fact the table wasn't named correctly in the truncate statement....
|
|
|
|
|
SSCrazy
      
Group: General Forum Members
Last Login: Today @ 7:48 AM
Points: 2,202,
Visits: 4,157
|
|
|
|
|
|
Ten Centuries
      
Group: General Forum Members
Last Login: Monday, September 17, 2012 7:30 AM
Points: 1,038,
Visits: 679
|
|
Nice Question : )
Yes we can not use truncate on a table which is referenced by a FOREIGN KEY constraint
The below statement is true if it is not referenced with any FOREIGN KEY:
If the table contains an identity column, the counter for that column is reset to the seed value defined for the column. If no seed was defined, the default value 1 is used.
|
|
|
|
|
Ten Centuries
      
Group: General Forum Members
Last Login: Monday, September 17, 2012 7:30 AM
Points: 1,038,
Visits: 679
|
|
Nice Question : )
Yes we can not use truncate on a table which is referenced by a FOREIGN KEY constraint
The below statement is true if it is not referenced with any FOREIGN KEY:
If the table contains an identity column, the counter for that column is reset to the seed value defined for the column. If no seed was defined, the default value 1 is used.
|
|
|
|
|
SSC Eights!
      
Group: General Forum Members
Last Login: Monday, May 13, 2013 2:42 PM
Points: 877,
Visits: 1,158
|
|
Nice question. Delete is working for CustomerMaster table but truncate throws an error. I would like to know why it is not working? Any specific reason?
Thanks
|
|
|
|
|
Old Hand
      
Group: General Forum Members
Last Login: Friday, December 21, 2012 5:24 AM
Points: 366,
Visits: 436
|
|
me too, although i know the logic behind truncate
|
|
|
|
|
SSC-Enthusiastic
      
Group: General Forum Members
Last Login: Monday, November 26, 2012 4:40 AM
Points: 129,
Visits: 123
|
|
it truncates CustomerDocuments table but not CustomerMaster Error Message fk ref. fired while truncating CustomerMaster.
|
|
|
|
|
Grasshopper
      
Group: General Forum Members
Last Login: Monday, August 20, 2012 2:41 AM
Points: 17,
Visits: 20
|
|
The error you will get is: CostomerMast does not Exist!!!
The table is called CostomerMastER
|
|
|
|
|
SSC Eights!
      
Group: General Forum Members
Last Login: Monday, May 13, 2013 2:42 PM
Points: 877,
Visits: 1,158
|
|
w.rooks (10/21/2010) The error you will get is: CostomerMast does not Exist!!!
The table is called CostomerMastER
This was typo mistake. If you change it to CustomerMaster still SQL throws an error: Cannot truncate table 'CustomerMaster' because it is being referenced by a FOREIGN KEY constraint.
Thanks
|
|
|
|