1. 在Database上,右击选择Task
2. 选择表
3. 选择Advanced 中 Types of data to script的值为Data only
然后防止多次插入,可以把语句改成这样
IF(NOT EXISTS(SELECT * FROM [tblH] WHERE [Type]=1 ))
BEGIN
INSERT [dbo].[tblH] ([idRow], [Type])
VALUES (CAST(1 AS Numeric(18, 0)), CAST(1 AS Numeric(18, 0)))
END