sql server 2000 语法

引用:http://zhidao.baidu.com/question/261673548.html

临时表
(1)建立:create table #表名(字段名 类型,字段名2 类型2。。。。) 手动删除:drop table #表名
每一个用户都可以放心地插入、更新、删除表中的数据而不必担心其它的用户使该表中的数据失效,当用户退出sql时该表可以自动删除,
另一种建立方法:create table tempdb..tablename(field1 datatype,field2 datatype....)
(2)本例给出一临时表的最通常用法:在复合查询中存贮查询的结果为之后的查询使用。
选出所有的居住在nashville的艺术家的记录信息:
方法一:create table #temp_info(name char(30),homebase char(40),style char(20),artist_id int)
insert #temp_info select * from artists where homebase='nashville'
select recordings.* from recordings,artists where recordings.artist_id=#temp_info.artist_id
方法二:select artists.* from artists,recordings where artists.homebase='nashville' 
原文地址:https://www.cnblogs.com/sode/p/2210199.html