Thursday, 14 November 2019

SOLID Principle in Programming

This principle is an acronym of the five principles which is given below…
  1. Single Responsibility Principle (SRP)
  2. Open/Closed Principle
  3. Liskov’s Substitution Principle (LSP)
  4. Interface Segregation Principle (ISP)
  5. Dependency Inversion Principle (DIP)
Read more here >
 

Friday, 9 November 2012

how to get the count of columns of tables in sql



Get the number of columns in the table

Use [yourdatabaseName]

SELECT COUNT(*)
FROM information_schema.columns
WHERE table_name = 'yourtableName'

OR

SELECT COUNT(*)
FROM yourdatabaseName.sys.columns
WHERE object_id = OBJECT_ID('yourdatabaseName.dbo.yourtableName')