select distinct B.name from syscomments A inner join sys.objects B on A.id = B.object_id where A.text like '%your_table_name%';
if(object_id('tempdb..#temp_table_name') is not null) print 'Table Exists'; else print 'Not Exists';
Ident_Seed('table_name');
Select Ident_Seed('Table_Name');
Select count(*) from employee_master;
select count(1) from employee_master;
select sum(1) from employee_master;
select object_name(id), rows from sys.sysindexes where object_name(id) = 'employee_master' and indid<2
exec sp_spaceused 'employee_master;'
SELECT IDENT_CURRENT('table_name') + 1
declare @count int; select @count = count(*) from tableName; select * from tableName except select top(@count - 2) * from tableName;
dividend % divisor