本地暫存表/預存程序
預存程序的本地暫存表,本地暫存表會在預存程序結束之後刪除。
//***創造預存程序**//
create procedure spzoetemp
as
begin
create table #zoetesttemp(Id int,name nvarchar(3));
insert into #zoetesttemp Values(1,'Zoe')
select * from #zoetesttemp
end
//**執行預存程序**/
execute spzoetemp
//**選擇佔存表 不能 因為這個表在預存程序執行結束後就消失!**//
select * from #zoetesttemp
訊息 208,層級 16,狀態 0,行 13
Invalid object name '#zoetesttemp'.
//***創造預存程序**//
create procedure spzoetemp
as
begin
create table #zoetesttemp(Id int,name nvarchar(3));
insert into #zoetesttemp Values(1,'Zoe')
select * from #zoetesttemp
end
//**執行預存程序**/
execute spzoetemp
//**選擇佔存表 不能 因為這個表在預存程序執行結束後就消失!**//
select * from #zoetesttemp
訊息 208,層級 16,狀態 0,行 13
Invalid object name '#zoetesttemp'.
留言
張貼留言