存储过程中新建临时表
在存储过程里面新建临时表的好处很多
--判断临时表是否存在,如果存在则删除
IF OBJECT_ID('tempdb..#temp_Supplier') IS NOT NULL
DROP TABLE #temp_Supplier
--新建表
CREATE TABLE #temp_Supplier(
[K3_supplier_no] [nvarchar](100) NOT NULL,
[supplier_id] [int] IDENTITY(1,1) NOT NULL, --注意,临时表的一个作用体现了,可以递增
[supplier_name_cn] [nvarchar](50) NOT NULL,
[supplier_name_tw] [nvarchar](50) NOT NULL,
[supplier_name_in] [nvarchar](100) NOT NULL,
[supplier_type] [smallint] NOT NULL,
[accounts] [nvarchar](50) NOT NULL,
[address] [nvarchar](50) NOT NULL,
[postalcode] [nvarchar](10) NOT NULL,
[telephone] [nvarchar](30) NOT NULL,
[fax] [nvarchar](50) NOT NULL,
[contact_person] [nvarchar](20) NOT NULL,
[rank] [nchar](2) NOT NULL,
[relationship] [smallint] NOT NULL,
[taxrate] [nvarchar](10) NOT NULL,
[relationAttribute] [smallint] NOT NULL )