Skip to content

Commit

Permalink
Cleanup from removed column and overlooked CONCAT (#441)
Browse files Browse the repository at this point in the history
* Changing queries to be compatible with MSSQL2000

Changing the queries to be compatible with MSSQL Server 2000 (v8.x), replacing CONCAT with ISNULL(string, '') + next string and STRING_AGG with a COALESCE(STUFF(ISNULL())) mix.

* Cleanup from removed column and overlooked CONCAT

Forgot to clean comma from removed column and the very CONCAT used as an example in #440, was not converted using the ISNULL() approach.

* Revert "Cleanup from removed column and overlooked CONCAT"

This reverts commit eec1e55.

* Cleanup from removed column and overlooked CONCAT

Forgot to clean comma from removed column and the very CONCAT used as an example in #440, was not converted using the ISNULL() approach.
  • Loading branch information
glha authored and mtxr committed Nov 6, 2019
1 parent 81cc18a commit 4e145fb
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions packages/core/dialect/mssql/queries.ts
Expand Up @@ -20,6 +20,7 @@ SELECT
ISNULL('${TREE_SEP}', '') +
ISNULL(C.TABLE_SCHEMA, '') +
ISNULL('${TREE_SEP}', '') +
(
CASE
WHEN T.TABLE_TYPE = 'VIEW' THEN 'views'
Expand Down Expand Up @@ -98,10 +99,10 @@ SELECT
f.specific_name AS name,
f.routine_schema AS dbSchema,
f.routine_catalog AS dbName,
concat(
f.routine_schema,
'.',
f.routine_name
(
ISNULL(f.routine_schema, '') +
ISNULL('.', '') +
ISNULL(f.routine_name, '')
) as signature,
COALESCE(STUFF(
(ISNULL(', ' + p.data_type, '')), 1, 2, N''
Expand Down

0 comments on commit 4e145fb

Please sign in to comment.