![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
#3
| |||
| |||
|
|
Hi Mike, Seems you are missing the @query parameter of xp_sendmail. Try changing you code to: exec master.dbo.xp_sendmail @recipients = 'x... (AT) xxxxx (DOT) com', @subject = @SubjectLine, @query = @strBody HTH, Plamen Ratchevhttp://www.SQLStudio.com |
#4
| |||
| |||
|
#5
| |||
| |||
|
|
You declared @strBody as varchar(1000) and in fact your SQL statement is around 2339 characters (according to a quick copy/paste to a text editor). Try declaring as varchar(3000). HTH, Plamen Ratchevhttp://www.SQLStudio.com |
#6
| |||
| |||
|
|
On Dec 13, 1:50 pm, "Plamen Ratchev" <Pla... (AT) SQLStudio (DOT) com> wrote: You declared @strBody as varchar(1000) and in fact your SQL statement is around 2339 characters (according to a quick copy/paste to a text editor). Try declaring as varchar(3000). HTH, Plamen Ratchevhttp://www.SQLStudio.com Thanks that really helped. I glanced over it and yet totally missed it. My other question is how do I specify the having clause if I put the single quotes like this: HAVING (FSA_Weekly_Flash.dbo.GL_Account.GL_Account) = '500-001' I get an error. I can again make it work fine in query analyzer but I cant seem to figure out how to make it work in this stored procedure. Thanks for all your help!! |
#7
| |||
| |||
|
|
(FSA_Weekly_Flash.dbo.GL_Account.GL_Account) = ''500-001'' -- Greg Moore SQL Server DBA Consulting Remote and Onsite available! Email: sql (at) greenms.com http://www.greenms.com/sqlserver.html "Mike K" <vwttra... (AT) hotmail (DOT) com> wrote in message news:2ee535d8-660f-47d9-ba37-cae5734ad537 (AT) d4g2000prg (DOT) googlegroups.com... On Dec 13, 1:50 pm, "Plamen Ratchev" <Pla... (AT) SQLStudio (DOT) com> wrote: You declared @strBody as varchar(1000) and in fact your SQL statement is around 2339 characters (according to a quick copy/paste to a text editor). Try declaring as varchar(3000). HTH, Plamen Ratchevhttp://www.SQLStudio.com Thanks that really helped. I glanced over it and yet totally missed it. My other question is how do I specify the having clause if I put the single quotes like this: HAVING (FSA_Weekly_Flash.dbo.GL_Account.GL_Account) = '500-001' I get an error. I can again make it work fine in query analyzer but I cant seem to figure out how to make it work in this stored procedure. Thanks for all your help!! |
#8
| |||
| |||
|
|
On Dec 13, 3:23 pm, "Greg D. Moore \(Strider\)" mooregr_deletet... (AT) greenms (DOT) com> wrote: (FSA_Weekly_Flash.dbo.GL_Account.GL_Account) = ''500-001'' -- Greg Moore SQL Server DBA Consulting Remote and Onsite available! Email: sql (at) greenms.com http://www.greenms.com/sqlserver.html "Mike K" <vwttra... (AT) hotmail (DOT) com> wrote in message news:2ee535d8-660f-47d9-ba37-cae5734ad537 (AT) d4g2000prg (DOT) googlegroups.com... On Dec 13, 1:50 pm, "Plamen Ratchev" <Pla... (AT) SQLStudio (DOT) com> wrote: You declared @strBody as varchar(1000) and in fact your SQL statement is around 2339 characters (according to a quick copy/paste to a text editor). Try declaring as varchar(3000). HTH, Plamen Ratchevhttp://www.SQLStudio.com Thanks that really helped. I glanced over it and yet totally missed it. My other question is how do I specify the having clause if I put the single quotes like this: HAVING (FSA_Weekly_Flash.dbo.GL_Account.GL_Account) = '500-001' I get an error. I can again make it work fine in query analyzer but I cant seem to figure out how to make it work in this stored procedure. Thanks for all your help!! I have tried that... i get an invalid column name. Is this a conversion issue? |
#9
| |||
| |||
|
|
On Dec 13, 3:24 pm, Mike K <vwttra... (AT) hotmail (DOT) com> wrote: On Dec 13, 3:23 pm, "Greg D. Moore \(Strider\)" mooregr_deletet... (AT) greenms (DOT) com> wrote: (FSA_Weekly_Flash.dbo.GL_Account.GL_Account) = ''500-001'' -- Greg Moore SQL Server DBA Consulting Remote and Onsite available! Email: sql (at) greenms.com http://www.greenms.com/sqlserver.html "Mike K" <vwttra... (AT) hotmail (DOT) com> wrote in message news:2ee535d8-660f-47d9-ba37-cae5734ad537 (AT) d4g2000prg (DOT) googlegroups.com... On Dec 13, 1:50 pm, "Plamen Ratchev" <Pla... (AT) SQLStudio (DOT) com> wrote: You declared @strBody as varchar(1000) and in fact your SQL statement is around 2339 characters (according to a quick copy/paste to a text editor). Try declaring as varchar(3000). HTH, Plamen Ratchevhttp://www.SQLStudio.com Thanks that really helped. I glanced over it and yet totally missed it. My other question is how do I specify the having clause if I put the single quotes like this: HAVING (FSA_Weekly_Flash.dbo.GL_Account.GL_Account) = '500-001' I get an error. I can again make it work fine in query analyzer but I cant seem to figure out how to make it work in this stored procedure. Thanks for all your help!! I have tried that... i get an invalid column name. Is this a conversion issue? I just realized what you were trying to say Gregg. Its two single quotes '' not a double " . That worked. Thanks |
#10
| |||
| |||
|
|
"Mike K" <vwttra... (AT) hotmail (DOT) com> wrote in message news:8af1fbb5-a087-4e8a-a4e3-fe425e198ce1 (AT) e25g2000prg (DOT) googlegroups.com... On Dec 13, 3:24 pm, Mike K <vwttra... (AT) hotmail (DOT) com> wrote: On Dec 13, 3:23 pm, "Greg D. Moore \(Strider\)" mooregr_deletet... (AT) greenms (DOT) com> wrote: (FSA_Weekly_Flash.dbo.GL_Account.GL_Account) = ''500-001'' -- Greg Moore SQL Server DBA Consulting Remote and Onsite available! Email: sql (at) greenms.com http://www.greenms.com/sqlserver.html "Mike K" <vwttra... (AT) hotmail (DOT) com> wrote in message news:2ee535d8-660f-47d9-ba37-cae5734ad537 (AT) d4g2000prg (DOT) googlegroups.com... On Dec 13, 1:50 pm, "Plamen Ratchev" <Pla... (AT) SQLStudio (DOT) com> wrote: You declared @strBody as varchar(1000) and in fact your SQL statement is around 2339 characters (according to a quick copy/paste to a text editor). Try declaring as varchar(3000). HTH, Plamen Ratchevhttp://www.SQLStudio.com Thanks that really helped. I glanced over it and yet totally missed it. My other question is how do I specify the having clause if I put the single quotes like this: HAVING (FSA_Weekly_Flash.dbo.GL_Account.GL_Account) = '500-001' I get an error. I can again make it work fine in query analyzer but I cant seem to figure out how to make it work in this stored procedure. Thanks for all your help!! I have tried that... i get an invalid column name. Is this a conversion issue? I just realized what you were trying to say Gregg. Its two single quotes '' not a double " . That worked. Thanks Not a problem. BTW, that's Greg with single G, not double G :-) -- Greg Moore SQL Server DBA Consulting Remote and Onsite available! Email: sql (at) greenms.com http://www.greenms.com/sqlserver.html |
![]() |
| Thread Tools | |
| Display Modes | |
| |