Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
所以我有一个表,它在 SQL Server 中有一个 INSERT/UPDATE 触发器。当用户在我的 DataGridView 中开始新行时,如果我插入了行,我想以某种方式获取触发器将为所有字段生成的值?你是怎么做到的?
你将不得不为你的 sql 表中的每一列获取默认值......
执行sql系统查询
sp_columns <table_name>
该列 COLUMN_DEF将具有您的默认约束
COLUMN_DEF
我唯一能想到的就是
<start transaction> <insert row> <read the row to get all values> <rollback transaction>
这并不漂亮,但这是我目前能想到的最好的。