CREATE proc sp_user
@username nvarchar(20),
@pwd nvarchar(20)
as
declare @sql nvarchar(500)
set @sql='select a.*,b.rolename from t_user a,t_role b where
a.username='''+@username+''' and a.pwd='''+@pwd+''' and a.roleid=b.id'
EXEC sp_executesql @sql
本文转自94cool博客园博客,原文链接:http://www.cnblogs.com/94cool/archive/2009/08/12/1544454.html,如需转载请自行联系原作者