摘要: 1.DECLARE @sql nvarchar(4000), -- nvarchar(MAX) on SQL 2005. @col sysname, @min varchar(20) SELECT @col = N'au_fname' SELECT @sql = N'SELECT @min = convert(varchar(20), MIN(' + @col + N')) FROM authors' EXEC sp_executesql @sql, N'@min varchar(20) OUTPUT', @min OUTPUT 阅读全文
posted @ 2012-03-27 16:49 byronming 阅读(272) 评论(0) 推荐(0) 编辑