Friday, March 9, 2012

small example of table variable and temp table

begin tran
create table #temp (empid int,empname varchar(20));
declare @tempvariable table(empid int,empname varchar(20));

insert into #temp
select 1,'ravi'

insert into @tempvariable
select 2,'chandra'


rollback

select * from @tempvariable

select * from #temp

No comments:

Post a Comment