我正在尝试通过这个示例创建一个SSIS包,但查询不能在步骤6上工作,并且看起来没有" dbo.dimcurrency"此数据库中的表。执行查询时出现以下错误.. Msg 208,Level 16,State 1,Line 2 无效的对象名称&#d ;.DimCurrency'。
https://msdn.microsoft.com/en-us/library/5c59f723-9707-4407-80ae-f05f483cf65f(v=sql.110)
<code> use AdventureWorks2012;
Select * from (select * from [dbo].[DimCurrency]) as refTable
where [refTable].[CurrencyAlternateKey] = 'ARS'
OR
[refTable].[CurrencyAlternateKey] = 'AUD'
OR
[refTable].[CurrencyAlternateKey] = 'BRL'
OR
[refTable].[CurrencyAlternateKey] = 'CAD'
OR
[refTable].[CurrencyAlternateKey] = 'CNY'
OR
[refTable].[CurrencyAlternateKey] = 'DEM'
OR
[refTable].[CurrencyAlternateKey] = 'EUR'
OR
[refTable].[CurrencyAlternateKey] = 'FRF'
OR
[refTable].[CurrencyAlternateKey] = 'GBP'
OR
[refTable].[CurrencyAlternateKey] = 'JPY'
OR
[refTable].[CurrencyAlternateKey] = 'MXN'
OR
[refTable].[CurrencyAlternateKey] = 'SAR'
OR
[refTable].[CurrencyAlternateKey] = 'USD'
OR
[refTable].[CurrencyAlternateKey] = 'VEB'
</code>
答案 0 :(得分:0)
您需要安装AdventureWorksDW2012数据库才能完成本教程。您试图从不存在的表[dbo].[DimCurrency]
中读取。请参阅要求here。
<强>更新强>
您可以使用以下SQL创建[dbo]。[DimCurrency]表,这应该消除您的错误(尽管该表显然是空的):
USE AdventureWorks2012
CREATE TABLE [dbo].[DimCurrency]
(
[CurrencyAlternateKey] nchar(3) NOT NULL,
[CurrencyKey] int NOT NULL,
[CurrencyName] nvarchar(50) NOT NULL
);