Use master
--This works
exec xp_sendmail 'scott_riehl@.b-f.com', @.message='test message'
--This does not work
exec xp_sendmail 'scott_riehl@.b-f.com', @.query='select [name] sysusers'
results are
"ODBC error 4604 (42000) There is no such user or group 'sa4'."
and the 'sa4' changes from 'sa4', to 'sa8', to 'sa0', 'sa' + some random
number.
I've never seen anything like this before, any ideas?
TIA,
ScottDid you forget to include "from" in your query statement?
"Scott Riehl" <scott_riehl@.westmaininteractive.com> wrote in message
news:un5QtxbEEHA.688@.tk2msftngp13.phx.gbl...
> Use master
> --This works
> exec xp_sendmail 'scott_riehl@.b-f.com', @.message='test message'
> --This does not work
> exec xp_sendmail 'scott_riehl@.b-f.com', @.query='select [name] sysusers
'
>
> results are
> "ODBC error 4604 (42000) There is no such user or group 'sa4'."
> and the 'sa4' changes from 'sa4', to 'sa8', to 'sa0', 'sa' + some random
> number.
> I've never seen anything like this before, any ideas?
> TIA,
> Scott
>
>
>
>|||Scott,
See if the resolution found here helps:
http://www.sqlteam.com/Forums/topic.asp?TOPIC_ID=25318
By the way, the query you are submitting is invalid or you have a typo
here. It isn't likely to work with
select [name] sysusers
so make sure whatever query you submit runs successfully in Query Analyzer.
Steve Kass
Drew University
Scott Riehl wrote:
>Use master
>--This works
>exec xp_sendmail 'scott_riehl@.b-f.com', @.message='test message'
>--This does not work
>exec xp_sendmail 'scott_riehl@.b-f.com', @.query='select [name] sysusers'
>
>results are
>"ODBC error 4604 (42000) There is no such user or group 'sa4'."
>and the 'sa4' changes from 'sa4', to 'sa8', to 'sa0', 'sa' + some random
>number.
>I've never seen anything like this before, any ideas?
>TIA,
>Scott
>
>
>
>
>|||Sorry, that was a typo, the 'From' clause is present.
"Scott Morris" <bogus@.bogus.com> wrote in message
news:%236hl67bEEHA.624@.TK2MSFTNGP10.phx.gbl...
> Did you forget to include "from" in your query statement?
> "Scott Riehl" <scott_riehl@.westmaininteractive.com> wrote in message
> news:un5QtxbEEHA.688@.tk2msftngp13.phx.gbl...
>|||Thanks, that is a typo, sorry.
The link is appropriate, I'll try their recommnedations.
Scott
"Steve Kass" <skass@.drew.edu> wrote in message
news:unoqbJcEEHA.3088@.tk2msftngp13.phx.gbl...
> Scott,
> See if the resolution found here helps:
> http://www.sqlteam.com/Forums/topic.asp?TOPIC_ID=25318
> By the way, the query you are submitting is invalid or you have a typo
> here. It isn't likely to work with
> select [name] sysusers
> so make sure whatever query you submit runs successfully in Query
Analyzer.
> Steve Kass
> Drew University
> Scott Riehl wrote:
>
>|||I should have known......a quick reboot fixed everything!
Scott
"Steve Kass" <skass@.drew.edu> wrote in message
news:unoqbJcEEHA.3088@.tk2msftngp13.phx.gbl...
> Scott,
> See if the resolution found here helps:
> http://www.sqlteam.com/Forums/topic.asp?TOPIC_ID=25318
> By the way, the query you are submitting is invalid or you have a typo
> here. It isn't likely to work with
> select [name] sysusers
> so make sure whatever query you submit runs successfully in Query
Analyzer.
> Steve Kass
> Drew University
> Scott Riehl wrote:
>
>
Showing posts with label bizare. Show all posts
Showing posts with label bizare. Show all posts
Sunday, February 12, 2012
Bizare xp_sendmail error
Labels:
bizare,
cott_riehlb-f,
database,
error,
est,
master-this,
message,
microsoft,
mysql,
oracle,
server,
sql,
workexec,
worksexec,
xp_sendmail
Bizare String Concatenation Issue - Explanation Needed
Hi all, can someone please explain why this is happening:
I execute the following:
DECLARE @.temp VARCHAR(500)
SET @.temp = ''
SELECT @.temp = @.temp + '[' + T.NAME + ']'
FROM MyTable T
SELECT @.temp
Say [MyTable] looks like this:
|NAME|
--
A
B
C
D
Here are the result from running the above code on two different SQL Server
2000 installations:
SQL Server 2000 #1
[D]
SQL Server 2000 #2
[A][B][C][D]
I want #2. Is there some database option that I'm missing or something? Any
help would be appreciated. Thanks.SELECT @.@.version from each server? Might be different builds.
For me:
DECLARE @.temp VARCHAR(500)
SET @.temp = ''
SELECT @.temp = @.temp + '[' + T.NAME + ']'
FROM master.dbo.sysdatabases T
SELECT @.temp
select @.@.version
SQL 2000, build 878 (Sp3a plus hotfixes):
[master][tempdb][model][msdb][pubs][Nort
hwind]
SQL 2005, IDW 13:
[master][tempdb][model][msdb][AdventureW
orksDW][AdventureWorks]
Regards
--
Mike Epprecht, Microsoft SQL Server MVP
Zurich, Switzerland
IM: mike@.epprecht.net
MVP Program: http://www.microsoft.com/mvp
Blog: http://www.msmvps.com/epprecht/
"Mike Treadway" <MikeTreadway@.discussions.microsoft.com> wrote in message
news:39B330F1-41D5-4A7F-BFE0-25998D07C492@.microsoft.com...
> Hi all, can someone please explain why this is happening:
> I execute the following:
> DECLARE @.temp VARCHAR(500)
> SET @.temp = ''
> SELECT @.temp = @.temp + '[' + T.NAME + ']'
> FROM MyTable T
> SELECT @.temp
>
> Say [MyTable] looks like this:
> |NAME|
> --
> A
> B
> C
> D
> Here are the result from running the above code on two different SQL
> Server
> 2000 installations:
> SQL Server 2000 #1
> [D]
> SQL Server 2000 #2
> [A][B][C][D]
> I want #2. Is there some database option that I'm missing or something?
> Any
> help would be appreciated. Thanks.|||Thanks Mike. I should have posted an update, but I found this:
http://support.microsoft.com/defaul...b;EN-US;q287515
What I posted here was a simple example of my issue, my actual query
contained a little more SQL and it was on a view instead of a table. Doing
the following resolved my issue:
SELECT @.temp = @.temp + '[' + T.NAME + ']'
FROM (SELECT * FROM MyTable) T
This caused the query optimizer to sort the results of the inner query
first, then apply the concatenations.
Thanks again for your response Mike.
"Mike Epprecht (SQL MVP)" wrote:
> SELECT @.@.version from each server? Might be different builds.
> For me:
> DECLARE @.temp VARCHAR(500)
> SET @.temp = ''
> SELECT @.temp = @.temp + '[' + T.NAME + ']'
> FROM master.dbo.sysdatabases T
> SELECT @.temp
> select @.@.version
> SQL 2000, build 878 (Sp3a plus hotfixes):
> [master][tempdb][model][msdb][pubs][Nort
hwind]
> SQL 2005, IDW 13:
> [master][tempdb][model][msdb][AdventureW
orksDW][AdventureWorks]
> Regards
> --
> Mike Epprecht, Microsoft SQL Server MVP
> Zurich, Switzerland
> IM: mike@.epprecht.net
> MVP Program: http://www.microsoft.com/mvp
> Blog: http://www.msmvps.com/epprecht/
> "Mike Treadway" <MikeTreadway@.discussions.microsoft.com> wrote in message
> news:39B330F1-41D5-4A7F-BFE0-25998D07C492@.microsoft.com...
>
>
I execute the following:
DECLARE @.temp VARCHAR(500)
SET @.temp = ''
SELECT @.temp = @.temp + '[' + T.NAME + ']'
FROM MyTable T
SELECT @.temp
Say [MyTable] looks like this:
|NAME|
--
A
B
C
D
Here are the result from running the above code on two different SQL Server
2000 installations:
SQL Server 2000 #1
[D]
SQL Server 2000 #2
[A][B][C][D]
I want #2. Is there some database option that I'm missing or something? Any
help would be appreciated. Thanks.SELECT @.@.version from each server? Might be different builds.
For me:
DECLARE @.temp VARCHAR(500)
SET @.temp = ''
SELECT @.temp = @.temp + '[' + T.NAME + ']'
FROM master.dbo.sysdatabases T
SELECT @.temp
select @.@.version
SQL 2000, build 878 (Sp3a plus hotfixes):
[master][tempdb][model][msdb][pubs][Nort
hwind]
SQL 2005, IDW 13:
[master][tempdb][model][msdb][AdventureW
orksDW][AdventureWorks]
Regards
--
Mike Epprecht, Microsoft SQL Server MVP
Zurich, Switzerland
IM: mike@.epprecht.net
MVP Program: http://www.microsoft.com/mvp
Blog: http://www.msmvps.com/epprecht/
"Mike Treadway" <MikeTreadway@.discussions.microsoft.com> wrote in message
news:39B330F1-41D5-4A7F-BFE0-25998D07C492@.microsoft.com...
> Hi all, can someone please explain why this is happening:
> I execute the following:
> DECLARE @.temp VARCHAR(500)
> SET @.temp = ''
> SELECT @.temp = @.temp + '[' + T.NAME + ']'
> FROM MyTable T
> SELECT @.temp
>
> Say [MyTable] looks like this:
> |NAME|
> --
> A
> B
> C
> D
> Here are the result from running the above code on two different SQL
> Server
> 2000 installations:
> SQL Server 2000 #1
> [D]
> SQL Server 2000 #2
> [A][B][C][D]
> I want #2. Is there some database option that I'm missing or something?
> Any
> help would be appreciated. Thanks.|||Thanks Mike. I should have posted an update, but I found this:
http://support.microsoft.com/defaul...b;EN-US;q287515
What I posted here was a simple example of my issue, my actual query
contained a little more SQL and it was on a view instead of a table. Doing
the following resolved my issue:
SELECT @.temp = @.temp + '[' + T.NAME + ']'
FROM (SELECT * FROM MyTable) T
This caused the query optimizer to sort the results of the inner query
first, then apply the concatenations.
Thanks again for your response Mike.
"Mike Epprecht (SQL MVP)" wrote:
> SELECT @.@.version from each server? Might be different builds.
> For me:
> DECLARE @.temp VARCHAR(500)
> SET @.temp = ''
> SELECT @.temp = @.temp + '[' + T.NAME + ']'
> FROM master.dbo.sysdatabases T
> SELECT @.temp
> select @.@.version
> SQL 2000, build 878 (Sp3a plus hotfixes):
> [master][tempdb][model][msdb][pubs][Nort
hwind]
> SQL 2005, IDW 13:
> [master][tempdb][model][msdb][AdventureW
orksDW][AdventureWorks]
> Regards
> --
> Mike Epprecht, Microsoft SQL Server MVP
> Zurich, Switzerland
> IM: mike@.epprecht.net
> MVP Program: http://www.microsoft.com/mvp
> Blog: http://www.msmvps.com/epprecht/
> "Mike Treadway" <MikeTreadway@.discussions.microsoft.com> wrote in message
> news:39B330F1-41D5-4A7F-BFE0-25998D07C492@.microsoft.com...
>
>
Labels:
bizare,
concatenation,
database,
execute,
explain,
explanation,
followingdeclare,
happeningi,
microsoft,
mysql,
oracle,
select,
server,
sql,
string,
temp,
varchar
Subscribe to:
Posts (Atom)