Unix Technical Forum

Connect to ODBC DB from SQL Server SPROC

This is a discussion on Connect to ODBC DB from SQL Server SPROC within the MS SQL ODBC forums, part of the Microsoft SQL Server category; --> Hello, I have taken on a project where I'm wondering if I'm in a little over my head. Using ...


Go Back   Unix Technical Forum > Database Server Software > Microsoft SQL Server > MS SQL ODBC

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-27-2008, 10:00 PM
=?Utf-8?B?Tmljaw==?=
 
Posts: n/a
Default Connect to ODBC DB from SQL Server SPROC

Hello,

I have taken on a project where I'm wondering if I'm in a little over my
head. Using SQL Mail I need to send out e-mails every hour for orders that
have shipped. There are two databases. One is SQL Server and the other is
only accessible via ODBC (I'm not even sure what type of database it is yet,
but it's not SQL Server). The SQL Server database contains the basic order
information and the other database contains the order status.

I have the queries I need, but how do I connect via ODBC to the other
database from SQL Server? I know (very) little about SQL Mail. Do I set it up
as a job under SQL Server Agent jobs so it will run every hour? Can someone
give me a push in the right direction?

Thank you very much for any help, I really appreciate it.

Thanks,
Nick
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-27-2008, 10:00 PM
Sophie Guo [MSFT]
 
Posts: n/a
Default RE: Connect to ODBC DB from SQL Server SPROC

Hello,

I think you can perform the following steps:

1. Run the query in SQL query analyzer(QA) to make sure it works fine. You
can create a stored procedure.
2. Configure the SQL mail.
3. Run xp_sendmail in SQL QA to send the query results via email.
4. Create a job in SQL agent so it will run every hour.

Generally we can create a linked server to access other data source.
However, it denpends on what database you use. If it is a third party
database, I suggest that you contact the third-party support to consult
with them abouht the issue.

The following information is for your reference:

SQL Server E-mail
http://msdn.microsoft.com/library/de...us/dnovba01/ht
ml/SQLServerE-mail.asp

INF: How to Configure SQL Mail
http://support.microsoft.com/kb/263556

Support WebCast: Troubleshooting Microsoft SQL Mail
http://support.microsoft.com/kb/324689

xp_sendmail
http://msdn.microsoft.com/library/de...us/tsqlref/ts_
xp_aa-sz_6hbg.asp

sp_addlinkedserver
http://msdn.microsoft.com/library/de...us/tsqlref/ts_
sp_adda_8gqa.asp

I hope the information is helpful.

Sophie Guo
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security

================================================== ===
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
================================================== ===
This posting is provided "AS IS" with no warranties, and confers no rights.


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 03:11 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com