Scripts

Technical Article

Get all user information at the database level

This is based on Clint Herring's work and was better than what I was using ;). It has one user definded variable @path that is where to store the files generated. It will make one file per database and one master file to restore all user permissions into that database. Used mostly for DR and […]

You rated this post out of 5. Change rating

2005-03-30 (first published: )

1,016 reads

Technical Article

Import network computer EventLogs to SQL table

Creates the required table and stored procedure to facilitate the import ofEvent Log WARNING and FAILURE entries from a target computer into a SQL using Microsoft's LogParserfor monitoring and analysis.In order to import and analyze a number of computers' Event Logs, you should create a scheduled taskwith a series of steps that each execute this […]

You rated this post out of 5. Change rating

2005-03-28 (first published: )

1,273 reads

Technical Article

usp_exec_tsql_strfile

Executes a file containing T-SQL code without using OSQL. The file can be up to 80,000 characters. Each line in the file should be no more than 256 characters. (Customize the code as needed.) The DOS Type command is used to retrieve the code. Embedded "go"s are removed so don't expect termination behavior. The only […]

You rated this post out of 5. Change rating

2005-03-25 (first published: )

528 reads

Technical Article

Verify Directory Exists and Create if Necessary

This script will check to see if a directory exists and if it does not then it will create the directory. I did not create this as a stored procedure but it certainly could be. I tend to just place this as one of my job steps so I can create a backup file of […]

You rated this post out of 5. Change rating

2005-03-24 (first published: )

625 reads

Technical Article

shrinking logs: how much data will be reclaimed

This script will show you how much diskspace can be reclaimed by shrinking all the logfiles of userdatabases using a DBCC SHRINKFILE(2) command. Often the spacegain is much smaller then expected. SQL Shrinks logfiles the end of the file until it finds the active part of the logfile. (If the active part of the logfile […]

You rated this post out of 5. Change rating

2005-03-21 (first published: )

426 reads

Technical Article

Automated Profiler trace Create

This stored procedure is created to be invoked (in my case by SQL Server scheduled job), and will then create a tracefile to a specified file location (ensure that if this is NOT local, your SQL Server Agent runs on a domain account that has access to that drive. The Stored procedure will create files […]

You rated this post out of 5. Change rating

2005-03-16 (first published: )

433 reads

Technical Article

Stored Procedure Call Hierarchy

Easily extractss the complete stored procedure call hierarchy from "sysdepends" table of SQL Server and represent it in a pseudo-graphical tree-view.The script uses a temporary table (automatically created/dropped) to hold children and parents of relationships. For representing the call hierarchy the table contains a level field (depth) and a field containing the "enumerated path" (using […]

5 (5)

You rated this post out of 5. Change rating

2005-03-14 (first published: )

3,922 reads

Blogs

Spark Connect Dotnet November 2024 Where are we?

By

All Spark Connect Posts Introduction There have been quite a few changes in the last...

A New Word: Ochisia

By

ochisia – n. the fear that the role you once occupied in someone’s life...

Create a Numbers Table in Power Query

By

This is a quick blog post, mainly so I have the code available if...

Read the latest Blogs

Forums

Pivot Help

By mashispano

Hi Guys I need help pivoting the following SELECT [ID],[code_name],,[retail_price] FROM products 1 |...

Writer methods in PowerQuery (LOL)

By pietlinden

I'm using PowerQuery in Excel on my desktop. (Yeah, I know you can do...

Need help with GROUP BY...

By iamjoe

Here's my data... I am trying to return total days in status for each...

Visit the forum

Question of the Day

The Density Vector

When building statistics, there is the concept of density that refers to the duplicates in a table. How is this calculated?

See possible answers