create function fn_IsWeekDay ( @date datetime ) returns bit as begin declare @dtfirst int declare @dtweek int declare @iswkday bit set @dtfirst = @@datefirst – 1 set @dtweek = datepart(weekday, @date) – 1 if (@dtfirst + @dtweek) % 7 not in (5, 6) set @iswkday = 1 –business day else set @iswkday = [...]
USE [TABLE_NAME] SELECT * FROM sys.Tables ORDER BY NAME
SELECT obj.Name as SPName,
modu.definition as SPDefinition,
obj.create_date as SPCreationDate
FROM sys.sql_modules modu
INNER JOIN sys.objects obj
ON modu.object_id = obj.object_id
WHERE obj.type = ‘P’
Using the Query Analyzer may not be the right way always, you can use the SQL syntax as given below, if you are unable to have access to use the query analyzer
For Oracle 9i, the syntax is : ALTER TABLE table_name RENAME COLUMN old_name to new_name;
For Microsoft SQL the syntax is : [...]