Skip to content

Commit

Permalink
Check for SQL Server VIEW DEFINITION rights fails, if databasename co…
Browse files Browse the repository at this point in the history
…ntains special chars (#29612)

Fixes #29610
  • Loading branch information
ErikEJ authored Nov 18, 2022
1 parent 8fdc756 commit 6f02d4c
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ private void CheckViewDefinitionRights(DbConnection connection)
{
using var command = connection.CreateCommand();
command.CommandText = @"
SELECT HAS_PERMS_BY_NAME(DB_NAME(), 'DATABASE', 'VIEW DEFINITION');";
SELECT HAS_PERMS_BY_NAME(QUOTENAME(DB_NAME()), 'DATABASE', 'VIEW DEFINITION');";
var hasAccess = (int)command.ExecuteScalar()!;

if (hasAccess == 0)
Expand Down

0 comments on commit 6f02d4c

Please sign in to comment.