SQL 服务器将 CSV 数据导入 Temp Table 无法查询导入的数据
SQL Server Import CSV Data into Temp Table Unable to Query Imported Data
我已使用 SSMS 导入向导将 CSV 数据导入到名为 #CSVImportTable 的临时 table 中。但是这样做之后我无法查询温度 table。我的假设是我需要访问与临时 table 相关的 'Connection' 但这只是一个猜测。
如何在使用向导后从这个临时 table 查询数据?查看系统数据库时我可以看到临时 table --> tempdb --> 临时 Tables --> dbo.#CSVImportTable 但我不知道如何连接或访问为其创建临时 table 的实例,以便从 SSMS 中查询它。
我该如何克服这个问题?
Visible Temp 的屏幕截图Table 使用导入向导创建
单击“完成”前向导结果的屏幕截图
我正在使用 SSMS v18.5。此版本没有 Stack Overflow 标签,但我添加了指向 Microsoft 下载页面的超链接。
我的问题的解决方案是简单地将我的数据插入全局温度 Table,然后在我想使用该数据的 SSMS 选项卡上,我只是 SELECT 从将全局温度 Table 转换为本地温度 Table。因此,我在我需要处理这些数据的所有脚本的顶部粘贴 SQL 以将数据移动到临时 Table.
/* Grab data out of Global Temp Table and store it in Local Temp Table to use for the Life of the Session */
SELECT *
INTO #CSVImportTable
FROM ##CSVDataImport
我已使用 SSMS 导入向导将 CSV 数据导入到名为 #CSVImportTable 的临时 table 中。但是这样做之后我无法查询温度 table。我的假设是我需要访问与临时 table 相关的 'Connection' 但这只是一个猜测。
如何在使用向导后从这个临时 table 查询数据?查看系统数据库时我可以看到临时 table --> tempdb --> 临时 Tables --> dbo.#CSVImportTable 但我不知道如何连接或访问为其创建临时 table 的实例,以便从 SSMS 中查询它。
我该如何克服这个问题?
Visible Temp 的屏幕截图Table 使用导入向导创建
单击“完成”前向导结果的屏幕截图
我正在使用 SSMS v18.5。此版本没有 Stack Overflow 标签,但我添加了指向 Microsoft 下载页面的超链接。
我的问题的解决方案是简单地将我的数据插入全局温度 Table,然后在我想使用该数据的 SSMS 选项卡上,我只是 SELECT 从将全局温度 Table 转换为本地温度 Table。因此,我在我需要处理这些数据的所有脚本的顶部粘贴 SQL 以将数据移动到临时 Table.
/* Grab data out of Global Temp Table and store it in Local Temp Table to use for the Life of the Session */
SELECT *
INTO #CSVImportTable
FROM ##CSVDataImport