Quantcast
Channel: Forum Getting started with SQL Server
Viewing all articles
Browse latest Browse all 7129

SELECT...INTO - No error, but no table either!

$
0
0

Hello,

I am trying to create a table containing the results of a query with lots of JOINs. I'm using SELECT...INTO. The statement runs and tells me that the correct number of rows were affected, but it doesn't create the table. I'd like opinions on why it's failing.

The query runs properly and produces the expected results without the INTO clause.

My query is:

USE MarketingAnalysis_BAK
GO

ALTER DATABASE MarketingAnalysis_BAK SET RECOVERY BULK_LOGGED;
GO

IF OBJECT_ID('dbo.RawData_SteelPoles', 'U') IS NOT NULL
    DROP TABLE dbo.RawData_SteelPoles;
GO

SELECT   (a long series of columns)
INTO     dbo.RawData_SteelPoles
FROM     (a long series of joined tables)
GROUP BY (a long series of columns)
;
GO

ALTER DATABASE MarketingAnalysis_BAK SET RECOVERY FULL;
GO

-- Thanks in advance.


Viewing all articles
Browse latest Browse all 7129

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>