Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 ODBC error 170 (42000) while running stored proced

Author  Topic 

kdelv400
Starting Member

1 Post

Posted - 2008-02-06 : 22:47:05
I am trying to run this stored procedure and I keep getting the error message...
ODBC error 170 (42000) Line 1: Incorrect syntax near ','.


CREATE PROCEDURE dbo.spfriend as

declare @MySubject varchar(80)

declare @MyQuery varchar(3000)
declare @MyMessage varchar(3000)
declare @SendList varchar(255)
select @SendList = 'email@email.com'
select @mysubject = 'Test email'
select @myquery = 'handle,altsite,emailaddress, headline, aboutme from tblfriend'
exec master.dbo.xp_sendmail
@recipients =@SendList,
@subject = @mysubject,
@query = @myquery
GO

Any suggestions would be greatly appreciated
Thanks
Kyle

rmiao
Master Smack Fu Yak Hacker

7266 Posts

Posted - 2008-02-07 : 00:36:15
Should be this?

select @myquery = 'select handle, altsite, emailaddress, headline, aboutme from tblfriend'
Go to Top of Page
   

- Advertisement -