<p><strong>tl;dr:</strong>  This is a minor bug report for Kamailio, and regarding access to SQL Azure, I'd be happy to finance an Azure SQL database for testing if desired.</p>
<hr>
<p>The issue is about <em>assumed</em> behavior within the DB_UNIXODBC module.</p>
<p>The behavior in Azure SQL that is atypical, because trying to issue a <code>USE</code> query gives the following error:</p>
<pre><code>USE statement is not supported to switch between databases. Use a new connection to connect to a different database.
</code></pre>
<p>I think <a class="user-mention" data-hovercard-type="user" data-hovercard-url="/hovercards?user_id=610677" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/nakchak">@nakchak</a> may be using an Azure SQL Server (managed instance) vs an Azure SQL Database (single database).  Here's my attempt and error trying to assign a default DB to a login in my Azure database:</p>
<p>Query:</p>
<pre><code>Alter login kamailioRoTest  with default_database = ops-qa-sqldir1
</code></pre>
<p>Error:</p>
<pre><code>Keyword or statement option 'default_database' is not supported in this version of SQL Server.
</code></pre>
<p>From a purely functional standpoint (i.e. to get Kamailio <strong>working</strong> with the Azure DB), the solution is to specify the database in the connection string (see the ODBC.ini example in my original post).  The request is to have an option to just have the module use the default DB from the connection and not attempt to change to the DB once connected.</p>
<p>Think of it like the following if using MySQL:</p>
<pre><code>bash > mysql -D kamailio
mysql > USE kamailoio;
</code></pre>
<p>The second line is superfluous (but not problematic).</p>
<p>For DB_UNIXODBC, setting the DB in the ODBC string WORKS currently.  It just clutters the log with errors. Thus, the bug report is not critical.</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/kamailio/kamailio/issues/1993?email_source=notifications&email_token=ABO7UZKMW45BMDM5KUT6SYLP5TJQVA5CNFSM4H3LN6E2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODZFA6QY#issuecomment-508170051">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABO7UZOYW37VXKWMDWYBXB3P5TJQVANCNFSM4H3LN6EQ">mute the thread</a>.<img src="https://github.com/notifications/beacon/ABO7UZOVHCDZMDUTP4SH2PLP5TJQVA5CNFSM4H3LN6E2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODZFA6QY.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/kamailio/kamailio/issues/1993?email_source=notifications\u0026email_token=ABO7UZKMW45BMDM5KUT6SYLP5TJQVA5CNFSM4H3LN6E2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODZFA6QY#issuecomment-508170051",
"url": "https://github.com/kamailio/kamailio/issues/1993?email_source=notifications\u0026email_token=ABO7UZKMW45BMDM5KUT6SYLP5TJQVA5CNFSM4H3LN6E2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODZFA6QY#issuecomment-508170051",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>