How do I represent binary forms of data in Transact-SQL statements with Changshilai?

Source: Internet
Author: User
Tags format constant insert sql
Binary | data | Statement binary data can be an image, sound, or any other data. If we can represent these binaries as constants, we can insert and update the data in the datasheet directly with the TRANSCAT-SQL statement.
In fact, Transcat-sql has provided us with a method that is binary constant format. This format starts with "0x" followed by several hexadecimal digits, each of which is represented by a two-digit hexadecimal number. Therefore, you can completely convert those image sound data into this binary constant format and then use it in the INSERT or UPDATE statement.
However, such binary constants will be very long. This makes SQL statements difficult to read, and can also cause problems in the editor with limited length for some rows.
So, there's no way to wrap binary constants?
Unfortunately, I searched Transact-SQL online Help, search the network, there is no answer.
Is there really no way?
The road has always been a way for someone to walk through it. Perhaps the predecessors had passed, the latter did not know. Even, the road was there, and you dare not go?
So, the adventure begins:
I forced the long binary constant to break, execute, error ...
In front of the line Plus "_", VB line of folding symbol, error ...
Replace "\ n", c,c++ the string, error ...
Enclose in quotation marks, error ...
Change double quotes, error ...
..., error ...
..., error ...
..., error ...
The previous line will add "\", Success!
I'm a little hard to believe, try again, succeed!

After a little surprise, I immediately remained calm: is the data inserted correctly?
Immediately, write program verification, completely correct!
  

The original "\" is a binary constant line break, the road is there!

Li Shi, Shenzhen, 2004-10-14

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.