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

Fix backwards compatibility for SQLServer >= 2008 #1823

Merged
merged 1 commit into from
Dec 13, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions apps/studio/src/lib/db/clients/sqlserver.js
Original file line number Diff line number Diff line change
Expand Up @@ -511,11 +511,11 @@ export async function listTableColumns(conn, database, table, schema) {
is_nullable as "is_nullable",
CASE
WHEN character_maximum_length is not null AND data_type != 'text'
THEN CONCAT(data_type, '(', character_maximum_length, ')')
THEN data_type + '(' + CAST(character_maximum_length AS VARCHAR(16)) + ')'
WHEN numeric_precision is not null
THEN CONCAT(data_type, '(', numeric_precision, ',', numeric_scale, ')')
THEN data_type + '(' + CAST(numeric_precision AS VARCHAR(16)) + ')'
WHEN datetime_precision is not null AND data_type != 'date'
THEN CONCAT(data_type, '(', datetime_precision, ')')
THEN data_type + '(' + CAST(datetime_precision AS VARCHAR(16)) + ')'
ELSE data_type
END as "data_type"
FROM INFORMATION_SCHEMA.COLUMNS
Expand Down