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 MoreHere’s a T-SQL find all identity columns in a database. SELECT OBJECT_SCHEMA_NAME(tables.object_id, db_id()) AS SchemaName, tables.name As TableName, columns.name as ColumnName FROM sys.tables tables JOIN sys.columns columns ON tables.object_id=columns.object_id WHERE columns.is_identity=1 …
T-SQL find all identity columns Read MoreIn this blog we’ll see T-SQL query to find tables with identity columns In SQL Server. It can be done in two ways either by using Information_schema catalog or the system …
Find tables with identity columns in SQL Server Read MoreHere is a query to SQL Server find largest tables in a database. It’s very important for a DBA to monitor table size over time to foresee storage requirement/performance issues. The …
SQL Server Find largest tables Read More