Join | Login | Why Join?   
SQL Server, Oracle, DB2, Sybase, MySQL Help - SSWUG.ORG HACKER SAFE certified sites prevent over 99.9% of hacker crime.
Search SSWUG:   

HOME

 
Register / Join
Login
 
Events and Video
SQL Server Conference
Business Intelligence Conference
Sharepoint Conference
.NET Developer Conference
Watch SSWUGtv
Podcasts
Webcast Directory
Platforms
Microsoft SQL Server
Oracle Databases
IBM's DB2
MySQL Databases
For Developers
XML Technologies
Major Sections
Business Intelligence
White Paper Library
Product Directory
Database Script Library
FAQ System
Forums
Email Discussions
List Servers
Site Options
Employers: Post Jobs
Find a Job
Popular Articles
Browse Tags
About SSWUG.ORG
About SSWUG
Write for SSWUG
Request Product Review
Advertise on SSWUG.ORG
Contact Us
Other Resources
Office Users Group
MS SQL City
 
Access to 690 free guest articles, discussions and more, just create your free SSWUG User ID:
Email address:  
This will be your login ID - we'll email you your password - you'll even receive the newsletter, opt-out at any time.

Script Library

Welcome to your script manager. From here, you can post and save your scripts, marking them for public use or your own private use.



[Recent Scripts] [Show All Scripts]
Search Public Scripts for:

Small Sample of Recent Scripts

(Currently 741 scripts on file.)

dba3_DeadLock_Connection_Demo_ay - Pubs deadlocking demo - creates a live deadlock when run with dba3_DeadLock_Connection_Demo_son.sql (adapted from developer training materials) Open DeadLock_Connection_Demo_ay.sql and DeadLock_Connection_Demo_son.sql in isqlw.exe in different connec
dba3_0To20ComputedTimeOnlyValueAndFullDateTimeOffset_demo - -- For a GivenFullDateTimeArgument display: -- GivenFullDateTimeArgument, Random 0 - 20 MinuteOffSetValue, -- ComputedTimeOnlyOffset, and the ComputedFullDateTimeOffset
dba3_DBCC_Ind_IndexDefrag - DBCC IndexDefrag DBCC Ind
Cardinality of columns - This script gives a list of all the columns in the database and the number of distinct values in them. This can be very useful if you take over a database and you want to find out if the columns are actually used. It might also come in handy if you n
admin db - find out if an Agent job can be started now - An agent job can already be running when you try to start it programatically. To avoid erros when this occurs, chack the job's status with this proc before trying to start that job.
- SQL Server help and articles, newsletter, list servers, discussion boards, scripts, Oracle database integration, SOAP links and articles, XSLT articles, XML help, daily news and more.
dba3_ddl_CalendarSchema_Article - Modeling Date Logic III: Implementing Business Calendars (by example in MS Sql Server 2000) http://www.sswug.org/see/17379 Self Healing DDL for the Calendar Schema: The procedure ddl_CalendarSchema may be called to re-create any accidentally deleted
enable_all_jobs.sql - SCRIPT EXECUTES CURSOR THAT RESULTS IN ALL JOBS ON SERVER BEING ENABLED
fnLTRIM (LTRIM Extension) - fnLTRIM removes characters from the left of char, with all the leftmost characters that appear in set removed. SQL begins scanning char from its first character and removes all characters that appear in set until reaching a character not in set and
Capture Replication Statistics in AdminDB - This procedure can be used in a job to regularly capture Replication Counters (Statistics) for historical review. This can be used to identify lagging replication times.
Initcap - INITCAP returns char, with the first letter of each word in uppercase, all other letters in lowercase. Words are delimited by white space or characters that are not alphanumeric.
dba3_ImplicitConversionIssues_Demo - It is often very important to be aware of the implications of implicit type conversions (the results are often DBMS, implementation, and version specific) -- this is especially so among decimal, char, int, float and binary type conversions.
dba3_fx_MonthBeginAndEndDateTime_Article - -- Function to find and return the first day of the month and the last day of the month -- for a given datetime parameter -- Modeling Date Logic II: Queries, Functions, Procedures for Business Date & Time Calculations -- http://www.sswug.org/see
dba3_fn_TableIdentityColumns_WithIdentCurrent_Article - UDF, returns identity column names With Ident Current values for a designated table in the same database. Requires a parameter @pTableName, of a specific table name. See: http://www.sswug.org/see.asp?s=1166&id=13833
sp_updateusagestats_alldbs.sql - updates usage stats on all databases
sp_random - Random number generator code snippet.
dba3_tr_DDL_DATABASE_LEVEL_EVENTS_Demo - Demo trigger
RPAD - RPAD returns char1, right-padded to length n with char2, replicated as many times as necessary; char2 defaults to a single blank. If char1 is longer than n, this function returns the portion of char1 that fits in n. The argument n is the total length
CheckAllTables - This stored procedure can be used to check the integrity of the data and index pages for all user tables in the particular database. In comparison with DBCC CHECKDB statement, this stored procedure takes less time to run, because only user tables
GetTbColValues - This stored procedure can be used to return all tables and table's columns, which contain the particular text value. The GetTbColValues stored procedure will scan all tables in the current database to search the particular text value in the char,
fn_NumCount - Text processing. One of five user-defined functions for counting char types in a string. This one counts ASCII numerals.
dba3_DataLength_And_TableColumnWidth_Demo - considerations when using DataLength (), Information_Schema.Columns and special system stored procedures that return information about column widths.
xp_getfiledetails attribute values - Notes on the attribute bitmap returned by xp_getfiledetails
dba3_TriggerDemo_SystemUser_HostName_GetDate_Audit - Demonstrates a tamper resistant update audit trigger implementation suitable for single or multiple row updates (and insertions). (Deletion auditing is typically monitored using an additional table)
Save / append logfile (ASCII) - This generic proc appends/creates an ASCII (log) file to an alternate place.
findColumns (setbased, 'dirty' version) - looks for tables with column names containing a given phrase
Generate Autofixlogins - S2K SP3 - Generate logins after restoring a database from a different server. Requires SQL 2K SP3
round to increment - Function that will round a value to a increment value.
GetObjCreateDate - This stored procedure will scan a database for objects created within the StartDate and EndDate and return their names and creation date.
Removing IDENTITY column property - Somebody one day asked me how to remove the identity property from a column without using an external table. Here's what I came up with. Pay close attention to the caveats in the comments (FK constraints etc).
 

[ Register ] [ Webcasts ] [ Podcasts ] [ Newsletter Archive ] [ RSS/Feeds ]
[ About ] [ Advertise ] [ Contact ] [ Privacy ] [ Terms of Service ]
[ Link to SSWUG ] [ List Server Archives ] [ Recent Orig. Content ]
(c) 1997-2008, Bits on the Wire, Inc.  (0)

Some names and products covered by SSWUG are the registered trademarks of their respective owners.
DAA10354WWW004