MS SQL Server – How Can I Optimize a SQL Query to Count Non-Blank Column Values Without Using a Cursor?
I have written a T-SQL script to count non-blank values in each column across all tables in a database. The script currently uses a cursor to iterate through each column and dynamically generate and execute SQL to count the values, excluding blanks and, in the case of date columns, excluding the date ‘1900-01-01’. Here is the script:
Remove duplicate nulls from a SQL server table
Issue table
col1 col2 col3 col4
1 null a null
1 b null null
1 null null c
2 aa null null
2 null bb null
How to remove specific decimal from integer in sql server?
let we have value 2006 and now i want to remove 0 from it and the result is 26.