Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Altering a Function that is used in a computed column

Posted on 2010-01-11
3
Medium Priority
?
313 Views
Last Modified: 2012-05-08
I have a question that I have never been asked by anyone before and wanted to get the experts answers here.

I have a table, and one of the columns is a computed column using a function.  Now it is time to change the function body to include more criteria, etc.  But because it is a function that is used in a computed column, SQL will not let me alter the function.

How is it that you can alter the function for new functionality for the computed column?
0
Comment
Question by:DBAduck - Ben Miller
3 Comments
 
LVL 143

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 1600 total points
ID: 26285085
you will have to drop the computed column, change the function, recreate the computed column.
this might required to alter triggers, drop columns etc during that time ...
0
 
LVL 75

Assisted Solution

by:Aneesh Retnakaran
Aneesh Retnakaran earned 400 total points
ID: 26285091
drop that computed column, modify the fnction and recreate the computed column using the modified function
0
 
LVL 25

Author Closing Comment

by:DBAduck - Ben Miller
ID: 31675582
Thanks
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Why is this different from all of the other step by step guides?  Because I make a living as a DBA and not as a writer and I lived through this experience. Defining the name: When I talk to people they say different names on this subject stuff l…
It is possible to export the data of a SQL Table in SSMS and generate INSERT statements. It's neatly tucked away in the generate scripts option of a database.
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
Viewers will learn how the fundamental information of how to create a table.
Suggested Courses

578 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question