microsoft / microsoft/vscode-mssql
[Bug]: MSSQL treats all Designer opening errors as fatal
- Dominant language
- TypeScript
- Stars
- 1.9k
- Forks
- 610
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 97
Description
### Description
Opening Schema Design or Right-click > Edit Table on a database with Shared Hosting, the designer hangs forever. I have sufficient privileges to log in and perform DDL actions. Opening the same options in SSMS, I get warning messages, like "You are not logged on as the database owner or system administrator. You might not be able to save changes to tables that you do not own." My expected behavior in the extension would be a warning which I can click OK and bypass, then view / edit the schema definition.
My quick and dirty suggestion would be to update tableDesignerWebviewController.ts to use an enum of the "survivable" or warning-level connection errors something like this:
`enum SqlServerPermissionWarnings {
NotLoggedOnAsDatabaseOwner = 15247, // User is not db_owner or sysadmin
TableNotOwned = 15291, // User does not own table
NotOwnerOfObject = 15001, // Object does not exist or no permission
//InsufficientPrivileges = 229, // SELECT permission denied
//LoginFailedForUser = 18456, // Login failed (sometimes permissions)
//PermissionDeniedOnObject = 230, // Permission denied on object
//CannotOpenDatabase = 4060, // Database access denied (sometimes)
//UserNotInDatabase = 916, // User not associated with trusted connection
//PermissionDeniedOnDatabase = 262, // Permission denied on database
//CannotExecuteAsUser = 15517, // Cannot execute as the database principal
//ViewDefinitionPermissionDenied = 300, // Permission denied on view definition
//AlterTablePermissionDenied = 4701, // ALTER TABLE permission denied
//CreateTablePermissionDenied = 262, // CREATE TABLE permission denied in database
//DropTablePermissionDenied = 3701, // DROP TABLE permission denied
//SchemaPermissionDenied = 15150 // Permission denied on schema
}
// Helper interface for SQL Server errors
interface SqlServerError extends Error {
number?: number;
severity?: number;
state?: number;
procedure?: string;
lineNumber?: number;
}
// Helper function to extract SQL Server error code
function getSqlServerErrorCode(error: any): number | null {
// Check if it's a structured SQL Server error
if (error && typeof error === 'object') {
// Direct error number property
if (error.number && typeof error.number === 'number') {
return error.number;
}
// Error code property (alternative naming)
if (error.code && typeof error.code === 'number') {
return error.code;
}
// Parse from error message if structured
if (error.message && typeof error.message === 'string') {
// Look for patterns like "Error: 229," or "Msg 229,"
const errorCodeMatch = error.message.match(/(?:Error|Msg)\s*:?\s*(\d+)/i);
if (errorCodeMatch) {
return parseInt(errorCodeMatch[1], 10);
}
// Look for patterns like "[SQL Server Error: 229]"
const bracketMatch = error.message.match(/\[SQL Server Error:\s*(\d+)\]/i);
if (bracketMatch) {
return parseInt(bracketMatch[1], 10);
}
}
}
return null;
}`
The commented enum items might be useful for other flow control, but I believe the top three are should be "warning-level".
### Steps to Reproduce
1. Connect to my Database on a Shared hosting Windows server such as [asphostportal.com](https://asphostportal.com/)
2. Right-Click on Database Name > choose Schema Designer or
Expand Tables node, Right-Click > "Edit Table"
### Affected Area
- [ ] Connection dialog (SQL Server | Azure browse/Fabric browse)
- [ ] Query results panel
- [ ] Query editor
- [ ] Object Explorer
- [x] Table Designer
- [ ] Schema Compare
- [x] Schema Designer
- [ ] Local SQL Server Container provisioning
- [ ] SQL database in Fabric provisioning
- [ ] GitHub Copilot integration
- [ ] Query Plan Visualizer
- [ ] Other (please describe below)
### If you selected "Other", please describe the affected area
_No response_
### Environment Information
Version: 1.104.1
Commit: 0f0d87fa9e96c856c5212fc86db137ac0d783365
Date: 2025-09-17T23:36:24.973Z
Electron: 37.3.1
ElectronBuildId: 12404162
Chromium: 138.0.7204.235
Node.js: 22.18.0
V8: 13.8.258.31-electron.0
OS: Darwin arm64 24.6.0
MSSQL
Identifier: ms-mssql.mssql
Version: 1.36.0
Last Updated: 2025-09-22, 05:12:09
### Confirmation
- [x] I have searched existing issues and couldn't find a match
- [ ] I want to work on this issue
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.