1. Create an engine to connect to SQL Server
```
from sqlalchemy import create_engine
engine = create_engine('mssql+pyodbc://username:password@server/database')
```
2. Write a query to select / reshape data from SQL Server
```
SELECT * FROM table_name
```
(in marimo, the result gets saved to an Output variable that you specify)
3. To use a local database, use the `ATTACH DATABASE` statement
```
ATTACH DATABASE 'local_database.db';
```
You can also attach a database file from cloud storage. I use GCS, so my example is:
```
ATTACH DATABASE 'gs://bucket_name/database.db';
```
4. Insert the data from the Output variable into duckdb
```
CREATE OR REPLACE TABLE table_name AS
SELECT * FROM Output_variable
```