March 6, 2013 at 10:25 pm
Lynn Pettis (3/6/2013)
Really?? You have to be kidding.
I'm tempted to violate my mantra and post a script that dumps all table names into a temp table and then CURSORs through dropping each table using Dynamic SQL (no need to worry about SQL injection after that bad boy runs).
My thought question: Have you ever been told that your query runs too fast?
My advice:
INDEXing a poor-performing query is like putting sugar on cat food. Yeah, it probably tastes better but are you sure you want to eat it?
The path of least resistance can be a slippery slope. Take care that fixing your fixes of fixes doesn't snowball and end up costing you more than fixing the root cause would have in the first place.
Need to UNPIVOT? Why not CROSS APPLY VALUES instead?[/url]
Since random numbers are too important to be left to chance, let's generate some![/url]
Learn to understand recursive CTEs by example.[/url]
[url url=http://www.sqlservercentral.com/articles/St
March 7, 2013 at 8:08 am
dwain.c (3/6/2013)
Lynn Pettis (3/6/2013)
Really?? You have to be kidding.I'm tempted to violate my mantra and post a script that dumps all table names into a temp table and then CURSORs through dropping each table using Dynamic SQL (no need to worry about SQL injection after that bad boy runs).
To violate the unwritten, but oft spoken, rule... Here's some code! π
let it be known... DO NOT use this... this is a joke (and there are numerous intentional errors). The real question... if you are going to use dynamic sql... why use a cursor?
DECLARE @sql AS NVARCHAR(MAX)
SET @sql = STUFF((SELECT 'DROP TABLE dob.[' + t.[TABLE_NAME] + '];
'
FROM INFORMATION_SCHEMA.TABLES l
WHERE t.[TABLE_TYPE] = 'BASE TABLES'
ORDER BY t.[TABLE_NAME]
FOR XML PATH(''), TYPES).value('.', 'VARCHAR(-1)'), 1, 0, '')
EXE(@SQL)
March 7, 2013 at 8:23 am
Lynn Pettis (3/6/2013)
Several years ago my oldest daughter's JV soccer coach once confieded "I knew we were in trouble when half the team asked what was offsides?"Well, I've just seen the equivalent here with the question "What is SSMS?"
And you are doing what with SQL Server???
And I thought only the parents were that clueless about soccer here in the States.
_______________________________________________________________
Need help? Help us help you.
Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.
Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.
Cross Tabs and Pivots, Part 1 β Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/
March 7, 2013 at 8:31 am
Sean Lange (3/7/2013)
Lynn Pettis (3/6/2013)
Several years ago my oldest daughter's JV soccer coach once confieded "I knew we were in trouble when half the team asked what was offsides?"Well, I've just seen the equivalent here with the question "What is SSMS?"
And you are doing what with SQL Server???
And I thought only the parents were that clueless about soccer here in the States.
Someday when we are in the same town and have some time, I'll explain the dynamics of soccer in the area I live and why I wasn't surprised by this comment.
I do plan on meeting many of the Threadizens at some point.
March 7, 2013 at 8:51 am
Lynn Pettis (3/7/2013)
Sean Lange (3/7/2013)
Lynn Pettis (3/6/2013)
Several years ago my oldest daughter's JV soccer coach once confieded "I knew we were in trouble when half the team asked what was offsides?"Well, I've just seen the equivalent here with the question "What is SSMS?"
And you are doing what with SQL Server???
And I thought only the parents were that clueless about soccer here in the States.
Someday when we are in the same town and have some time, I'll explain the dynamics of soccer in the area I live and why I wasn't surprised by this comment.
I do plan on meeting many of the Threadizens at some point.
I too would like to meet many Threadizens.
Sadly where I live, many of the coaches don't understand offsides. π I frequently even am forced to remind the "refs" of the rules. For example, last season my team stole the ball after a goal kick and scored. Even though it was our goal I had to remind the ref that a goal kick must get out of the box before the opposing team may touch the ball. One of the refs even once gave a corner to the team by their own goal!!! When I told them they got it wrong they were so confused they tried to give our team a corner.
_______________________________________________________________
Need help? Help us help you.
Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.
Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.
Cross Tabs and Pivots, Part 1 β Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/
March 7, 2013 at 8:56 am
Sean Lange (3/7/2013)
Lynn Pettis (3/7/2013)
Sean Lange (3/7/2013)
Lynn Pettis (3/6/2013)
Several years ago my oldest daughter's JV soccer coach once confieded "I knew we were in trouble when half the team asked what was offsides?"Well, I've just seen the equivalent here with the question "What is SSMS?"
And you are doing what with SQL Server???
And I thought only the parents were that clueless about soccer here in the States.
Someday when we are in the same town and have some time, I'll explain the dynamics of soccer in the area I live and why I wasn't surprised by this comment.
I do plan on meeting many of the Threadizens at some point.
I too would like to meet many Threadizens.
Sadly where I live, many of the coaches don't understand offsides. π I frequently even am forced to remind the "refs" of the rules. For example, last season my team stole the ball after a goal kick and scored. Even though it was our goal I had to remind the ref that a goal kick must get out of the box before the opposing team may touch the ball. One of the refs even once gave a corner to the team by their own goal!!! When I told them they got it wrong they were so confused they tried to give our team a corner.
Just to be sure, ANY free kick coming OUT of the penalty area must clear the penalty area before it is live. Could be a Goal Kick or Freekick for a foul by the attacking team.
March 7, 2013 at 9:08 am
Lynn Pettis (3/7/2013)
Sean Lange (3/7/2013)
Lynn Pettis (3/7/2013)
Sean Lange (3/7/2013)
Lynn Pettis (3/6/2013)
Several years ago my oldest daughter's JV soccer coach once confieded "I knew we were in trouble when half the team asked what was offsides?"Well, I've just seen the equivalent here with the question "What is SSMS?"
And you are doing what with SQL Server???
And I thought only the parents were that clueless about soccer here in the States.
Someday when we are in the same town and have some time, I'll explain the dynamics of soccer in the area I live and why I wasn't surprised by this comment.
I do plan on meeting many of the Threadizens at some point.
I too would like to meet many Threadizens.
Sadly where I live, many of the coaches don't understand offsides. π I frequently even am forced to remind the "refs" of the rules. For example, last season my team stole the ball after a goal kick and scored. Even though it was our goal I had to remind the ref that a goal kick must get out of the box before the opposing team may touch the ball. One of the refs even once gave a corner to the team by their own goal!!! When I told them they got it wrong they were so confused they tried to give our team a corner.
Just to be sure, ANY free kick coming OUT of the penalty area must clear the penalty area before it is live. Could be a Goal Kick or Freekick for a foul by the attacking team.
Yeap, assuming by coming OUT of the penalty area you mean the ball is in the possession of the team defending that goal. π
_______________________________________________________________
Need help? Help us help you.
Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.
Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.
Cross Tabs and Pivots, Part 1 β Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/
March 7, 2013 at 9:16 am
Lynn Pettis (3/7/2013)
Sean Lange (3/7/2013)
Lynn Pettis (3/6/2013)
Several years ago my oldest daughter's JV soccer coach once confieded "I knew we were in trouble when half the team asked what was offsides?"Well, I've just seen the equivalent here with the question "What is SSMS?"
And you are doing what with SQL Server???
And I thought only the parents were that clueless about soccer here in the States.
Someday when we are in the same town and have some time, I'll explain the dynamics of soccer in the area I live and why I wasn't surprised by this comment.
I do plan on meeting many of the Threadizens at some point.
To be fair, offside is the most difficult concept to understand in the laws of soccer/football. A lot of US residents seem to get tripped up by one or more factors: the line between an offside position and a not-offside position changes almost constantly based on the relative positions of the ball and the second-closest-to-the-goal-line-defender (the identity of whom frequently changes with the flow of the game as well), merely being in an offside position is not an offense, and the conversion of the innocuous "being in an offside position" to a penalizable offside offense occurs based on events that almost always occur some distance from the offending player.
All that said, the rules of soccer/football are so simple that the "most difficult concept" is still not very challenging. The rules themselves consist of 17 "laws of the game" of which the first seven govern the mechanics of a match (the field size and layout, the ball, the players and their equipment, the officials, and the length of the match). The remaining 10 laws that actually apply to game play could probably be printed on 10 or fewer pages of 8.5x11-inch or A4-size paper. Contrast that with the NFL rulebook, which requires 67 pages for the rules governing game play.
Jason Wolfkill
March 7, 2013 at 9:23 am
wolfkillj (3/7/2013)
Lynn Pettis (3/7/2013)
Sean Lange (3/7/2013)
Lynn Pettis (3/6/2013)
Several years ago my oldest daughter's JV soccer coach once confieded "I knew we were in trouble when half the team asked what was offsides?"Well, I've just seen the equivalent here with the question "What is SSMS?"
And you are doing what with SQL Server???
And I thought only the parents were that clueless about soccer here in the States.
Someday when we are in the same town and have some time, I'll explain the dynamics of soccer in the area I live and why I wasn't surprised by this comment.
I do plan on meeting many of the Threadizens at some point.
To be fair, offside is the most difficult concept to understand in the laws of soccer/football. A lot of US residents seem to get tripped up by one or more factors: the line between an offside position and a not-offside position changes almost constantly based on the relative positions of the ball and the second-closest-to-the-goal-line-defender (the identity of whom frequently changes with the flow of the game as well), merely being in an offside position is not an offense, and the conversion of the innocuous "being in an offside position" to a penalizable offside offense occurs based on events that almost always occur some distance from the offending player.
All that said, the rules of soccer/football are so simple that the "most difficult concept" is still not very challenging. The rules themselves consist of 17 "laws of the game" of which the first seven govern the mechanics of a match (the field size and layout, the ball, the players and their equipment, the officials, and the length of the match). The remaining 10 laws that actually apply to game play could probably be printed on 10 or fewer pages of 8.5x11-inch or A4-size paper. Contrast that with the NFL rulebook, which requires 67 pages for the rules governing game play.
Your missing Law 18 -- Common Sense.
Yes, parents have a difficult time with offsides as do some coaches. I have gotten into arguments with coaches because their player was onside when they played the ball passed to them even though they were offside at the time their teammate played (or even touched) the ball.
I like how a referee instructor taught it, the 3 P's: Position, Pal, Participation. Is the player in an offside position at the moment his (or her) teammate plays or touches the ball, and they participate in play. If you don't have all three, no infraction.
March 7, 2013 at 9:50 am
wolfkillj (3/7/2013)
Lynn Pettis (3/7/2013)
Sean Lange (3/7/2013)
Lynn Pettis (3/6/2013)
Several years ago my oldest daughter's JV soccer coach once confieded "I knew we were in trouble when half the team asked what was offsides?"Well, I've just seen the equivalent here with the question "What is SSMS?"
And you are doing what with SQL Server???
And I thought only the parents were that clueless about soccer here in the States.
Someday when we are in the same town and have some time, I'll explain the dynamics of soccer in the area I live and why I wasn't surprised by this comment.
I do plan on meeting many of the Threadizens at some point.
To be fair, offside is the most difficult concept to understand in the laws of soccer/football. A lot of US residents seem to get tripped up by one or more factors: the line between an offside position and a not-offside position changes almost constantly based on the relative positions of the ball and the second-closest-to-the-goal-line-defender (the identity of whom frequently changes with the flow of the game as well), merely being in an offside position is not an offense, and the conversion of the innocuous "being in an offside position" to a penalizable offside offense occurs based on events that almost always occur some distance from the offending player.
All that said, the rules of soccer/football are so simple that the "most difficult concept" is still not very challenging. The rules themselves consist of 17 "laws of the game" of which the first seven govern the mechanics of a match (the field size and layout, the ball, the players and their equipment, the officials, and the length of the match). The remaining 10 laws that actually apply to game play could probably be printed on 10 or fewer pages of 8.5x11-inch or A4-size paper. Contrast that with the NFL rulebook, which requires 67 pages for the rules governing game play.
Isn't it the same in hockey?
--------------------------------------
When you encounter a problem, if the solution isn't readily evident go back to the start and check your assumptions.
--------------------------------------
Itβs unpleasantly like being drunk.
Whatβs so unpleasant about being drunk?
You ask a glass of water. -- Douglas Adams
March 7, 2013 at 9:56 am
Stefan Krzywicki (3/7/2013)
wolfkillj (3/7/2013)
Lynn Pettis (3/7/2013)
Sean Lange (3/7/2013)
Lynn Pettis (3/6/2013)
Several years ago my oldest daughter's JV soccer coach once confieded "I knew we were in trouble when half the team asked what was offsides?"Well, I've just seen the equivalent here with the question "What is SSMS?"
And you are doing what with SQL Server???
And I thought only the parents were that clueless about soccer here in the States.
Someday when we are in the same town and have some time, I'll explain the dynamics of soccer in the area I live and why I wasn't surprised by this comment.
I do plan on meeting many of the Threadizens at some point.
To be fair, offside is the most difficult concept to understand in the laws of soccer/football. A lot of US residents seem to get tripped up by one or more factors: the line between an offside position and a not-offside position changes almost constantly based on the relative positions of the ball and the second-closest-to-the-goal-line-defender (the identity of whom frequently changes with the flow of the game as well), merely being in an offside position is not an offense, and the conversion of the innocuous "being in an offside position" to a penalizable offside offense occurs based on events that almost always occur some distance from the offending player.
All that said, the rules of soccer/football are so simple that the "most difficult concept" is still not very challenging. The rules themselves consist of 17 "laws of the game" of which the first seven govern the mechanics of a match (the field size and layout, the ball, the players and their equipment, the officials, and the length of the match). The remaining 10 laws that actually apply to game play could probably be printed on 10 or fewer pages of 8.5x11-inch or A4-size paper. Contrast that with the NFL rulebook, which requires 67 pages for the rules governing game play.
Isn't it the same in hockey?
Not really. The offside line in soccer is in a state of almost constant flux. The blue line in hockey is fixed. No attacking players can cross until the puck crosses. Pretty static.
March 7, 2013 at 9:58 am
Now, if this is a complex query what would the OP think of some of the really complex ones we have helped solve.
March 7, 2013 at 10:08 am
Lynn Pettis (3/7/2013)
Now, if this is a complex query what would the OP think of some of the really complex ones we have helped solve.
And then again ...............
March 7, 2013 at 10:15 am
Rugby Union is my sport, and the rulebook is a mess, extremely complicated and tweaked pretty much every season.
It's refereed inconsistently, even at the international level and you'll see tactics change between games depending on what the ref's picking up or not.
The rules of the scrum are pretty much unenforceable by a single referee that can only see one side of the scrummage and some rules are completely ignored (e.g. feeding the ball into the middle of the scrum).
Having said that, it's an exciting, flowing game that's miles more enjoyable to watch than football (soccer), which in the UK at least is far too tribal.
March 7, 2013 at 10:17 am
Lynn Pettis (3/7/2013)
Now, if this is a complex query what would the OP think of some of the really complex ones we have helped solve.
Wow it is still scary how often people so quickly go to a cursor for such a thing. :w00t:
_______________________________________________________________
Need help? Help us help you.
Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.
Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.
Cross Tabs and Pivots, Part 1 β Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/
Viewing 15 posts - 39,046 through 39,060 (of 66,712 total)
You must be logged in to reply to this topic. Login to reply