Viewing 15 posts - 1 through 15 (of 390 total)
I think i found the solution.
I created an indexed view on begindate and did the days duration count in the query, not in a computed column.
The query produces:
cnt ...
May 22, 2014 at 12:47 pm
Gail,
You are correct, i should have mentioned the varchar(max).
Please see the attached query below. I am aware it needs work to protect from SQL Injection ... its on my todo...
May 22, 2014 at 7:55 am
Sean,
In my original post, i said:
"I have a dynamic SQL query"
I also gave datatypes:
"@date is an integer."
"begindate is datetime format."
I also asked:
"Would it be faster to add a...
May 21, 2014 at 4:36 pm
"The data types varchar(max) and date are incompatible in the add operator."
Since it is within a dynamic sql query, i get the above error msg.
May 21, 2014 at 2:47 pm
GilaMonster (5/21/2014)
Why are you casting to Varchar? It's just going to force SQL to convert back to date, that's expensive conversions.
What would be the best datatype to cast to, in...
May 21, 2014 at 1:39 pm
Grant Fritchey (5/15/2014)
isuckatsql (5/15/2014)
"By the way, just we're clear, dbo.cb is an indexed view? What's the key value on?"dbo.cb is a Table not am Indexed View.
The primary key is ID.
Thanks
Then...
May 15, 2014 at 8:18 am
"By the way, just we're clear, dbo.cb is an indexed view? What's the key value on?"
dbo.cb is a Table not am Indexed View.
The primary key is ID.
Thanks
May 15, 2014 at 5:38 am
http://johnsterrett.com/2013/08/07/workload-tuning-finding-top-offenders-in-sql-server-2012/
Is this a good resource for Extended Events?
I followed the video and produced the following results.
Any advice is appreciated!
"A file you attempted to upload is not a...
May 14, 2014 at 6:12 pm
Thanks for the warning!
May 14, 2014 at 5:29 pm
http://www.statisticsparser.com/
Is this good enough?
May 14, 2014 at 4:54 pm
Grant,
The Dynamic SQL CTE gets the main page data based on various selected / passed filters.
The Indexed SQL Views queries, the last three, just provide a count, so the user...
May 14, 2014 at 1:33 pm
Grant Fritchey (5/14/2014)
May 14, 2014 at 12:41 pm
I am using SQL Indexed Views in this example.
I also know the dynamic sql has not been 'fixed' to protect from sql injection. Its on the todo list.
Thanks
May 14, 2014 at 11:30 am
Sean Lange (5/13/2014)
isuckatsql (5/13/2014)
I started with a dynamic SQL query, too slow.
Then i went with an SQL Indexed View, much faster, but the...
May 13, 2014 at 2:55 pm
lol ..... and so we go full circle.
I started with a dynamic SQL query, too slow.
Then i went with an SQL Indexed View, much faster, but the more items i...
May 13, 2014 at 1:53 pm
Viewing 15 posts - 1 through 15 (of 390 total)