Kategoriarkiv: SQL Server – scripts

How to move a Logfile to another location

— If you need to move a logfile onto another harddrive, you can do it this way. USE master GO — If this command just keeps running, then it properly is because there is connection against the database ALTER DATABASE … Læs resten

Udgivet i SQL Server - scripts | Kommentarer lukket til How to move a Logfile to another location

Showing the number of packages read and written in the last 30 sec.

— A script showing the number of reads/write for the last 30 sek. — Made by SeoSoft ApS — E-mail: SEO@SeoSoft.dk SELECT c.session_id, c.num_reads, c.num_writes, c.net_packet_size, c.client_net_address, st.text INTO #CONNECTIONS FROM sys.dm_exec_connections AS c CROSS APPLY (SELECT * FROM sys.dm_exec_sql_text(c.most_recent_sql_handle)) … Læs resten

Udgivet i SQL Server - scripts | Kommentarer lukket til Showing the number of packages read and written in the last 30 sec.

Create XML file for showing SQL Security settings

— This script is making an XML file showing all security setting at a SQL Server — specifying which users are member of which Server/Database roles — Perhaps I am modifying the script to show which objects user defined roles … Læs resten

Udgivet i SQL Server - scripts | Kommentarer lukket til Create XML file for showing SQL Security settings

Drop Column statistics

Are you facing suddenly poor performance, try to recreate Columns statistics. SQL Server are using these statistics to decide which execution-plan would be the best. You always have to run this script when you are upgrading your SQL server from … Læs resten

Udgivet i SQL Server - scripts | Tagget , , | Kommentarer lukket til Drop Column statistics