English 中文(简体)
将存储程序插入临时表格,删除物体或栏目名称或空字[重复]
原标题:Trying to insert a stored procedure into a temporary table, getting an object or column name is missing or empty [duplicate]
This question already has answers here:
Closed 11 years ago.

Possible Duplicate: How to SELECT * INTO [temp table] FROM [Stored Procedure]

下面是:T-SQL。 我有 储存程序,选择记录。 我想询问通过储存程序归还的记录,因此,我试图将记录列入一个临时表格。 (填补员额和其他员额说,是怎样做的)

但当我尝试时,我犯了错误:

物体或栏目名称缺失或空洞

当我刚开始处理所储存的程序时,我收到一个有名列的表格。

select * into #temp1
exec alexander.dbo.get_uberrecords  20120101 ,  20120201 ,  labcorp  //throws error saying columns must have names

......

exec alexander.dbo.get_uberrecords  20120101 ,  20120201 ,  labcorp  // Returns cols with names

我失踪了什么?

最佳回答

1. 编制首期:

CREATE TABLE #temp1
(
   COL1 INT,
   COL2 VARCHAR(MAX)   
)

INSERT INTO #temp1 
exec alexander.dbo.get_uberrecords  20120101 ,  20120201 ,  labcorp 

如果是极为广泛的成果,你不妨使用<代码>。 OPENROWSET

In any case, this SO has many options: Insert results of a stored procedure into a temporary table

问题回答

暂无回答




相关问题
Export tables from SQL Server to be imported to Oracle 10g

I m trying to export some tables from SQL Server 2005 and then create those tables and populate them in Oracle. I have about 10 tables, varying from 4 columns up to 25. I m not using any constraints/...

SQL server: Can NT accounts be mapped to SQL server accounts

In our database we have an SQL server account that has the correct roles to access some of the databases. We are now switching to windows authentication and I was wondering if we can create a NT user ...

SQL Server 2000, ADO 2.8, VB6

How to determine if a Transaction is active i.e. before issuing Begin Transaction I want to ensure that no previous transaction are open.. the platform is VB6, MS-SQL Server 2000 and ADO 2.8

热门标签