日期:2014-05-18 浏览次数:20415 次
寫一個邏輯方法 CREATE TABLE T(ID UNIQUEIDENTIFIER,NAME NVARCHAR(50)) GO CREATE PROCEDURE cTablename( @ID UNIQUEIDENTIFIER OUTPUT, @Name NVARCHAR(50) ) AS INSERT INTO T(ID,Name) VALUES(@ID,@Name) GO DECLARE @ID UNIQUEIDENTIFIER SET @ID=NEWID() EXEC cTablename @ID=@ID OUTPUT,@Name=N'中國風' SELECT * FROM T WHERE ID=@ID /* ID NAME 4666DFDF-D6C6-435C-8083-DBF56994ADE8 中國風 */