SQLTeam.com | Weblogs | Forums

Azure sql truncate table partitions error


#1

Hi everyone,

we have database project and im using some partitions on tables, when I build the solution I am getting below error :

In VS 2012 with latest SSDT and Target platform: "Microsoft Azure SQL Database V12" I get this error :
"SQL46010: Incorrect syntax near (. " and its mark bracket between "WITH ( PARTITIONS"

Actual Syntax used in one of my SP is TRUNCATE TABLE PartitionTable1 WITH (PARTITIONS (2, 4, 6 TO 8));

Please let me know if anyone faced this issue and any resolution or workaround.


#2

YOu need to be running 2016:

. Truncate Table Partitions

Applies to: SQL Server (SQL Server 2016 Community Technology
Preview 2 (CTP2) through current
version).


#3

Thanks very much for the reply.

How about Visual Studio version to be as i build the Db project there and my current version is VS2013 Update 4.

so at the moment I have to wait till next SDDT version is available.


#4

It's not about your VS version. It's about the version of SQL Server. That is, you can use Visual Studio 2003 to create a query running the TRUNCATE command and send it to SQL Server, but whether it runs successfully depends on SQL Server, not Visual Studio