Delete Guild ?

04/08/2017 22:41 thisismastercap#1
when i use query to delete all guild send me error ?

Query

Error
04/09/2017 11:43 MrCatGardens#2
Holy crap, who told you to delete the full table?

Code:
USE SRO_VT_SHARD;
ALTER TABLE [_Guild] DROP  CONSTRAINT [FK__Guild__AlliedClans];
TRUNCATE TABLE _Guild;
SET IDENTITY_INSERT _Guild ON
INSERT INTO [_Guild] ([ID],[Name],[Lvl],[GatheredSP],[FoundationDate],[Alliance],[MasterCommentTitle],[MasterComment],[Booty],[Gold],[LastCrestRev],[CurCrestRev],[MercenaryAttr]) VALUES (0, 'dummy', 1, 0, getdate(), 0, null, null, 0, 0, 0, 0, 0);
SET IDENTITY_INSERT _Guild OFF
ALTER TABLE [_Guild] ADD CONSTRAINT [FK__Guild__AlliedClans] FOREIGN KEY(Alliance)REFERENCES [_AlliedClans](ID);
This should be the right way...
Drop constraint(s)
Truncate table
Insert the dummy guild with ID '0'
Add your deleted constraint(s)
04/09/2017 15:34 thisismastercap#3
Quote:
Originally Posted by skardana View Post
Holy crap, who told you to delete the full table?

Code:
USE SRO_VT_SHARD;
ALTER TABLE [_Guild] DROP  CONSTRAINT [FK__Guild__AlliedClans];
TRUNCATE TABLE _Guild;
SET IDENTITY_INSERT _Guild ON
INSERT INTO [_Guild] ([ID],[Name],[Lvl],[GatheredSP],[FoundationDate],[Alliance],[MasterCommentTitle],[MasterComment],[Booty],[Gold],[LastCrestRev],[CurCrestRev],[MercenaryAttr]) VALUES (0, 'dummy', 1, 0, getdate(), 0, null, null, 0, 0, 0, 0, 0);
SET IDENTITY_INSERT _Guild OFF
ALTER TABLE [_Guild] ADD CONSTRAINT [FK__Guild__AlliedClans] FOREIGN KEY(Alliance)REFERENCES [_AlliedClans](ID);
This should be the right way...
Drop constraint(s)
Truncate table
Insert the dummy guild with ID '0'
Add your deleted constraint(s)
Done Fixed Ty
06/22/2018 03:28 kubed#4
not works with me can any one help !