Products

Solutions

Resources

Partners

Community

Blog

About

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Statement SELECT INTO is not supported in this version of SQL Server

Return to previous page

  • 4/7/2015
  • 2967 Views

Comments

2967 Views

Statement SELECT INTO is not supported in this version of SQL Server

Last updated 7 years ago

Comments

Common

(Enter the content of this article below)

Advanced

 

Error

Statement 'SELECT INTO' is not supported in this version of SQL Server. (see http://blogs.msdn.com/b/sqlazure/archive/2010/05/04/10007212.aspx for more information)

Cause

SQL Azure requires that all tables have clustered indexes therefore SELECT INTO statements, which creates a table and does not support the creation of clustered indexes. If you plan to migrate to SQL Azure, you need to modify your code to use table creation instead of the SELECT INTO Statement. This goes for both temporary tables (where clustered indexes are not required) and permanent tables.

Fix

To work around this you need to create your destination table then call INSERT INTO. Here is an example:

CREATE TABLE #Destination (Id int NOT NULL, [Name] nvarchar(max), [Color] nvarchar(10))


INSERT INTO #Destination(Id, [Name], [Color])
SELECT Id, [Name], [Color]
FROM Source
WHERE [Color] LIKE 'Red';

-- Do Something

DROP TABLE #Destination

Part of the SQL Azure Compatibility Centre
Contents
No sections defined
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out