想要将数据插入到临时表中 [英] want to insert data into temp table

查看:115
本文介绍了想要将数据插入到临时表中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

hi ,,


当我将数据插入表中时,而不是我输入的数据
该表被复制到临时表中


请给出一个想法

,


when i am inserting data into a table than that data which i have entered into
that table is copied into temp table


please give an idea

推荐答案

Insert into [temptablename] select *  from [yourtablename] where [condition]




谢谢
Ashish




Thanks
Ashish


您的意思是,如果您有一个表Employee,您想将这些记录从Employee复制到临时表#Employee吗?

然后试试这个.

如果您只打算插入一次,则可以在不声明临时表的情况下进行插入.


You mean if you have a table Employee, you want to copy those records from Employee to temptable #Employee?

Then try this.

if you are going to insert only once, then you can insert without declaring temptable.


select *  into #Employee from Employee



其他

您可以声明临时表并插入.



else

You can declare temptable and insert.

create table #Employee
([EMPID] int,
[EMPNAME] varchar(100)
)
insert into #Employee 
select * from Employee 


这篇关于想要将数据插入到临时表中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆