Relative Content

Tag Archive for sql-serverazureapache-sparkdatabricks

Use SQL query to extract data from an external sql server database in azure databricks

I am connecting to an on prem SQL Server database using the code below and it works as expected. I have wrapped the query I want to use in a view and I called the view to read the data into the dataframe. How do I explicitly specify a select query in the spark.read options instead of using a full table or wrapping my select in a view? e.g. option(“sqlcommand”, “select col1, col2 from table1;”)