PowerShell – Query Database Remotely
The basic syntax for sending a query to SQL Server using PowerShell. sqlcmd -S SERVER_NAME -d master -Q "select count(1) from sys.objects"
The basic syntax for sending a query to SQL Server using PowerShell. sqlcmd -S SERVER_NAME -d master -Q "select count(1) from sys.objects"
Occasionally, you discover something that you have been doing wrong for a long time. Sometimes it wasn’t something outright wrong but was just stupid. That is what happened to me. When using an HTML checkbox, it “POSTS” to the form submit page with the value of “on”. I have always converted that on the page… Read More »
SELECT COL_TO_CHECK, COUNT(COL_TO_CHECK) FROM table1 GROUP BY COL_TO_CHECK HAVING COUNT(*) > 1 ORDER BY COUNT(*) If there is more than 1 column with that value it will show up like: COL_TO_CHECK COUNT(COL_TO_CHECK) ————————————————————- Value 3 Value2 2 Value99 4