Search code examples
sql-serverssmssql-server-expresslocaldbssms-2012

Can't generate scripts from LocalDB in SQL Management Studio


I can't export scripts from my LocalDB database (localdb)\v11.0. (SQL Express is fine)

The error I get is

Save or Publish Scripts Report

Getting the list of objects from 'XXX'. Failed

System.IndexOutOfRangeException: Index was outside the bounds of the array. at Microsoft.SqlServer.Management.SqlScriptPublish.GeneratePublishPage.worker_DoWork(Object sender, DoWorkEventArgs e) at System.ComponentModel.BackgroundWorker.OnDoWork(DoWorkEventArgs e) at System.ComponentModel.BackgroundWorker.WorkerThreadStart(Object argument)

This is using SQL Server 2008 R2.

Does anyone know what is causing this?


Solution

  • As LocalDb is SQL Server 2012, you should use SSMS 2012 or later for this scripting task