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

Return to previous page

  • 4/7/2015
  • 1481 Views

Comments

1481 Views

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

Last updated 4 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

DNN Digest is our monthly email newsletter. It highlights news and content from around the DNN ecosystem, such as new modules and themes, messages from leadership, blog posts and notable tweets. Keep your finger on the pulse of the ecosystem by subscribing.  


Copyright 2017 by DNN Corp Terms of Use Privacy
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out