|
|
Hello,
i´m working in a adp, connected to the sqlserver. I created view2, which has access to view1. In view2 are some conversions with "cast". Trying to open view2, takes over a minute. Is there a possibility to speed this task?
view2: SELECT ID1, Id, Datart, Jahre, Periode, cast(Schwund_L15 AS float) AS Schwund_L15, cast(Schwund_LVT AS float) AS Schwund_LVT, cast(schwund_L15 - Schwund_LVT AS float) AS Temp_Schwund, cast(Uhr_Diff AS float) AS Verkauf_Spanne, cast(L15 AS float) AS L15, cast(LVT AS float) AS LVT FROM dbo.vw_view1
Thank you in advance!
Eva
|
|
How long it takes to open View1? How about adding a Where statement?
-- Sylvain Lafontaine, ing. MVP - Technologies Virtual-PC E-mail: sylvain aei ca (fill the blanks, no spam please)
"Eva Mayr" <eva.mayr[ at ]web.de> wrote in message news:e7FN5eHUJHA.5860[ at ]TK2MSFTNGP02.phx.gbl...
[Quoted Text] > Hello, > > i´m working in a adp, connected to the sqlserver. I created view2, which > has access to view1. In view2 are some conversions with "cast". Trying to > open view2, takes over a minute. Is there a possibility to speed this > task? > > view2: > SELECT ID1, Id, Datart, Jahre, Periode, cast(Schwund_L15 AS float) > AS Schwund_L15, cast(Schwund_LVT AS float) > AS Schwund_LVT, > cast(schwund_L15 - Schwund_LVT AS float) > AS Temp_Schwund, cast(Uhr_Diff AS float) AS Verkauf_Spanne, > cast(L15 AS float) AS L15, cast(LVT AS float) AS LVT > FROM dbo.vw_view1 > > Thank you in advance! > > Eva >
|
|
add WITH (NOLOCK) after your tables in the SQL Statement.
This is known as a 'Query Hint'.
it might make a HUGE difference if you're on a busy server!
On Nov 27, 2:05 am, "Eva Mayr" <eva.m...[ at ]web.de> wrote:
[Quoted Text] > Hello, > > i´m working in a adp, connected to the sqlserver. I created view2, which has > access to view1. In view2 are some conversions with "cast". Trying to open > view2, takes over a minute. Is there a possibility to speed this task? > > view2: > SELECT ID1, Id, Datart, Jahre, Periode, cast(Schwund_L15 AS float) > AS Schwund_L15, cast(Schwund_LVT AS float) > AS Schwund_LVT, > cast(schwund_L15 - Schwund_LVT AS float) > AS Temp_Schwund, cast(Uhr_Diff AS float) AS Verkauf_Spanne, > cast(L15 AS float) AS L15, cast(LVT AS float) AS LVT > FROM dbo.vw_view1 > > Thank you in advance! > > Eva
|
|
|