Forum Discussion
T‑SQL Magic Command (%%tsql) Error in Microsoft Fabric Notebook on Fabric SQL Database
Hi khanjaved
Thanks for your question.
It could be an issue with the latest release of the ODBC driver (18), which defaults to encryption making SSL/TLS mandatory and more pedantic about certificate details - you can try and run the following cell at the beginning of your notebook to explicitly tell your notebook envrionment to trust severside certificates:
import os
os.environ["ODBC_TRUST_SERVER_CERTIFICATE"] = "yes"
Alternatively, try and see if you can replace the artifact 'nickname' with the fully qualified server name
%%tsql -artifact [FULL_SERVER_NAME] -type SQLDatabase
SELECT TOP (10) * FROM [SalesLT].[Address];
Br Asger
- AsgerLB6 months agoResolver I
HI khanjaved thanks for getting back!
Have you tried adding the -session parameter along with your others? It seems like MS documentation specifies if you are using the tsql magic you must first establish a session connection:
https://learn.microsoft.com/en-us/fabric/data-engineering/tsql-magic-command-notebook#using-t-sql-magic-command-as-line-magic
Br
Asger