Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What if the sqlcmd library cannot be initialized in sqlserver2014

2025-04-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

This article mainly introduces the sqlserver2014 can not initialize the sqlcmd library how to do, the article introduced in great detail, has a certain reference value, interested friends must finish!

Sqlserver2014 execution job reported an error:

Perform a script test:

It can be seen that @ query under sp_send_dbmail cannot use temporary tables.

You can only write the actual SQL in @ query. You can't bring a temporary watch.

Write it correctly:

Select b.*

From AAA an inner join

AZX b on a.CompanyID=b.CompanyID and a.BillNo=b.BillNo

Where b.STATUSSTUSTUSTUSTOUSTOUTION 6 times

Create Table # AAA (CompanyID Varchar (10), BillNo Varchar (40))

Exec [msdb] .dbo.sp _ send_dbmail @ profile_name='AAA'

@ recipients='123@163.com'

@ copy_recipients='123@163.com'

@ body_format = 'HTML'

@ execute_query_database = 'BBB'

@ query = 'Select b.*

From # AAA an inner join

AZX b on a.CompanyID=b.CompanyID and a.BillNo=b.BillNo

Where b.STATUSSTUSTUSTUSTOUSTOUTION 6 times

@ subject=' exception reminder'

@ body=' there is an error in the execution of this API'

@ attach_query_result_as_file = 1

@ query_attachment_filename = 'abnormal reminder .Txt'

These are all the contents of the article "what to do if the sqlcmd library cannot be initialized in sqlserver2014". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report