i have multiple .sql files containing arabic values ,when i run them all using sqlcmd in .bat file the arabic not recognized in the data base

Viewed 147
Ord_Depot      Ord_Product
---------   ------------
ط§ظ„ط¬ظٹظ„ظٹ    ط¨ظ†ط²ظٹظ†

the result of running the .sql files using sqlcmd i want it to accept arabic lang knowing that when i run each .sql file individually using sql server management studio it works fine

Here is my current batch-file

for %%G in (*.sql) do sqlcmd /S LAPTOP-4L4R4VC3\SQLEXPRESS /d master -E -i "%%G"
pause
1 Answers

Set your code page to 1256 to accept Arabic characters using command chcp 1256

@echo off
chcp 1256
for %%G in (*.sql) do sqlcmd /S LAPTOP-4L4R4VC3\SQLEXPRESS /d master -E -i "%%~G"
pause>nul
Related