Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
F
Ftt_Common
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
Ftt_Common
Commits
a34e8bd1
Commit
a34e8bd1
authored
May 15, 2021
by
tr
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1、清空表:修复带外键无自增列的表清空报错
parent
2eb0f1aa
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
2 deletions
+5
-2
wEmptyTable.cs
Tools/UI/wEmptyTable.cs
+5
-2
No files found.
Tools/UI/wEmptyTable.cs
View file @
a34e8bd1
...
...
@@ -103,10 +103,13 @@ namespace Tools.UI
}
catch
(
Exception
)
{
//外键表,需要删除数据,
然后重置自增主键
//外键表,需要删除数据,
如有自增列则重置自增
var
foreign_sql
=
$@"
DELETE FROM
{
table
}
DBCC CHECKIDENT('
{
table
}
',RESEED,0)"
;
IF EXISTS(SELECT 1 FROM sys.columns WHERE OBJECT_ID = OBJECT_ID('PurchaseDocTree') AND is_identity=1)
BEGIN
DBCC CHECKIDENT('
{
table
}
',RESEED,0)
END"
;
this
.
_db
.
ExecNonSql
(
foreign_sql
);
this
.
EmptyLog
.
Add
(
foreign_sql
.
Trim
());
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment