常用存储过程

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

posted @ 2009-08-12 14:48  94cool  阅读(167)  评论(0)    收藏  举报