Solved

tsql computed function not responding with huge record

Posted on 2012-12-25
4
476 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
  • 2
  • 2
4 Comments
 
LVL 142

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 142

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

Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

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

In this article I will describe the Backup & Restore method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Via a live example, show how to shrink a transaction log file down to a reasonable size.

862 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now