The method of directly passing T-SQL commands to the SQL Server Linux container through STDIN for execution

208598577-4b5ef4a3-de35-447e-9cdd-844cf7

I have written two articles before, one is to use Docker to execute common tools and commands of SQL Server on Linux containers to share various common execution commands, and the other is to deeply analyze the -i and -t technologies of docker run and docker exec The details helped me better understand how Docker handles STDIN in relation to the Virtual Terminal (VT). This connects me to a requirement that Microsoft has long hoped to be realized. If I want to directly pass T-SQL into the SQL Server on Linux container through STDIN for execution without copying the local T-SQL file into it first, what should I do? deal with? Unexpectedly, I really found a way for me!

continue reading

This article is transferred from http://blog.miniasp.com/post/2022/12/20/How-to-use-STDIN-for-sqlcmd-on-SQL-Server-2022-Linux
This site is only for collection, and the copyright belongs to the original author.