AlHal2
asked on
Computed Columns vs Scalar Functions
Suppose I have a SQL table with some date columns and I want to calculate the difference. Should I write a stored procedure using the datediff function or set up a new persisted computed column.
From what I've seen it seems that a computed column will make the stored procedure run faster, but will take up more disk space.
Is this correct?
If diskspace is not an issue should one always use computed columns instead of scalar functions or are there exceptions?
If diskspace is an issue are there any scalar functions that slow queries down more than others?
From what I've seen it seems that a computed column will make the stored procedure run faster, but will take up more disk space.
Is this correct?
If diskspace is not an issue should one always use computed columns instead of scalar functions or are there exceptions?
If diskspace is an issue are there any scalar functions that slow queries down more than others?
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER