cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
Join discussions on data engineering best practices, architectures, and optimization strategies within the Databricks Community. Exchange insights and solutions with fellow data engineers.
cancel
Showing results for 
Search instead for 
Did you mean: 

What's the equivalent of "DECLARE..." in Databricks SQL ?

wyzer
Contributor II

Hello everyone,

I'm new in Databricks SQL, and I'm comming from SQL Server.

I would like to know what's the equivalent of :

DECLARE @P_Name varchar(50) = 'BackOffice'

It's for use it like this :

CREATE DATABASE @P_Name

Thanks.

15 REPLIES 15

Amit_352107
New Contributor III

Hi @Salah K.​ 

you can go through this code block

%python

P_Name = 'BackOffice'

spark.sql(f""" create database {P_name} """)

Join Us as a Local Community Builder!

Passionate about hosting events and connecting people? Help us grow a vibrant local community—sign up today to get started!

Sign Up Now