Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Adding a Computed Column to a Table (2) - SQL School Video


Adding a Computed Column to a Table (2) - SQL School Video

Author
Message
Andy Warren
Andy Warren
SSCertifiable
SSCertifiable (7.9K reputation)SSCertifiable (7.9K reputation)SSCertifiable (7.9K reputation)SSCertifiable (7.9K reputation)SSCertifiable (7.9K reputation)SSCertifiable (7.9K reputation)SSCertifiable (7.9K reputation)SSCertifiable (7.9K reputation)

Group: Moderators
Points: 7898 Visits: 2706
Comments posted to this topic are about the item Adding a Computed Column to a Table (2) - SQL School Video

Andy
SQLAndy - My Blog!
Connect with me on LinkedIn
Follow me on Twitter
mikelawton
mikelawton
Grasshopper
Grasshopper (21 reputation)Grasshopper (21 reputation)Grasshopper (21 reputation)Grasshopper (21 reputation)Grasshopper (21 reputation)Grasshopper (21 reputation)Grasshopper (21 reputation)Grasshopper (21 reputation)

Group: General Forum Members
Points: 21 Visits: 15
Hi Andy,

I'm curious to whether you'd recommend this approach for a particularly gnarly database I've inherited. It uses a concept of "partial text" for it's keys. For example, 2007-000123-001 might be the key in a table. The first 11 characters is, in essence, the primary key of the parent table in a parent-child hierarchy. The -001 makes it unique in the child table and also gives it a sequential order.

As you can imagine, it's painful because searches invariably rely upon substrings or LIKE clauses. I know that's killing the performance.

My thought was that I could use this computed column approach to slowly migrate us out of this hell, while still maintaining legacy support. I'd be curious to hear your thoughts.

Great work!

-Mike L
Peter Cronin
Peter Cronin
Grasshopper
Grasshopper (16 reputation)Grasshopper (16 reputation)Grasshopper (16 reputation)Grasshopper (16 reputation)Grasshopper (16 reputation)Grasshopper (16 reputation)Grasshopper (16 reputation)Grasshopper (16 reputation)

Group: General Forum Members
Points: 16 Visits: 33
I was wondering what the performance advantages are between a derived field in a view and computed field in a table. Would you do one over the other because one performs better?
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search