Scripts

Technical Article

Retreiving all the Table Information from SQL

The Query will enable you to retrieve all the Tables in the Database .The Output of the Query will list all the User Tables along with the Column Names and the Sort order of the Columns .The Query will also return as to whether the Columns in the table are with allow null option or […]

★ ★ ★ ★ ★ ★ ★ ★ ★ ★

You rated this post out of 5. Change rating

2006-07-06 (first published: )

477 reads

Technical Article

Overcome BCP limitations for output to CSV file

This is an example to overcome short comings when using BCP to create a 'proper' CSV file. The view vw_Customers_RAW is used in order to provide a method of creating the column heading row and to enclose columns with embedded comma with double quotes, which are not options in BCP. There are more generic methods […]

★ ★ ★ ★ ★ ★ ★ ★ ★ ★

(1)

You rated this post out of 5. Change rating

2006-07-03 (first published: )

3,075 reads

Technical Article

Share Permissions

Use this Perl script to produce an audit report of both share permissions and NTFS permissions of the shared folders. To report share permissions:Use shareperms.pl -p -SMyServer1 to report on a single server.Or use shareperms.pl -p -SMyServer1,MyServer2 for multiple servers.You can also use a text file as input: shareperms.pl -p -CServers.txtTo report NTFS permissions use […]

★ ★ ★ ★ ★ ★ ★ ★ ★ ★

You rated this post out of 5. Change rating

2006-06-27 (first published: )

358 reads

Technical Article

SQLServerRegistrationBackup.bat

Backs up the SQL Server EM registration from the registry. Assumes that EM is configured to save common, not by user/independently. I recommend changing EM to Store locally for all users, (not independently) and create a weekly scheduled job to backup the HKLM..\..\Registered Servers X branch.Configure EM to store settings for the local machine, all […]

★ ★ ★ ★ ★ ★ ★ ★ ★ ★

(1)

You rated this post out of 5. Change rating

2006-06-26 (first published: )

355 reads

Technical Article

MS SQL Server role db_create_dts

For several times i had faced a problem of having “special” users, that need to create and run their own DTSs. I produced this script after implementing all the steps needed to allow normal users to do and run their DTSs.I hope it will be helpful at least for some of you.

★ ★ ★ ★ ★ ★ ★ ★ ★ ★

You rated this post out of 5. Change rating

2006-06-23 (first published: )

301 reads

Technical Article

UDF: Estimating the size of a table

In database planning and design it is essential to plan out how much HD space you are going to need to store your data. If you use BOL and do a search for "Estimating Table Size" you get three articles: - Estimating the size of a table - Estimating the size of a table with […]

★ ★ ★ ★ ★ ★ ★ ★ ★ ★

You rated this post out of 5. Change rating

2006-06-21 (first published: )

539 reads

Technical Article

move all indexes to a secondary file group

Move all (or chosen) standard indexes from your primary file group to a secondary file group (hopefully located on a seperate array)excludes clustered indexes, statistics and indexes associated with a primary keywhen you run it - set the debug to 1 to identify what the script will move, set it to 0 to actually perform […]

★ ★ ★ ★ ★ ★ ★ ★ ★ ★

(3)

You rated this post out of 5. Change rating

2006-06-19 (first published: )

5,504 reads

Technical Article

UDF: Parse a delimited list of paramters

After replying to a post today I thought I'd share this with all.This is a user defined function that I use to return a table of parameters passed in a parameter string. Function UsageSelect * From dbo.fnParseParamString ([@ParamString='Delimited String of parmaters'],[@Delimeter='Delimiting Character'])Lets say you are concatenating a list of form data from a web page […]

★ ★ ★ ★ ★ ★ ★ ★ ★ ★

You rated this post out of 5. Change rating

2006-06-13 (first published: )

392 reads

Blogs

Announcements from the Microsoft Fabric Community Conference — Barcelona 2026

By

Microsoft shared a broad set of Fabric, Power BI, and SQL updates at FabCon...

Au Revoir for now

By

No, I’m not quitting or retiring. Just going on vacation, but I leave tonight...

Goodbye, Microsoft

By

A few years ago I took a new job at Microsoft, working as a...

Read the latest Blogs

Forums

Let's Talk Certifications

By Grant Fritchey

Comments posted to this topic are about the item Let's Talk Certifications, which is...

The Hidden Security Risks of Role Combination in SSAS Tabular

By Pablo Echeverria

Comments posted to this topic are about the item The Hidden Security Risks of...

The Empty Aggregate

By Steve Jones - SSC Editor

Comments posted to this topic are about the item The Empty Aggregate

Visit the forum

Question of the Day

The Empty Aggregate

I have this table in a SQL Server 2025 database:

CREATE TABLE [dbo].[CustomerOrder]
(
[OrderID] [int] NULL,
[CustomerID] [int] NULL,
[total] [money] NULL
) ON [PRIMARY]
GO
What is returned from this code? (answers are for the sum and then the count)
SELECT SUM(total) AS sum,
       COUNT(total) AS count
FROM dbo.CustomerOrder;



See possible answers