Skip to main content

All Questions

Filter by
Sorted by
Tagged with
0 votes
1 answer
591 views

Unable to connect to Azure SQL Database using Invoke-Sqlcmd in PowerShell

I'm currently facing an issue with connecting to an Azure SQL Database using PowerShell's Invoke-Sqlcmd cmdlet. I am able to successfully connect to the database using sqlcmd (Version 18.2.0001.1 ...
Shimii's user avatar
  • 15
0 votes
2 answers
256 views

Referring to other files in SQL Pre-deployment script using Devops Self-Hosted agent

We are using DevOps YAML pipelines to build and deploy database changes to our production environment. The database is deployed through a DACPAC file. We have a pre and post deployment file configured ...
Koen van Wielink's user avatar
1 vote
1 answer
783 views

Azure SQL authentication - Service Principal not working in SSMS/SqlCmd

We have a requirement to connect to Azure SQL Database using Service Principal Details. We are using SSMS(v19) and sqlcmd to connect. What we done so far: Create service principal and secret Assign ...
Varghese's user avatar
0 votes
1 answer
394 views

Sqlcmd multiline script in terraform local provisioner

When I run this provisioner it gives me error: exit status 2. Output: Sqlcmd: Error: Microsoft ODBC Driver 18 for SQL Server : Login failed for user 'User'.. │ /bin/sh: 2: Syntax error: "(" ...
Michael's user avatar
  • 174
0 votes
1 answer
844 views

CSV insertion using SQLCMD, how to do it?

I have been reading a lot of forums and tutorials where other users ask the same but the answer is almost the same always: use BCP.EXE (BULK INSERT) instead to import, and also export with BCP.EXE ...
Daniel Ortega's user avatar
6 votes
4 answers
5k views

How to react to message from Microsoft regarding updating API's

I got a message from Microsoft in the last few days Azure SQL Database 2014-04-01 APIs will be retired on 31 October 2025. You're receiving this email because you use Azure SQL Database APIs. To ...
gordon613's user avatar
  • 2,922
1 vote
2 answers
3k views

How to specify that .dacpac should use default SQLCMD variable values specified in VS2022 database project?

I have an Azure SQL database project which uses SQLCMD variables to set values dynamically. I am able to reference these variables as part of publish profiles that accompany the project and can even ...
GettingItDone's user avatar
0 votes
0 answers
1k views

Get Latency of a database connection

I'd like to know a bash command to get the latency (response time) of a database connection. I'm not interested in the performance of the database itself - I just want to know the latency to the ...
Munchkin's user avatar
  • 4,926
1 vote
1 answer
4k views

How to resolve "Principal 'PRINCIPAL_NAME' could not be created." error?

I'm using below sqlcmd command in shell script. sqlcmd -S <SERVER_NAME> -U "<USERNAME>" -P <PASSWORD> -d "<DATABASE>" -q 'CREATE USER [<PRINCIPAL_NAME>] FROM EXTERNAL ...
Abhishek Parmar's user avatar
0 votes
1 answer
1k views

Cannot connect to remote AzureDB server via SSH Tunnel

I want to connect to a remote AzureDB server (which has ip address ip2 and hostname "abc.database.windows.net" ) from my local computer(which has ip address ip1). However, my local host can't directly ...
lee dan's user avatar
0 votes
2 answers
6k views

How to connect to an Azure SQL Server using command prompt?

I have an Azure SQL database that I am able to connect using local SSMS. Server Name - <Server>.database.windows.net UserName - zrana Password - ***** The authentication mode I use is here is ...
Zankhana Rana's user avatar
0 votes
1 answer
215 views

When is Azure SQL ready to receive queries?

Problem When I deploy an Azure SQL Database, I would like to make some queries immediately after (on the Azure DevOps agents). Is there any way to find out when it is ready to receive queries? ...
Esben Eickhardt's user avatar
0 votes
1 answer
1k views

Powershell script to create security groups in Azure Active Directory to manage access to Azure SQL

Below is a script that creates groups in Azure AD and then assigns SQL roles to the groups. The script has a dependency on ODBC 17 and sqlcmd utility version 15 and this makes it a bit hard to use in ...
Dries Venter's user avatar
0 votes
1 answer
801 views

SQLCMD from SSMS is not working; connecting to Azure SQL Database

Running this from my SQL Server Management Studuio (SSMS) connecting to Azure sql database. I am using SQLCMD mode of SSMS. :Connect -S taiobdemo1.database.windows.net -d taiobcustomer -U sqlusername ...
SqlWorldWide's user avatar
0 votes
1 answer
219 views

Using SQLCMD on Ubuntu not updating Azure SQL database

I have SQLCMD on a Ubuntu machine. I parse many XML files and generate Insert/Update/Delete statements and save them in an .sql file. So a single .sql file contains many sql statements. They all are ...
HSharma's user avatar
  • 403
5 votes
3 answers
9k views

sqlcmd not connecting to Azure database

I am trying to use the command below to access my database within Azure sqlcmd -s tcp:DBNAME HERE.database.windows.net -U USERNAME -P PASSWORD I get the error Sqlcmd: Error: Microsoft ODBC ...
Paul's user avatar
  • 3,133
10 votes
2 answers
7k views

Unable to reach SQL database through SSH tunnel using sqlcmd

I need to connect to a an Azure SQL DB from my local machine through a jump box (Azure VM). I set up the port forwarding using the command: ssh -fN -L 41433:my-db.database.windows.net:1433 me@jump-...
nihil0's user avatar
  • 369
4 votes
0 answers
986 views

SSDT database project - set external table data source using SQLCMD variables

I have created a Azure SQL database project in VS. My stored procedures have to reference tables in another Azure SQL database. So I have defined an external data source, as shown below: CREATE ...
G-man's user avatar
  • 51
0 votes
1 answer
525 views

How to write sqlcmd results directly to Azure Storage using Azure PowerShell?

Current story: Moving overall BI solution fully to Azure cloud services. Building a new Azure DW and loading data from an Azure DB. Currently, Azure DW doesn't support linked servers and/or the ...
jeff_dude's user avatar