Trying to figure out a SQL script to test the existence of primary keys in cerain tables. If the table has no primary key, then the script should output the table name.
Tables to test:
TableA
TableB
TableC
After running the script (and lets say TableA and TableC have PKs, but not TableB), then the output would be below:
NoKeys
TableB
1 Answer