储存过程问题
例如储存过程:
if exists (select * from sysobjects where name = 'xpWebGetPathById')
  drop proc xpWebGetPathById
go
create proc xpWebGetPathById
(
	@p_UserName		char(5),		--用户代码
	@p_UserPw		varchar(20),	--用户密码
	@p_SysID		tinyint,		--业务系统ID
	@p_HospitalID	        smallint,		--医院ID号
	@Id			int
)
as
	
	declare @IpAddress varchar(50)
	select @IpAddress=Value from rhisdb..System_Config where ParaID='ARCHIVE_FLODER'
	if SUBSTRING(@IpAddress,(Len(@IpAddress)-1),1)<>'\'
		set @IpAddress = @IpAddress+'\'
	select 0 as errorcode,'获取个人归档病历列表成功!' as errormsg
	select @IpAddress+a.PackagePath as PackagePath  from ehrdb..DATA_EMRArchiveInfo a where ID=@Id 
	return 0
go
create 和 declare 有什么区别的,大哥们,能详细讲一下吗。。
              
              
------解决方案--------------------create 是创建表(实体表、临时表),declare是用来定义表变量(在你这个例子中),create创建的表有统计信息,但是表变量没有,大数据量的时候表变量并不总比表好。
create出来的可以在系统视图中查到,但是表变量暂时我不知道能不能查看。
还有在拼接字符串的时候,表变量要处理一下