Post

Key points for ms sql server as professional DB Developer

Key points for ms sql server as professional DB Developer

1- Use IsNull to set default value of amount,date
    e.g ISNULL(ReturnAgentInfo,0) AS agentinfo
2- Don’t use the + operator to concatenate the expressions
3- Avoid the risk of the divide by zero error

e.g
    SELECT ProductName
  , Price
  , (Price / NULLIF(PriceTax,0)) * 100 AS [PriceTaxRatio]
FROM Products

3- Counting SQL NULL values

 SELECT COUNT(ISNULL(ProductName,'')) AS 'Number Of Product' FROM Products
4- avoide conversion in where clause

By  asifjans    29-Jul-2022

Solutions and sugestions


Your Answer