This function will return you the month-end date. Input parameter may be any date of that month for which you want to calculate month-end.Example:Input: '2-20-2004' Output: '2-29-2004'Input: '2-15-2004' Output: '2-29-2004'Input: '3-20-2004' Output: '3-31-2004'Input: '3-30-2004' Output: '3-31-2004'
2007-05-08 (first published: 2007-04-19)
1,316 reads
To Retreive List of Default Constraints from current database
2007-05-07 (first published: 2007-04-20)
227 reads
To Retreive List of Default Constraints from current database with PRINT or DROP
2007-05-04 (first published: 2007-04-20)
530 reads
I wrote this little tool out of the frustratingly slow process one must endure to find out what database Recovery Model your SQL 2000 databases are currently set to. This tool will quickly reveal whether your database Recovery model is set to either "Simple", "Full", or "Bulk-Logged." Who has time to manually pull up "Properties" […]
2007-05-03 (first published: 2003-03-06)
787 reads
This script uses an old mathematical way of doing hierarchical queries. The most common way of showing hierarchical data in SQL Server is by creating a stored procedure that calls itself. This is not a recent problem, in fact this programming technique has been around since the first programming languages. By using stacks, you can […]
2007-05-02 (first published: 2004-02-17)
573 reads
Reindex all your tables -- just keep it simple !!
2007-04-30 (first published: 2007-04-03)
1,680 reads
Fixes Users of a newly restored database (SQL 2000)
2007-04-27 (first published: 2007-04-03)
1,284 reads
Here's the scenario: 1. You have been given a script to run.2. You do not know the database name.3. You know which server.Substitute the word "TABLENAME" with the table name in the script and run in query analyzer. This query will check every database on the server and return the name of the database with […]
2007-04-26 (first published: 2007-04-04)
471 reads
This script is basically a front-end for the sp_"scriptproc" stored procedures that ship with MSSQL. This will allow you to create ALL of your procs (INS, UPD and DEL) on the fly using the article name instead of having to first search for the article ID. It also uses sp_scriptdynamicupdproc where appropriate. This facilitates quick […]
2007-04-23 (first published: 2007-03-27)
1,730 reads
When a table is modified by changing the order of fields or changing field type or adjusting field sizes etc, some of the dependent views (or views on views on views :)) may become invalid as they store some metadata in order to run more efficiently. These views would need to be refreshed with new […]
2007-04-20 (first published: 2007-03-20)
2,012 reads