How to get all the Tables with or without Primary Key Constraint in Sql Server?
We can write a query like below to get all the Tables with no Primary key constraint: SELECT T.name 'Table without Primary Key' FROM SYS.Tables T WHERE OBJECTPROPERTY(object_id,'TableHasPrimaryKey') =...
View ArticleHow to find all the tables with no indexes at all in Sql Server?
We can write a query like below to get all the Tables in the Database that don’t have any indexes: SELECT Name 'Tables without any Indexes' FROM SYS.tables WHERE...
View ArticleHow to get all the Tables with or without Non-Clustered Indexes in Sql Server?
We can write a query like below to get all the Tables without any Non-Clustered indexes: --List all the Tables with NO Non-Clustered Indexes SELECT Name 'Tables without any Non-Clustered Indexes' FROM...
View ArticlePRINT/SELECT Statement messages within WHILE LOOP or BATCH of statement is...
Are you facing the problem where the PRINT/SELECT statements messages are not being displayed like the one’s explained in the below two scenario’s? Let us go through these scenario’s and also see how...
View ArticleWhy the prefix N is used for literal strings in Sql Server?
The Prefix N conveys to the Sql Server that following literal string is of Unicode type. While storing Unicode (i.e. Japanese, Korean, Chinese etc) Characters in NChar, NVarchar or NText columns or...
View ArticleHow to get all HEAP Tables or Tables without Clustered Index in Sql Server?
A Table that doesn’t have a Clustered Index is referred to as a HEAP Table. We can write a query like below to get all the HEAP Tables or tables that doesn’t have Clustered Index: SELECT T.Name 'HEAP...
View Article