microsoft / azuredatastudio

Azure Data Studio is a data management and development tool with connectivity to popular cloud and on-premises databases. Azure Data Studio supports Windows, macOS, and Linux, with immediate capability to connect to Azure SQL and SQL Server. Browse the extension library for more database support options including MySQL, PostgreSQL, and MongoDB.
https://learn.microsoft.com/sql/azure-data-studio
MIT License
7.59k stars 909 forks source link

Error when attempting to create a new table #21525

Closed son-le0 closed 1 year ago

son-le0 commented 1 year ago

Issue Type: Bug

  1. Open a new connection to an Azure subscription SQL database
  2. Right-click on Tables node
  3. Select "New Table"

Expected Result: New window to create new table.

Actual Result:

Table Designer Error "An error occurred while initializing the table designer: The target database schema could not be retrieved."

StackTrace from "Copy details": at Microsoft.Data.Tools.Sql.DesignServices.TableDesigner.TableDesigner..ctor(String connectionString, String accessToken, String schemaName, String tableName, Boolean isNewTable, Int32 largeTableRowCount) at Microsoft.SqlTools.ServiceLayer.TableDesigner.TableDesignerService.CreateTableDesigner(TableInfo tableInfo) in D:\a_work\1\s\src\Microsoft.SqlTools.ServiceLayer\TableDesigner\TableDesignerService.cs:line 1800 at Microsoft.SqlTools.ServiceLayer.TableDesigner.TableDesignerService.<>cDisplayClass18_0.<b__0>d.MoveNext() in D:\a_work\1\s\src\Microsoft.SqlTools.ServiceLayer\TableDesigner\TableDesignerService.cs:line 99 --- End of stack trace from previous location --- at Microsoft.SqlTools.ServiceLayer.TableDesigner.TableDesignerService.<>cDisplayClass17_0`1.<b__0>d.MoveNext() in D:\a_work\1\s\src\Microsoft.SqlTools.ServiceLayer\TableDesigner\TableDesignerService.cs:line 85

Azure Data Studio version: azuredatastudio 1.40.2 (661384637db384fe5d4e6224069adbe708580b16, 2022-12-22T22:05:27.289Z) OS version: Darwin arm64 22.2.0 Restricted Mode: No Preview Features: Disabled

System Info |Item|Value| |---|---| |CPUs|Apple M1 Pro (10 x 24)| |GPU Status|2d_canvas: enabled
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
metal: disabled_off
multiple_raster_threads: enabled_on
oop_rasterization: enabled
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_renderer: enabled_on
video_decode: enabled
video_encode: enabled
webgl: enabled
webgl2: enabled| |Load (avg)|2, 2, 2| |Memory (System)|32.00GB (1.31GB free)| |Process Argv|--disable-extensions| |Screen Reader|no| |VM|0%|
Extensions disabled
alanrenmsft commented 1 year ago

@son-le0 what type of azure SQL DB you were using? do you have full permission on the database?

son-le0 commented 1 year ago

@alanrenmsft The database is a Azure SQL Database and select USER_NAME() returns dbo.

alanrenmsft commented 1 year ago

@caohai could you please take a look?

alanrenmsft commented 1 year ago

@son-le0 does it help if you restart Azure Data Studio?

son-le0 commented 1 year ago

@son-le0 does it help if you restart Azure Data Studio?

Nope.

Also noticed the same error (intermittently) when I try the "Design" context menu item on an existing table.

alanrenmsft commented 1 year ago

@son-le0 are you using the Intel version of Azure Data Studio or Universal/Apple Silicon version?

son-le0 commented 1 year ago

Apple Silicon / arm64

alanrenmsft commented 1 year ago

@caohai ping...

caohai commented 1 year ago

@caohai ping...

I currently don't have an Apple Silicon machine at hand... I tried latest insider on my Intel Mac this morning and didn't see this issue. I'm not sure if this issue is related to the db or the Apple Silicon build. @alanrenmsft Can you verify if table designer works on Azure SQL DB with the Apple Silicon / arm64 build?

alanrenmsft commented 1 year ago

yes, I did, it works for me on my M1 Mac, in this case, can we add more logging to help us understand the problem?

cheenamalhotra commented 1 year ago

Related: #22486

alanrenmsft commented 1 year ago

close as a dupe of #22486 since it has more details.