This script modifies another excellent script written by SHAS3. The original script examines tables for changes and sends an email. This modification examines all stored procedures, tables, indexes, etc. in ALL databases or just the CURRENT database. If changes are detected, the script has the option to either email or log to a table that […]
2005-10-26 (first published: 2005-09-28)
255 reads
This script outputs the TSQL code to do perform an 'Upsert'.It depends on both the source & target tables having the same structure and rows being uniquely identified with a single field.Three variables need to be updated prior to execution of this script:@SourceTable: Table containing the data to be upserted@TargetTable = Table to be upserted […]
2005-10-25 (first published: 2005-09-30)
651 reads
When you tell Enterprise Manager to "Create one file per object" when scripting objects from the database it gives those scripts a PRC extension.Unfortunately SQL Query Analyser defaults to a .SQL extension.The following DOS command renames all .PRC files to .SQL
2005-10-24 (first published: 2005-09-30)
445 reads
This script will create SQL Server top level groups in EM and then register a bunch of SQL Servers in their respective groups.The script maybe modified to as needed if the user does not wish to create groups. The script currently reads the list of servers tobe registered from a SQL Server database but could […]
2005-10-21 (first published: 2005-10-05)
192 reads
The script is not as complete (and complex) as the USP_GetJobSchedules from M.Pearson, M. Austin and R.Sotkiewicz, but it gives a list of the scheduled jobs with start time, name, frequency, category and whether is enabled or not
2005-10-20 (first published: 2005-10-05)
436 reads
Getting "Subquery returned more than 1 value" error on cursors. Changed the following in a couple of places and it runs now. systypes.[name], --(SELECT systypes.[name] FROM systypes WHERE xtype = syscolumns.xtype), Mny thanks to whomever wrote the script. Saved me a bunch of effort."This script will document tables (including constraints and triggers, row counts, sizes […]
2005-10-19 (first published: 2005-10-07)
584 reads
This SQL script returns a recordset with all the index information for all tables within a database
2005-10-18 (first published: 2005-10-07)
864 reads
Use this script as part of your data warehouse projects. I created this script based on previous postings of the Date/Time Dimension. I wanted a dimension that does hours, minutes and seconds. Includes military and standard hours.
2005-10-13 (first published: 2005-10-11)
5,285 reads
SP_SQLSMTPMail is an OLE automation implementation of the CDOSYS dll for Windows 2000 which utilizes a network SMTP server rather than an Exchange server/Outlook client. The stored procedure functions similar to xp_sendmail including the ability to run a query and attach the results. No MAPI profile is required. It is also a working, detailed example […]
2005-10-12 (first published: 2002-10-08)
3,772 reads
This scripts adds the users to the specified Windows NT Group.This will be helpful if we want to give the access to group of users to a sql server, which is runing with Windows Authentication. Create a NT group and give the access on SQL and run this script it adds the user into the […]
2005-10-10 (first published: 2005-09-15)
489 reads