Stored Procedure to find huge tables with Row count in given database
/*——–Stored Procedure to find huge tables with Row count in given database————————*/ USE master GO IF EXISTS (SELECT 1 FROM sysobjects WHERE name = ‘sp_show_huge_tables’ AND type = ‘P’) DROP PROC...
View ArticleScript to find recovery models of DBs
SELECT name, DATABASEPROPERTYEX(name, ‘Recovery’) AS Expr1, DATABASEPROPERTYEX(name, ‘Status’) AS Expr2 FROM sysdatabases WHERE (DATABASEPROPERTYEX(name, ‘Recovery’) = ‘simple’) ORDER...
View ArticleScript to change SA password without having old password
Change the ‘SA’ password without having old password Use OSQL with the –E option (for authenticated user). If you are an administrator of the OS, you will get in without being prompted for the sa...
View ArticleScript create batch to run SSIS package
for %1 in (d:\TestPackages\t1*.dtsx) do dtexec /F “%1″
View ArticleScript to find database file growth
/***************************************************************************************************** First Create Procedure and execute on Sqlserver2000 server...
View ArticleScript To Monitor Databases Growth For Sqlserver2000 & 2005
Monitor Database Growth For SQLSERVER2005 __________________________________________________________________________________________________________________________________________________ –PART 1 If...
View ArticleScript to Enable xp_cmdshell sp
sp_configure ‘show advanced options’, 1 GO RECONFIGURE GO sp_configure ‘xp_cmdshell’, 1 GO RECONFIGURE GO
View ArticleScript to Kill all the connections for the database in sqlserver2005
Below script will help you to kill all the existing connection coming to the user databases. Copy and paste the script in Query window and change the DBName to the one that you want to troubleshoot. –...
View ArticleScript to get the sqlserver configuration detials for audit purpose
Below script will help you get the configuration details of sqlserver. This configuration can be captured and use it anytime to perform audit and to do inventory. —-Script to get configuration...
View ArticleScript to get all currently running requests
select r.session_id, r.start_time, db = db_name(database_id), r.command, st.text, substring(st.text, r.statement_start_offset/2+1, (case when r.statement_end_offset = -1 then len(convert(nvarchar(max),...
View Article
More Pages to Explore .....