spDropField
spDropField does exactly the opposite of spAddField. It checks for existence, then drops it, if it does exist.
2002-03-05
137 reads
spDropField does exactly the opposite of spAddField. It checks for existence, then drops it, if it does exist.
2002-03-05
137 reads
spFindTableInfo is a great proc for finding info about your database. It will accept parameters like tablename, fieldname, size, datatype. So you can run it with no params, and it'll report every table, every field in those tables, and the size, datatype and whether its nullable or not. You can filter it by Table name […]
2002-03-05
378 reads
spGetFieldsExists takes a tablename and a field name, and checks if that field exists in that table.It simply returns 0 or 1 (false or true).
2002-03-05
167 reads
This stored procedure will list all the tables and columns in a given database. Usage: spro_ListAllColumns @dbname = 'Northwind'.
2002-02-28
807 reads
Pass a datetime value and receive back a formatted string. Much like the Format$ function in Visual Basic.I put this together to provide a date string to add to filename. Also handy when you are creating text files that require datetime data to be output in weird character formats like yyddmm or yyyymm.eg: fnDate2Char(GetDate(), 'dmy', […]
2002-02-27
822 reads
This Stored Procedure will display object level permissionsfor stated User or Role.Procedure output is ready to execute batch.Usage: Exec ScriptPermissions 'public'
2002-02-27
1,392 reads
This script creates a stored procedure that you can call to get the record count for every table in a particular database. It uses the sp_MSforeachtable system stored procedure and a temp table.
2002-02-25
638 reads
This script is very helpful for anyone trying to recreate particular SQL Server Database Versions for Testing. It allows you to automatically recompile any stored procedures or views saved with drop, create and permission statements. The scripts must all be sitting in one directory and end in the same extension. I have found this very […]
2002-02-25
684 reads
This stored procedure detaches and re-attaches a database without specifying a filename for the transaction log. This causes SQL Server to create log file with default size of 512kb.After playing around with SHRINKDATABASE, SHRINKFILE, forcing the virtual log to wrap around, etc... I found this was the quickest and most reliable method of reclaiming the […]
2002-02-25
2,608 reads
If you've ever been stuck having to write stored procedures to support an application, check this script out. This script will automatically generate seperate parameter driven select, insert, delete, and update stored procedures. Simply call these stored procedures from your application, passing parameters. This stored procedure requires only one parameter; table name. Creates scripts with […]
2002-02-21
326 reads
By Steve Jones
This is my last week of the year working (I guess I come back...
By Steve Jones
suente– n. the state of being so familiar with someone that you can be...
Anyone (everyone?) who has ever tried to learn a programming language knows that to...
I am getting the below error when I execute a SQL command in SQL...
I am getting the below error when I execute a SQL command in SQL...
Hi everyone. I have this table and this information. (left side of the image)...