Do FULL Backups for New DBs(run daily)
This script will do a full backup of any new database(s) on the server that does not have a backup already. This script runs Monday thru Saturday at our site.
2002-12-12
260 reads
This script will do a full backup of any new database(s) on the server that does not have a backup already. This script runs Monday thru Saturday at our site.
2002-12-12
260 reads
This UDF will validate a credit card number using Luhn's formula.For example 49927398716 will return 1:print dbo.luhn('49927398716')print dbo.luhn(49927398716)11based on:Credit cards, validation and the Luhn formulabyEduardo Chaveshttp://www.webdevelopersjournal.com/articles/validation.htmlAlgorithm converted to TSQL by Joseph Gama
2002-12-12
571 reads
This script will backup all databases that are online (sql 2000). So if a new database is added you will get a backup. This is setup as a weekly job at our site (Sunday night).
2002-12-12
371 reads
ASCII table and UNICODE tableYou can easily change the font of "SQL Query Analyzer":TOOLS/OPTIONS/FONTS
2002-12-11
523 reads
This SP will create an Access database from TSQL using ADOX.Instead of Access, the Provider can be changed so that it will create *any* kind of database from DBase 3, Oracle, Excel, etc...
2002-12-11
369 reads
This stored procedure takes four parameters1)file to ftp2)server name or IP3)ftp login4)ftp passwordSP will ensure that local file exists before continuing,it will create and execute a batch file in order to push the file to the remote FTP server.--exec exampleEXEC dbo.up_FTPPushFile 'c:\temp\test.txt', 'server', 'user', 'password'
2002-12-09
4,909 reads
There are times when you have a limited range of ids and these have to be re-used as they become available.The script lists the first missing id in a table.Note that this script works best for a table with a limited number of rows, say sub 100,000I tested this on a PIII 500MHz 256Mb RAM […]
2002-12-09
306 reads
This script is designed to backup the database, and copy it over the network to our backup server. The requirement for this particular database is 7 days of data kept on the LAN. The share on the backup server is mapped to the Y:\ drive. The datename function is used over the datepart function for […]
2002-12-08
374 reads
Here are a couple of handy date functions that pretty much describe themselves. You can use these to figure out how many days are left in a month.
2002-12-08
639 reads
Purpose: To compare two strings with a supplied operator and return true if the strings evaluate to true using the operator provided. This is useful for stored procs to use instead of dynamic sql. YAY! Allowing for the operator and value to be passed in as parms. So that the user on the front end […]
2002-12-07
875 reads
When I put together the invitation for T-SQL Tuesday #202, I wasn't sure what...
By Steve Jones
My life has some crazy travel stretches for sure. Between speaking, office visits, customer...
In Part 1, we saw how ‘Vamana’ represents vectors as nodes, connects them with...
Comments posted to this topic are about the item Server-Level Table sizes
Comments posted to this topic are about the item Optional Parameter Plan Optimization in...
There is a table tmp_tab:
CREATE TABLE tmp_tab ( id int, val int );
INSERT INTO tmp_tab VALUES (1, 1), (2, NULL), (3, 3), (4, 4), (5, 5);You want to order the rows ids by the following expression:
ISNULL(val, id) + 1Which of the following queries produces the expected ordering and why? (Select all correct) See possible answers