You can return the date as a string (varchar) in whatever date format you like by adding a 'style' to the CONVERT statement. Exmaples of style values are (two left hand columns):1 101 USA mm/dd/yy 2 102 ANSI yy.mm.dd 3 103 British/French dd/mm/yy 4 104 German dd.mm.yy 5 105 Italian dd-mm-yy 6 106 - dd […]
2005-02-18 (first published: 2005-01-31)
198 reads
This script will help DBA's who wants to BCP out required tables form any database. This script can be run through as a job. Before running you have to create a table in any given database and store the table names in it, which you want to Bulk copy. Query in this procedure will check […]
2005-02-17 (first published: 2005-01-27)
291 reads
There are mainly two components. One job that is managing the full database backup - restore and a second job that manage the transaction log backup - restore. At this two a new one similar with the full database backup - restore can be added for the differential backups if is the case. I will […]
2005-02-15 (first published: 2004-04-01)
1,035 reads
This Stored Procedure Will Get: - The Data and Log File Names - The Data and Log File Sizes (MB) - The Data and Log Percent Utilization (%) for ALL Databases on a SQL Instance. Numbers Should (More Or Less) Reflect What You See on The SQL Enterprise Manager Taskpad. LIMITATIONS: For Databases With Multiple […]
2005-02-14 (first published: 2005-01-13)
1,152 reads
Imports data from MySQL Server; works best with mysql driver 3.51.06! You'll have to create a dsn and then a linked server to that dsn. The script checks if the table exists in the mysql catalog (defined in the dsn properties). Too bad it needs administrative privileges to run (dbcc statement) - my advice: don't […]
2005-02-11 (first published: 2005-01-17)
126 reads
Kmlakov's script, t-sql function to parse string data, posted on 1/19/2005, required the passing in text ends with the delimiter. But it is usually not the case. I rewrote the script (added one IF statement). The new script can treat the text with or without ending delimiter. The third parameter will be the number of […]
2005-02-07 (first published: 2005-01-19)
381 reads
select dateadd(dd, datediff(dd,0,Getdate()),0)
2005-02-01 (first published: 2005-01-06)
149 reads
This script will get you the current date minus the time. It will display all zeros instead.DATETIME is stored as a number in SQL and less internal conversions are will be used then other methods. Microsoft generally uses this method.
2005-01-31 (first published: 2005-01-06)
235 reads
Shows database, table names which are locked, the user who locks them, the command which is executed
2005-01-28 (first published: 2005-01-06)
1,134 reads
SQL Server's Reporting Services comes with some pre-built reports to be able to monitor who is doing what with your Reporting Services Server. You can find these reports in the \Extras\Execution Log Sample Reports folder on the product CD-ROM (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/rsadmin/htm/arp_rslogfiles_v1_88gy.asp). One of the reports is titled "Todays Reports" (Todays Reports.rdl/pToday Dataset). It should show the […]
2005-01-27 (first published: 2005-01-07)
888 reads