Forum Discussion
T‑SQL Magic Command (%%tsql) Error in Microsoft Fabric Notebook on Fabric SQL Database
khanjaved , so you can make it work by using the -session parameter in one cell and then making your query in a new %%tsql command?
AsgerLB How it will work? for session we need to use -artifact -type cmd which itself is not working for me now. which is the main issue I posted.
- AsgerLB6 months agoResolver I
khanjaved so running this
%%tsql -artifact sqldb1 -type SQLDatabase -session SELECT TOP (10) * FROM [SalesLT].[Address]Does not work?
- AsgerLB6 months agoResolver I
khanjaved thanks for confirming.
I'm capable of querying my SQL database called TranslyticalDemo with a python notebook (ver 3.11) all placed in the same workspace via the following code:%%tsql -artifact TranslyticalDemo -type SQLDatabase -session SELECT * FROM [SalesLT].[Sales]Can you confirm that you are using a Python execution engine for your notebook and which version, and that both items are in the same workspace?
Also what happens if you create a new python notebook in the workspace of your sqldb and run the code?