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

How to solve the strange problems caused by comments in SQL scripts

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

Share

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

How to solve the strange problem caused by comments in SQL scripts, for this problem, this article describes the corresponding analysis and solution in detail, hoping to help more partners who want to solve this problem find a simpler and easier way.

In the database installation package, we update the related database scripts through osql.exe. Yesterday, we suddenly found that the installation package reported an error, saying that the script was wrong, but we took the script to the database query analyzer and executed it, everything was OK.

What is the problem?

Print the message by executing the error script using osql alone

The code is as follows:

osql.exe -S .\ SQLDEV -U sa -P MyRoot -b -n -r 1 -i ".\ UpdateTable.sql" -o "c:\hahah.txt" @echo %errorlevel% @pause

I got the following error message: osql Missing end comment mark "*/" fainted, saying that my comment character is missing, but there is no less ah. Finally, it was found that there was a GO statement problem in the comment statement, as follows:

/* ........... GO */removed, everything is normal, it seems that this is also a small osql tool BUG bar.

About how to solve the SQL script comments caused by strange questions on the answer to share here, I hope the above content can be of some help to everyone, if you still have a lot of doubts not solved, you can pay attention to the industry information channel to learn more related knowledge.

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