March 17, 2014 at 9:02 am
timwell (3/17/2014)
I have a question.I got crossed up because the documentation says that sp_serveroption and openquery are for connecting to remote or linked servers. I was thinking the delete was happening on some theoretical remote server that may or may not have a tempdb.dbo.a table.
So in the example, is it connecting back to the server you are running the query from as if it is a "remote" server?
yes.
exec sp_serveroption @server = MyServer,@optname = 'DATA ACCESS',@optvalue = 'TRUE'
March 17, 2014 at 9:03 am
These queries demonstrate the two different connection:
select @@SPID
SELECT * FROM OPENQUERY(MyServer,'select @@SPID')
March 17, 2014 at 2:47 pm
nice question..
March 18, 2014 at 12:51 am
Steven.Howes (3/17/2014)
I really have to try answering these later in the day(when I'm more awake). I choose '1'. I didn't realize that I was suppose to choose the number of rows. Being honest, I still don't know if I would have guessed '2'Great question.
+1
Thanks & Best Regards,
Hany Helmy
SQL Server Database Consultant
March 18, 2014 at 12:55 am
Thomas Abraham (3/17/2014)
Thanks for the question, Carlo.Don't know which is more interesting - the option for -1 rows, or the fact that 3% selected it as their answer!
-1 😀
Thanks & Best Regards,
Hany Helmy
SQL Server Database Consultant
March 18, 2014 at 12:56 am
[Incorrect answers: 80%], hmmm interesting.
Thanks & Best Regards,
Hany Helmy
SQL Server Database Consultant
March 18, 2014 at 1:44 am
Hany Helmy (3/18/2014)
Thomas Abraham (3/17/2014)
Thanks for the question, Carlo.Don't know which is more interesting - the option for -1 rows, or the fact that 3% selected it as their answer!
-1 😀
Nooooooooooooo! 😀
Always the minus Number One!
March 18, 2014 at 7:41 am
crussell-931424 (3/18/2014)
It's still a little confusing.
About?
March 18, 2014 at 1:35 pm
I'm not sure I completely understand this.
Is this what's going on?
-The query initially adds a single row with a value of 1.
- The open query returns the deleted set which is a single row with a value of 1; however, the delete is rolled back so the initial row stays there.
- The 'deleted' set is then inserted into a, so it ends up with 2 rows with a value of 1.
March 18, 2014 at 7:08 pm
Interesting Q, thanks
Hope this helps...
Ford Fairlane
Rock and Roll Detective
March 19, 2014 at 1:51 am
marcia.j.wilson (3/18/2014)
I'm not sure I completely understand this.Is this what's going on?
-The query initially adds a single row with a value of 1.
- The open query returns the deleted set which is a single row with a value of 1; however, the delete is rolled back so the initial row stays there.
- The 'deleted' set is then inserted into a, so it ends up with 2 rows with a value of 1.
Exactly!
March 19, 2014 at 12:13 pm
Carlo Romagnano (3/19/2014)
marcia.j.wilson (3/18/2014)
I'm not sure I completely understand this.Is this what's going on?
-The query initially adds a single row with a value of 1.
- The open query returns the deleted set which is a single row with a value of 1; however, the delete is rolled back so the initial row stays there.
- The 'deleted' set is then inserted into a, so it ends up with 2 rows with a value of 1.
Exactly!
Thanks for the confirmation. It took me a while to get my brain wrapped around this and even then I wasn't sure I was right.
March 19, 2014 at 2:41 pm
Hany Helmy (3/18/2014)
[Incorrect answers: 80%], hmmm interesting.
About 36 hours later and the error rate is down to 70%. But still 3% selecting the answer "-1". Definitely interesting.
Tom
March 19, 2014 at 2:54 pm
TomThomson (3/19/2014)
Hany Helmy (3/18/2014)
[Incorrect answers: 80%], hmmm interesting.About 36 hours later and the error rate is down to 70%. But still 3% selecting the answer "-1". Definitely interesting.
I got the wrong answer, but at least -1 was never a consideration for me.
March 19, 2014 at 4:38 pm
marcia.j.wilson (3/19/2014)
TomThomson (3/19/2014)
Hany Helmy (3/18/2014)
[Incorrect answers: 80%], hmmm interesting.About 36 hours later and the error rate is down to 70%. But still 3% selecting the answer "-1". Definitely interesting.
I got the wrong answer, but at least -1 was never a consideration for me.
Nor for me. I can't imagine how 24 people came to pick that answer.
Tom
Viewing 15 posts - 16 through 30 (of 31 total)
You must be logged in to reply to this topic. Login to reply