SQL Clone
SQLServerCentral is supported by Redgate
Log in  ::  Register  ::  Not logged in

Using a system function as a computed column within a table-value function….

Wouldn’t it be nice if SQL Server allowed this functionality? for instance if did the below:-


I get the above error. I know the code can be easily rectified by doing:-

computed column in a table valued function - correct

It just makes the code read bad and perform bad as you would need to add this system function call everywhere you insert into the return table. One line instead of 5 makes more sense to me!


GO-SQL blog A blog dedicated for SQL Server Developers alike!

My name is Andrew Fenna, and I am a database developer at The Laterooms Group. I have written this blog to educate my fellow database developers in subjects that I think are necessary to keep at the top of our game. I have been working with RDBMS’s since 2002 and I have worked within financial, gaming, public, and travel sectors within the Northwest of England. I have gained quite a lot of experience throughout my journey and have tackled some very difficult challenges along the way. Therefore, I am blogging my experiences, which I hope will give you the inspiration to try and tackle problems that are deemed impossible to start, but with some encouragement and guidance become much more simpler and structured, thank you for your time. Andrew J Fenna.


Leave a comment on the original post [gosql.co.uk, opens in a new window]

Loading comments...