我正在单步执行SQL Server Management Studio 2008(SSMS)中的存储过程.代码创建了一些表变量以及我想要检查的临时#表.现在我可以在"Locals"窗口中看到其他局部变量,而在那里列出表变量时,我看不到它们的内容.我还想检查#temp表,但是我想要对它们运行的任何select语句都需要来自与我正在逐步执行的代码相同的会话.
这在SSMS 2008调试器中是否可行?
我正在使用JPA 2.0和SQL Server 2008,并且当我使用表变量时,我已经确定JPA不喜欢我的存储过程.
例如,这个sproc工作:
declare @t table
(
id int identity
, test varchar(50)
)
select 'blah' as test -- I'm ignoring the table variable above
Run Code Online (Sandbox Code Playgroud)
但是,当我尝试@t使用此代码将某些内容插入到表变量中时,它会崩溃:
declare @t table
(
id int identity
, test varchar(50)
)
insert into @t
select cast(getdate() as varchar(60))
select * from @t
Run Code Online (Sandbox Code Playgroud)
我收到以下错误:
Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.0.2.v20100323-r6872): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: com.microsoft.sqlserver.jdbc.SQLServerException: The statement did not return a result set.
Error Code: 0
Run Code Online (Sandbox Code Playgroud)
如果我可以帮助它,我不想重写我的复杂sprocs而不使用表变量.
谢谢你的任何建议.