基于下表:
(
FolderID int NOT NULL IDENTITY(1,1)PRIMARY KEY CLUSTERED,
ParentFolderID int NOT NULL,
FolderName nvarchar(255) NOT NULL,
FolderOrg hierarchyid NOT NULL,
CreateDate date NOT NULL
CONSTRAINT def1_CreateDate DEFAULT GETDATE(),
Title varchar(20) NULL
) ;
谢谢
答案 0 :(得分:1)
如果你只需要添加一条记录,那么这项工作不会那么简单吗?
CREATE PROCEDURE usp_InsertFolder
(@parentFolderID int, @folderName nvarchar(255), @folderOrg hierarchyid, @createDate date, @title varchar(20))
AS
BEGIN
INSERT INTO table1
(ParentFolderID, FolderName, FolderOrg, CreateDate, Title)
VALUES
(@parentFolderID, @folderName, @folderOrg, @createDate, @title);
END
;
用法:
EXEC usp_InsertFolder '1', '2', 0x58, '2012-10-10', 'title goes here';
如果这不是您所需要的,请澄清问题。