dbeaver / dbeaver/dbeaver

[SQL Server] - DDL For *Existing* Index Gets Table Wrong

Open
#23,372 8 comments 0 reactions 0 assignees View on GitHub
can't reproduce x:mssql xf:metadata
Dominant language
Java
Stars
51.8k
Forks
4.4k
Avg merge
3d 8h
Merged PRs (30d)
188

Description

### Description

See screengrab:
![image](https://github.com/dbeaver/dbeaver/assets/165072496/1e0c4ac4-c9c8-49a8-b636-9a3f0827d1d1)

It's the right index, but the wrong table. The table in the DDL exists; but is in an entirely different database that exists on the same server.

### DBeaver Version

Version 24.0.0.202403031740

### Operating System

Windows 10

### Database and driver

Microsoft JDBC Driver 8.2 for SQL Server 8.2.0.0

### Steps to reproduce

Not entirely sure, to be honest :/

It seems to have something to do with if you have a database + schema 'bolded' in the Database Navigator, but you either:
a) expand a different database / schema / table / index tree by clicking just the 'expand' (+) icons and then immediately RH click the 'create SQL -> DDL' menu option (without specifically 'selecting' some component of the Navigator tree) or

b) you have already expanded the 'tree' to view and can see the index you want to generate the DDL for; but you have a different database/schema/table 'bolded' in the Database Navigator.

I haven't _exactly_ narrowed down what the circumstances are. Sorry.

### Additional context

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.