Primary key not null in SQL Server
A Jr. Developer asked me why a primary key not null in SQL Server. A primary key uniquely identifies a row in a table and a NULL can’t identify any row. …
Primary key not null in SQL Server Read MoreSQL Server Education (by the geeks, for the geeks)
A Jr. Developer asked me why a primary key not null in SQL Server. A primary key uniquely identifies a row in a table and a NULL can’t identify any row. …
Primary key not null in SQL Server Read MoreHere’s a T-SQL find tables without primary key. SELECT OBJECT_SCHEMA_NAME(tables.object_id,db_id()) AS SchemaName, tables.name As TableName FROM sys.tables tables join sys.indexes indexes ON tables.object_id=indexes.object_id WHERE indexes.is_primary_key=0 GO The sys.indexes.is_primary_key column indicates whether …
T-SQL find tables without primary key Read MoreIt’s a common task that needs to be done on development/test environment. Though it seems that deleting a column from a table is just running an ALTER TABLE statement, however it’s …
T-SQL script delete column from a table Read MoreIt often happens that DBA’s/Developers end up creating database objects(mostly tables) during development phase for various reasons like intermediate testing or backup. Such objects often end up on production databases. DBA’s/Developers often …
SQL Server Identify Unused Tables & Indexes Read More