Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Auto calculations
Message
General information
Forum:
Microsoft SQL Server
Category:
Database design
Miscellaneous
Thread ID:
00518612
Message ID:
00518669
Views:
13
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
Map
View

Click here to load this message in the networking platform