General information
Forum:
Microsoft SQL Server
Hi Keith.
In SQL2000, you can create a user defined function. An example would be:
CREATE FUNCTION add_columns (@number1 int, @number2 int)
RETURNS int
AS
BEGIN
RETURN (@number1+@number2)
END
To use this as a calculated column, open the design window for your table in Enterprise Manager. Add a new column and use the 'formula' property to call the function like this:
([dbo].[add_columns]([column_name1], [column_name2]))
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only