Viewing 15 posts - 1,021 through 1,035 (of 1,219 total)
T.Ashish (7/29/2013)
(isnull(@activity_id,0)=0
or
pd.activity_id = @activity_id)
and
...
[font="Times New Roman"]Erland Sommarskog, SQL Server MVP, www.sommarskog.se[/font]
July 29, 2013 at 10:16 am
Just because recompilation occurs, does not mean that the optimizer will make a different decision, but it may very well arrive at the same plan.
[font="Times New Roman"]Erland Sommarskog, SQL Server MVP, www.sommarskog.se[/font]
July 29, 2013 at 5:11 am
So the simplest would be to defined a linked server, then you would not need to use dynamic SQL, but you could make a plain procedure call.
But to continue on...
[font="Times New Roman"]Erland Sommarskog, SQL Server MVP, www.sommarskog.se[/font]
July 29, 2013 at 5:07 am
The optimizer often does a better job with UNION than OR, but that applies to conditions like:
thiscol = @value OR thatcol = @value
Which does not seem to...
[font="Times New Roman"]Erland Sommarskog, SQL Server MVP, www.sommarskog.se[/font]
July 29, 2013 at 5:04 am
WITH SCHEMABINDING has these effects:
1) As Gail says, it is required if you want to create an indexed over the view.
2) It prevents any of the tables and the columns...
[font="Times New Roman"]Erland Sommarskog, SQL Server MVP, www.sommarskog.se[/font]
July 29, 2013 at 4:55 am
Only to add what Jeff suggests: there are multiple ways to skin this cat, and which one that fits you depends on a lot things. My suggestion assumes that you...
[font="Times New Roman"]Erland Sommarskog, SQL Server MVP, www.sommarskog.se[/font]
July 29, 2013 at 3:00 am
This is what SET CONTEXT_INFO and the function context_info() is for.
See this section in an article on my web site for more details:
http://www.sommarskog.se/grantperm.html#context_info
(You only have to read this section, and...
[font="Times New Roman"]Erland Sommarskog, SQL Server MVP, www.sommarskog.se[/font]
July 28, 2013 at 2:59 pm
The neatest solution is to write a small console-mode program that parses the file, and then sends the comma-separated to a table-valued parameter, which you pass to a stored procedure...
[font="Times New Roman"]Erland Sommarskog, SQL Server MVP, www.sommarskog.se[/font]
July 28, 2013 at 2:50 pm
Yes, this is a problem in your network somewhere. You should be able to produce this problem by sending a query that produces a result set of some size, and...
[font="Times New Roman"]Erland Sommarskog, SQL Server MVP, www.sommarskog.se[/font]
July 28, 2013 at 1:02 am
What exactly is the error message that users get when they try to connect?
[font="Times New Roman"]Erland Sommarskog, SQL Server MVP, www.sommarskog.se[/font]
July 27, 2013 at 3:05 pm
This is a forum for SQL questions, not for telepathy. If you don't include table and column definitions, the answers you get will be based on wild guesses.
If these columns...
[font="Times New Roman"]Erland Sommarskog, SQL Server MVP, www.sommarskog.se[/font]
July 27, 2013 at 3:00 pm
Thorkil Johansen (7/27/2013)To sharpen a little: "The integer to the right of the last hyphen in the string"
In such case...
with tmp as (
select ...
[font="Times New Roman"]Erland Sommarskog, SQL Server MVP, www.sommarskog.se[/font]
July 27, 2013 at 2:56 pm
CASE WHEN T2 < R2 THEN T2
WHEN T2 < S2 THEN T2-R2
ELSE S2
END * O2
[font="Times New Roman"]Erland Sommarskog, SQL Server MVP, www.sommarskog.se[/font]
July 27, 2013 at 2:06 am
convert(int, round(((Monthly Revenue field - Monthly Cost field )/Monthly Revenue field) * 100), 2))
[font="Times New Roman"]Erland Sommarskog, SQL Server MVP, www.sommarskog.se[/font]
July 27, 2013 at 2:04 am
Coming late to the party, but...
The charindex expression is bound to scane the entire table.
LIKE '9000413237%' will seek the index in a normal way.
LIKE '%9000413237%' will also result in an...
[font="Times New Roman"]Erland Sommarskog, SQL Server MVP, www.sommarskog.se[/font]
July 27, 2013 at 2:02 am
Viewing 15 posts - 1,021 through 1,035 (of 1,219 total)