Solved

tsql computed function not responding with huge record

Posted on 2012-12-25
4
484 Views
Last Modified: 2012-12-25
i have create new column and i have add this function

CASE DATEPART(WEEKDAY,datetimein)  WHEN 1 THEN 'SU' WHEN 2 THEN 'MO' WHEN 3 THEN 'TU' WHEN 4 THEN 'WE' WHEN 5 THEN 'TH' WHEN 6 THEN 'FR' WHEN 7 THEN 'SA' END 

Open in new window


and i got this message

- Unable to modify table.   Timeout expired.  The timeout period elapsed prior to completion of the operation or the server is not responding.

every time i get new record on this table who i can solve it ?
0
Comment
Question by:afifosh
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 143

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 500 total points
ID: 38720150
first, you could simplify the formula like this:
ucase(left(datename(wk, datetimein),2))

anyhow, for large table(s), the GUI will give you eventually a timeout.
running the t-sql directly will run without timeout, as long as needed.
0
 
LVL 1

Author Comment

by:afifosh
ID: 38720171
your function is better but the problem when i putted as computed column give same problem :S UPPER(left(datename(WEEKDAY, datetimein),2))
0
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 38720172
did you try to save the change script, and run it from T-SQL windows instead from table's design view?
0
 
LVL 1

Author Comment

by:afifosh
ID: 38720182
THANK YOU :d
0

Featured Post

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

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

Slowly Changing Dimension Transformation component in data task flow is very useful for us to manage and control how data changes in SSIS.
Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
Viewers will learn how the fundamental information of how to create a table.
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

615 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