HI
I am having some list of column in the table in the database.
I need to find out particular column name is exists in the table in the database.
In addition to that i want to know what are the table that column name exists in the database.
Thanks.
DECLARE @Table VARCHAR(100),@Column VARCHAR(100) SET @Table = 'Employees' SET @Column = 'EmployeeId' IF EXISTS(SELECT object_id FROM sys.columns WHERE Name = @Column AND Object_ID = Object_ID(@Table)) BEGIN PRINT 'EXISTS' END ELSE BEGIN PRINT 'DOES NOT EXIST' END
© COPYRIGHT 2025 ASPSnippets.com ALL RIGHTS RESERVED.