On Thu, 2011-03-03 at 13:43 -0600, Chris W wrote:
> On 3/2/2011 5:59 PM, Reindl Harald wrote:
> > Am 03.03.2011 00:31, schrieb Claudio Nanni:
> >> Anyone knows how to get the server* IP address* thru SQL?
> > no, because it is nonsense and has nothing to do with a db-server
> > if you connect via tcp you know the ip
> Isn't that kind of like going to someones home, knocking on their door,
> and asking, "Where do you live?"
> Chris W
What if this is a "load balanced" cluster? Doesn't that setup query
"serverA", and in turn, "serverA" finds the least busiest server in the
"cluster", which could be "serverY", therefore you would have no idea
which server the query was run on?
But, as far as I can tell, you could only get the "server_id" (which
would have to be unique anyway in the cluster), so you could just add
this to the query:
Then you can figure out elsewhere what 'server_id' corresponds to what
server ip address.
Just trying to think of other solutions on why the OP would want this