speed up views with conversions

E

Eva Mayr

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
 
A

a a r o n _ k e m p f

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!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top