Viewing 15 posts - 1,051 through 1,065 (of 4,080 total)
# 1. In your example, the optimizer uses the nonclustered index because it is a "covering" index containing all the columns needed to satisfy your query. ...
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills
July 1, 2011 at 10:35 pm
In the future, you can answer questions like this one for yourself by displaying the actual execution plans when you run the two queries. You should see...
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills
July 1, 2011 at 10:21 pm
Just a suggestion, but rather than create the formula, let your users define the marginvalues and the accompanying pay percentages. Store them in a table just like you...
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills
July 1, 2011 at 10:12 pm
Quick war story: Someone once asked me to look at a cursor-based query they wrote to split a single large table into three separate tables. ...
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills
July 1, 2011 at 5:16 pm
Instead of using EXEC, take a look at books online here for examples of using sp_executeSQL to do a "parameterized" dynamic SQL query, passing variables from the calling procedure into...
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills
July 1, 2011 at 4:33 pm
Pay close attention to the dangers of SQL injection attacks. Done carelessly, your query can create a huge security risk to the DB.
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills
July 1, 2011 at 4:27 pm
I don't see what you're showing as being any simpler than what a cursor looks like in T-SQL. The question is, what exactly are you trying to...
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills
July 1, 2011 at 9:14 am
He's right. I would say this is one of those jobs better handled outside SQL.
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills
June 29, 2011 at 6:08 pm
Gianluca Sartori (6/28/2011)
Yeah! 3000 points for me!It's a small step for most of you, it's a great step for me.
Way to go, Gianluca !
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills
June 28, 2011 at 7:31 am
Have a great vacation, Roy. Surely, it must be well-deserved.
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills
June 24, 2011 at 8:41 am
Redgate has a very nice little utility called SQLSearch.
It's very handy for finding strings (like table names) within all objects in a db (or all dbs on...
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills
June 23, 2011 at 8:37 pm
Has anyone seen the Green Lantern movie yet?
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills
June 23, 2011 at 1:18 pm
While your desire not to have to make identical changes in 100 places is commendable, there isn't any sort of a "column loop" in T-SQL. You...
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills
June 23, 2011 at 10:36 am
Jayanth_Kurup (6/23/2011)
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills
June 23, 2011 at 9:43 am
However, my real reason for posting was to point out the true complexity of coding a CASE based solution with a large number of columns vs. the simplicity of coding...
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills
June 22, 2011 at 6:59 am
Viewing 15 posts - 1,051 through 1,065 (of 4,080 total)