microsoft:microsoft_sql_server:sql:check_object_exists
Microsoft - Microsoft SQL Server - SQL - Check Object Exists
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[SomeTable$Some Doc]') AND TYPE IN (N'U')) UPDATE[SomeTable$Some Doc] SET ...
Alternatively
IF EXISTS (SELECT 1 FROM SomeTable WHERE Name = 'somename')
microsoft/microsoft_sql_server/sql/check_object_exists.txt · Last modified: 2022/07/01 07:58 by 45.89.242.205