Wednesday, 2 March 2016

Get SQL Database Table Names, Procedures, Table types and Views names



SELECT Name FROM sys.objects WHERE [Type] In ('U') -- For table Names



SELECT Name FROM sys.objects WHERE [Type] In ('V') -- For VIEWS



SELECT Name FROM sys.objects WHERE [Type] In ('PK') -- For PRIMARY_KEY_CONSTRAINT



SELECT Name FROM sys.objects WHERE [Type] In ('TT') -- For TYPE_TABLE




SELECT Name FROM sys.objects WHERE [Type] In ('P') -- SQL_STORED_PROCEDURE



No comments:

Post a Comment

How to highlight selected text in notepad++

  –> To highlight a block of code in Notepad++, please do the following steps step-1  :- Select the required text. step-2  :- Right click...