-2

根据下表:

(
   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
) ;

谢谢

4

1 回答 1

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';

如果这不是您需要的,请澄清问题。

于 2012-10-10T18:07:36.327 回答