Here are multiple ways to get the table information.
The DESCRIBE command does not exist in MS SQL SERVER. This is an Oracle command used to describe the structure of objects within a given database. To achieve the same task in MSSQL Server, there are a series of stored procedures with the prefix SP_ that can be used.
To view the structure of a table within the current database,
use the command
Code
sp_help 'TABLE_NAME';
If you would like to see more details, Create your custom procedure
we have to use the group by with having command to get the duplicate values. this query shall show the result of only the users have duplicate values in the employee table.
Syntex: Select columnName From Table_name Group By columnName Having count (*) > 1
Example: SELECT UserID FROM employee GROUP BY userid HAVING count( * ) > 1
nandu
Apr 26th, 2012
SELECT YourColumn, COUNT(*) TotalCount
FROM YourTable
GROUP BY YourColumn
HAVING COUNT(*) > 1
ORDER BY COUNT(*) DESC