Wrox Programmer Forums
|
SQL Server 2000 General discussion of Microsoft SQL Server -- for topics that don't fit in one of the more specific SQL Server forums. version 2000 only. There's a new forum for SQL Server 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server 2000 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 18th, 2003, 02:36 AM
Registered User
 
Join Date: Jun 2003
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default Views

Hi everyone:

I have two questions:
1. How is it possible to declare and use variables in views?
2. How to increase the timeout in order to run complex views?

Any help would be appreciated.

Sam
 
Old July 18th, 2003, 07:05 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 839
Thanks: 0
Thanked 1 Time in 1 Post
Default

1. You can't. You can use system functions, system variables (e.g. @@rowcount), and user defined functions, but not local variables or parameters.
2. The method for increasing the timeout depends on the mechanism you are using to execute the view. How are you executing the view?

Jeff Mason
Custom Apps, Inc.
www.custom-apps.com
 
Old July 18th, 2003, 09:12 AM
Registered User
 
Join Date: Jun 2003
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Jeff:

Thank you for your post. Views are executed as SELECT * FROM VIEW_NAME. We are running views as ad hoc reports. If I can encrease a time for execution it will solve my problem at this time. Currently it is just times out before finishing calculation.

TIA
Sam

 
Old July 18th, 2003, 09:35 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 839
Thanks: 0
Thanked 1 Time in 1 Post
Default

No.

What I meant was what mechanism are you using to "run" the view? Since a view is a virtual table, the only way to query its contents is via a SELECT statement. The question is, how do you "do" the SELECT? For example, Query Analyzer, EM, ISQL.EXE, OSQL.EXE, via an ODBC connection, ADO, ADO .NET, etc etc. Each of these has its own way of setting the command/query timeout.

Jeff Mason
Custom Apps, Inc.
www.custom-apps.com
 
Old July 18th, 2003, 08:47 PM
Registered User
 
Join Date: Jun 2003
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Jeff,

Thank you for the support. Currently views are running through CR (ODBC connection) and EM for quick look on data. I would like to have an option to quiery timeout either.

RGDS
Sam

 
Old July 19th, 2003, 08:14 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 839
Thanks: 0
Thanked 1 Time in 1 Post
Default

By CR do you mean Crystal Reports? If you are using a DSN, then I think you can set the query timeout on the DSN's properties.

I don't think there is a mechanism to set the query timeout running through EM, but there is through Query Analyzer. Click the database, then select Tools/Options Advanced.

Jeff Mason
Custom Apps, Inc.
www.custom-apps.com





Similar Threads
Thread Thread Starter Forum Replies Last Post
Tables only no views eungandy SQL Server DTS 1 October 23rd, 2006 08:26 AM
Views prashar SQL Language 1 December 13th, 2005 02:10 AM
converting Access 2000 views to Sql views matta Classic ASP Professional 1 January 26th, 2005 03:37 PM
Variables in views richarda SQL Server 2000 9 December 23rd, 2004 12:29 PM
Views or not ?? stagedancer SQL Server 2000 1 November 24th, 2004 03:08 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.