Quantcast
Channel: Sqlserver Blog » Scripts to use
Browsing all 10 articles
Browse latest View live

Image may be NSFW.
Clik here to view.

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 Article



Image may be NSFW.
Clik here to view.

Script 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 Article

Image may be NSFW.
Clik here to view.

Script 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 Article

Image may be NSFW.
Clik here to view.

Script create batch to run SSIS package

for %1 in (d:\TestPackages\t1*.dtsx) do dtexec /F “%1″

View Article

Image may be NSFW.
Clik here to view.

Script to find database file growth

/***************************************************************************************************** First Create Procedure and execute on Sqlserver2000 server...

View Article


Image may be NSFW.
Clik here to view.

Script To Monitor Databases Growth For Sqlserver2000 & 2005

Monitor Database Growth For SQLSERVER2005 __________________________________________________________________________________________________________________________________________________ –PART 1 If...

View Article

Image may be NSFW.
Clik here to view.

Script to Enable xp_cmdshell sp

sp_configure ‘show advanced options’, 1 GO RECONFIGURE GO sp_configure ‘xp_cmdshell’, 1 GO RECONFIGURE GO

View Article

Image may be NSFW.
Clik here to view.

Script 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 Article


Image may be NSFW.
Clik here to view.

Script 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 Article


Image may be NSFW.
Clik here to view.

Script 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
Browsing all 10 articles
Browse latest View live




Latest Images