Friday, February 24, 2012

Execution Time

Is there any way to estimate the time required to execute a T-SQL
statement?
I need to set the command time out by calculating the time for T-SQL
statement. Can any one give an example?
-SARADHIPredicted Time:
Use Northwind
SET STATISTICS TIME ON
Select * from Orders
SET STATISTICS TIME OFF
HTH, Jens Suessmeyer.
"Saradhi" <upadrasta@.inooga.com> schrieb im Newsbeitrag
news:eXsjwcmSFHA.1384@.TK2MSFTNGP09.phx.gbl...
> Is there any way to estimate the time required to execute a T-SQL
> statement?
> I need to set the command time out by calculating the time for T-SQL
> statement. Can any one give an example?
>
> -SARADHI
>|||I need to get it into a varibale and set the Timeout value for the Command
to execute.....
How can I do it'
-SARADHI
"Jens Smeyer" <Jens@.Remove_this_For_Contacting.sqlserver2005.de> wrote in
message news:uVvPkgmSFHA.3096@.TK2MSFTNGP12.phx.gbl...
> Predicted Time:
> Use Northwind
> SET STATISTICS TIME ON
> Select * from Orders
> SET STATISTICS TIME OFF
>
> HTH, Jens Suessmeyer.
> "Saradhi" <upadrasta@.inooga.com> schrieb im Newsbeitrag
> news:eXsjwcmSFHA.1384@.TK2MSFTNGP09.phx.gbl...
>|||Hi
Maybe something like that
CREATE TABLE #Test (col INT)
SET NOCOUNT ON
DECLARE @.dt DATETIME,@.i INT
SET @.dt=GETDATE()
SET @.i=1
WHILE @.i<10000
BEGIN
INSERT INTO #Test VALUES (@.i)
SET @.i=@.i+1
END
SELECT DATEDIFF(second,@.dt,GETDATE()) AS 'Time process'
DROP TABLE #Test
"Saradhi" <upadrasta@.inooga.com> wrote in message
news:OUgyyjmSFHA.3356@.TK2MSFTNGP12.phx.gbl...
> I need to get it into a varibale and set the Timeout value for the Command
> to execute.....
> How can I do it'
> -SARADHI
>
> "Jens Smeyer" <Jens@.Remove_this_For_Contacting.sqlserver2005.de> wrote
in
> message news:uVvPkgmSFHA.3096@.TK2MSFTNGP12.phx.gbl...
>

No comments:

Post a Comment