Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Script as Alter returns empty script #24051

Closed
cheenamalhotra opened this issue Aug 2, 2023 · 2 comments · Fixed by #24352
Closed

Script as Alter returns empty script #24051

cheenamalhotra opened this issue Aug 2, 2023 · 2 comments · Fixed by #24352
Assignees
Labels
Area - Object Explorer Bug Size: S For a small complexity issue - only when fixed with a PR Triage: Done

Comments

@cheenamalhotra
Copy link
Member

  • Azure Data Studio Version: 1.45, Insiders
  • OS Version: Windows 11

Steps to reproduce:

  1. Expand OE tree to reach a table
  2. Right click > 'Script as Alter'
  3. Notice it generates empty script

script-alter

Expand for SQL Tools Service log
[Trace - 10:30:03 PM] Sending request 'scripting/script - (22)'.
Params: {
    "connectionString": null,
    "scriptingObjects": [
        {
            "type": "Table",
            "schema": "dbo",
            "name": "t1",
            "parentName": null,
            "parentTypeName": null
        }
    ],
    "scriptDestination": "ToEditor",
    "includeObjectCriteria": null,
    "excludeObjectCriteria": null,
    "includeSchemas": null,
    "excludeSchemas": null,
    "includeTypes": null,
    "excludeTypes": null,
    "scriptOptions": {
        "scriptCreateDrop": "ScriptCreate",
        "typeOfDataToScript": "SchemaOnly",
        "scriptStatistics": "ScriptStatsNone",
        "targetDatabaseEngineEdition": "SqlServerEnterpriseEdition",
        "targetDatabaseEngineType": "SingleInstance",
        "scriptCompatibilityOption": "Script140Compat"
    },
    "connectionDetails": null,
    "selectScript": null,
    "ownerURI": "connection:providerName:MSSQL|database:master|server:localhost\\MSSQLSERVER01|trustServerCertificate:true|user:sa|databaseDisplayName:master|groupId:C777F06B-202E-4480-B475-FA416154D458",
    "operation": 6
}

[Trace - 10:30:04 PM] Received notification 'scripting/scriptComplete'.
Params: {
    "errorDetails": null,
    "errorMessage": null,
    "hasError": false,
    "canceled": false,
    "success": true,
    "operationId": "622036ea-8462-44c3-b8b8-ac8db692f138",
    "sequenceNumber": 0
}

[Trace - 10:30:04 PM] Received response 'scripting/script - (22)' in 812ms.
Result: {
    "operationId": "622036ea-8462-44c3-b8b8-ac8db692f138",
    "script": "\r\nGO\r\n"
}

It seems v1.44.1 didn't show 'Script as Alter' menu option (which is strange as the implementation seems quite old) and with v1.45 it doesn't seem to work.

@alanrenmsft since you last worked on this area, do you know why v1.44.1 didn't show 'Script as Alter' menu and now that is does - it doesn't work? I haven't dug deep into this yet, would appreciate any insights.

@alanrenmsft
Copy link
Contributor

maybe this is related to the changes Aasim did?

@cheenamalhotra
Copy link
Member Author

@aasimkhan30 do you recall any changes in this area that has recently caused this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area - Object Explorer Bug Size: S For a small complexity issue - only when fixed with a PR Triage: Done
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

2 participants