• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to set TIMEOUT in MSSQL?

 
Ranch Hand
Posts: 139
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I execute this SQL in MSSQL and prompt me a timeout box, i wonder how i can set the MSSQL's query timeout?
SQL:
SELECT c.theme_title, c.grade_id, b.sub_theme_title, count(a.cd)
FROM hit_rates_report_log a, sub_theme b, theme c
WHERE a.type = 'SUBTHEME' AND a.cd = b.sub_theme_cd AND
b.theme_cd = c.theme_cd AND (access_time >= '2003-6-15 00:00:00') AND
(access_time <= '2003-7-15 23:59:59') AND b.theme_cd IN
(SELECT theme_cd
FROM theme_lang_link
WHERE lang_cd = 'CHI')
GROUP BY c.theme_title, c.grade_id, b.sub_theme_title, a.cd
UNION
SELECT e.theme_title, e.grade_id, d .sub_theme_title, 0
FROM sub_theme d, theme e
WHERE NOT EXISTS
(SELECT 'X'
FROM hit_rates_report_log f
WHERE f.type = 'SUBTHEME' AND f.cd = d .sub_theme_cd AND
e.theme_cd = d .theme_cd AND (access_time >= '2003-6-15 00:00:00') AND
(access_time <= '2003-7-15 23:59:59') AND d .theme_cd IN
(SELECT theme_cd
FROM theme_lang_link
WHERE lang_cd = 'CHI'))
ORDER BY c.theme_title, b.sub_theme_title

If I break the union and query the 2 SQL one by one,no timeout, ie
SQL1:
SELECT c.theme_title, c.grade_id, b.sub_theme_title, count(a.cd)
FROM hit_rates_report_log a, sub_theme b, theme c
WHERE a.type = 'SUBTHEME' AND a.cd = b.sub_theme_cd AND
b.theme_cd = c.theme_cd AND (access_time >= '2003-6-15 00:00:00') AND
(access_time <= '2003-7-15 23:59:59') AND b.theme_cd IN
(SELECT theme_cd
FROM theme_lang_link
WHERE lang_cd = 'CHI')
GROUP BY c.theme_title, c.grade_id, b.sub_theme_title, a.cd
SQL2:
SELECT e.theme_title, e.grade_id, d .sub_theme_title, 0
FROM sub_theme d, theme e
WHERE NOT EXISTS
(SELECT 'X'
FROM hit_rates_report_log f
WHERE f.type = 'SUBTHEME' AND f.cd = d .sub_theme_cd AND
e.theme_cd = d .theme_cd AND (access_time >= '2003-6-15 00:00:00') AND
(access_time <= '2003-7-15 23:59:59') AND d .theme_cd IN
(SELECT theme_cd
FROM theme_lang_link
WHERE lang_cd = 'CHI'))
ORDER BY c.theme_title, b.sub_theme_title
 
this llama doesn't want your drama, he just wants this tiny ad for his mama
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic