_ | 覦覈襦 | 豕蠏手 | 殊螳 | 譯殊碁
FrontPage › 貎朱Μ蟆郁骸襯殊朱覦る覦覯

Contents



-- ろ 企 
CREATE TABLE dbo.Test001 (seq int IDENTITY(1, 1) NOT NULL);
GO

-- ろ 一危 10覯 j鍵
INSERT dbo.Test001 DEFAULT VALUES;
GO 10

-- 覲襦 螳語る 覦覯
DECLARE @intMaxSeq int, @nvcStmt nvarchar(4000), @nvcTableName sysname;

SET @nvcTableName = N'dbo.Test001';
SET @nvcStmt = N'SELECT @intMaxSeq = MAX(seq) FROM ' + @nvcTableName;

EXEC sp_executesql @nvcStmt, N'@intMaxSeq int OUTPUT', @intMaxSeq OUTPUT;

SELECT @intMaxSeq;
蠍 蠍郁鍵..
企: : るジ讓曙 襦螻豺 企Ν 譯殊語. 襦螻豺
EditText : Print : Mobile : FindPage : DeletePage : LikePages : Powered by MoniWiki : Last modified 2018-04-13 23:12:54

蟲郁 蟆 豌朱 螻旧 譟 蠏瑚 覦讌 襷螻 蟇一企. 覈 覲糾骸 螻旧 蠏碁訖 覦豌 れ 讌螳.