Skip to content

Commit ab137b8

Browse files
committed
added nolock hint to schema_statements
1 parent 9e2cc92 commit ab137b8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/active_record/connection_adapters/sqlserver/schema_statements.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ def data_source_sql(name = nil, type: nil)
260260
scope = quoted_scope name, type: type
261261
table_name = lowercase_schema_reflection_sql 'TABLE_NAME'
262262
sql = "SELECT #{table_name}"
263-
sql << ' FROM INFORMATION_SCHEMA.TABLES'
263+
sql << ' FROM INFORMATION_SCHEMA.TABLES WITH (NOLOCK)'
264264
sql << ' WHERE TABLE_CATALOG = DB_NAME()'
265265
sql << " AND TABLE_SCHEMA = #{quote(scope[:schema])}"
266266
sql << " AND TABLE_NAME = #{quote(scope[:name])}" if scope[:name]

0 commit comments

Comments
 (0)