SQL 2005中的临时表 [英] Temporary tables in SQL 2005
问题描述
嗨朋友们,
我在我的项目中创建了临时表,它运行起来,就在我运行它的时候。但我对临时表格知之甚少。
我想知道是否只需要创建临时表。我还想知道当我想从前端应用程序将数据插入表中时是否可以使用存储过程来执行临时表。
如果有的话我会更愿意知道。
任何帮助都会有所帮助。
这是我将为其创建临时表的实际表。
CREATE TABLE ITEMCODE_REGISTRATION
(
ITEMCODE NVARCHAR ( 20 ) NOT NULL ,
ITEMNAME CHAR ( 50 )不 NULL ,
CATEGORY CHAR ( 25 ) NOT NULL
)
请这是我创建的临时表
- 临时表
CREATE TABLE #ITEMCODE_REGISTRATION
(
ITEMCODE NVARCHAR ( 20 ) NOT NULL ,
ITEMNAME CHAR ( 50 ) NOT NULL ,
CATEGORY CHAR ( 25 ) NOT NULL
)
谢谢。
临时表通常用于存储数据只能在短时间内执行某些操作,如枢轴,聚合等。
如需了解更多信息,请参阅:
特殊表格类型 [ ^ ]
创建和修改表格基础 [ ^ ]
Hi Friends,
I have created temporary table in my project and it works, that is when I runs it. But I do not know much about temporary tables.
I would like to know if that is all that it takes to create temporary tables. I also would like to know if I can use stored procedure to execute the temporary table when I want to insert data into the tables from the front end application.
If there's more to it I will be willing to know.
Any assistance will be helpful.
This the actual table that I will be creating the temporary table for.
CREATE TABLE ITEMCODE_REGISTRATION
(
ITEMCODE NVARCHAR(20)NOT NULL,
ITEMNAME CHAR(50)NOT NULL,
CATEGORY CHAR(25)NOT NULL
)
Please this is the temporary table I created
--Temporary table
CREATE TABLE #ITEMCODE_REGISTRATION
(
ITEMCODE NVARCHAR(20)NOT NULL,
ITEMNAME CHAR(50)NOT NULL,
CATEGORY CHAR(25)NOT NULL
)
Thanks.
Temporary tables usually are used to store data only for short time to perform some operation, like pivots, aggregates, etc.
For further information, please see:
Special Table Types[^]
Creating and Modifying Table Basics[^]
这篇关于SQL 2005中的临时表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!