SQL Server 2016 Severity 015 Not Alerting - sql

Trying to setup an alert in SQL Server 2016 for Severity 015 (syntax errors in SQL statements) however it will not fire off. I can generate the error with a bad SQL statement in query.
I have confirmed DB Mail is working and test messages come in as expected. EMail setup and valid operator in place. I was also able to generate a 017 Alert (insufficient resources) error and get alerted with no problem using the following:
RaisError (N'An error occurred Severity 17: insufficient resources ! ', 17, 1)
With Log
Go
FYI, the reason I need this alerting is we are converting from SQL Server 2008 to SQL Server 2016 and older commands like *= are all over the place. Need to know when they are coming in because of being missed somewhere.
Thanks in advance for any guidance and help.

Related

Azure Logic Apps SQL Connector Error: Bad Request

I'm using the SQL Connector in Azure Logic Apps to connect to our Azure SQL Database to perform queries, update tables, and execute stored procedures. After several months of developing logic apps, I'm seeing the below error message when using the SQL Connector "Execute Stored Procedure (V2)". I'm only encountering this error with this specific connector. All the other connectors work just fine. Has anyone encountered this error before and had success troubleshooting?
Error:
Could not retrieve values. Error code: 'BadRequest', Message: 'The value's length for key 'application name' exceeds it's limit of '128'.
clientRequestId: 'XXXXX'. More diagnostic information: x-ms-client-request-id is 'XXXXX'.
Just had a call with Microsoft Support and got confirmation: this is the global issue in the SQL connector of LogicApp. They are working on this to fix, no ETA for now.
Update: should be fixed from around 29.03.2022 03:00 CET

SQLVDI error when backing up to Azure Storage BLOB

I'm running a patched SQL 2014 trying to backup a database to one of our Azure Storage BLOBs, using:
BACKUP DATABASE [DB]
TO URL = N'https://storage.blob.core.windows.net/server-mssqlserver/DB.bak'
WITH CREDENTIAL = N'AzureCredential'
,NOFORMAT
,NOINIT
,NAME = N'DBA_DB-Full Database Backup'
,NOSKIP
,NOREWIND
,NOUNLOAD
,COMPRESSION
,STATS = 5
GO
but the query throws the following error:
Msg 3292, Level 16, State 9, Line 1
A failure occurred while attempting to execute Backup or Restore with a URL device specified. Consult the Windows Event Log for details.
Msg 3013, Level 16, State 1, Line 1
BACKUP DATABASE is terminating abnormally.
Checking the server's Event Logs shows the actual error as:
SQLVDI: Loc=IdentifySQLServer. Desc=MSSQLSERVER. ErrorCode=(5)Access is denied.
. Process=4668. Thread=6596. Client. Instance=MSSQLSERVER. VD=.
I have made sure that the SQL Server Agent service's account has the Create global objects policy, and also made sure the SQL VSS Writer service is running under the Local System account. The error keeps happening!
Is there something I can do to fix it, or just log some more detailed error messages than the "SQLVDI: Loc=IdentifySQLServer" one above?
Crikey, this is one of those "no idea how I fixed it" things.
Before I went to lunch, I could reliably generate the error in question by running the provided T-SQL, yet when I came back from lunch the BACKUP command completed fine!
The main thing I remember changing was on the Azure side, where I created a SAS (Shared Access Signature).
This is supposedly not required for SQL 2014 as it uses an actual Azure Credential to connect to the storage instead. I actually created the SAS for an instance of SQL Server 2016 that I want backing up to the same container, and that may have opened the access pathway to the container for SQL Server 2014 too!
Many thanks to Sean Gallardy for recommending ProcMon, which showed a whole ton more error log information than the "ErrorCode=(5)Access is denied" message did.

SQL Server stemming issue for dutch language

I use following code to get variations of a dutch word. It works correctly in SQL Server 2008 but SQL Server 2012.
SELECT display_term
FROM sys.dm_fts_parser(N'FORMSOF(INFLECTIONAL, "gespecialiseerd ")', 1043, 0, 1)
So I researched about it and applied this instruction: http://docs.ixperion.smartsite.nl/?nr=56830
The problem is fixed for Dutch but I started getting errors for Turkish Language when I run this:
SELECT TOP 10 * FROM Englishturkish WHERE contains(turkish,'FORMSOF( INFLECTIONAL, "sel")')
The error says:
An error has occurred during the full-text query.
Common causes include: word-breaking errors or timeout, FDHOST permissions/ACL issues, service account missing privileges, malfunctioning IFilters, communication channel issues with FDHost and sqlservr.exe, etc.
Then I repaired SQL Server, it didn't work. Then I removed SQL Server and installed SQL Server 2014 Turkish works now but still Dutch issue exist.
Please help.

Connect to remote sql database using SQL SERVER

I finished a program using VB.NET 2008 AND SQL SERVER 2005 AND Linq To SQL. I want to use the program in 2 or More PCs and get access to one Database
I'm using this connection string:
db = New connectionString("server=192.168.1.3;database=DBNAME;user=DBUSER;password=DBPASS;integrated security=true")
The problem here is I get this message:
Expiration of the waiting period. The waiting time has elapsed prior to completion of the operation or the server is not responding.
NB: The message I got is translated from French language to English..
This error occurs usually because of two issues,
1 - SQL server unreachable ( due to TCP/IP problems or Firewall problems like steve mentioned above)
2 - Badly written queries that are taking too long and the SQL time expires, in this case kindly see the blow link
https://www.simple-talk.com/sql/performance/how-to-identify-slow-running-queries-with-sql-profiler/

msg102 level 15 error - sql server

I was trying to run a script to create a DB with all the tables and data on a server, which I created using script wizard in SSMS 2008. The destination server is 2005 and since I am unable to just restore a backup, I had to go through this long process which entailed running it through sqlcmd cause it was too large to open in SSMS.
But after running for more than 5 hours, I checked on it and it had the following error:
msg 102 level 15 state 1, incorrect syntax near 'VA'
Now I tried finding the source of the error and looking in the script the only reference to 'VA' are in the data types nvarchar or varchar.
Please help, I really need to deploy this DB.
EDIT
For those who have answered, thanks for the responses. I guess I will have to rerun the script but I would like to know if anyone has any ideas on running the script in SSMS. The script is over 2GB in size since it has to recreate the data and there is no other way to deploy this 2008 DB to a 2005 sql server edition.
Either: you have scripted a SQL Server 2008 only option which can be changed in SSMS (tools..options somewhere)
Or (assuming no other VA strings) the word VARCHAR has truncated to VA. I've had this happen with dynamic SQL: can be a real pain to track down
in SSMS if you double click on the error message in the results pane, it will usually change focus and highlight that line of code. Now, how close that line of code is to the actual error depends on the actual problem, but you should be able to find the line of code it is complaining about.
Really tricky to track these down, but you could either try to generate the script setting the compatibility level for SQL 2005 or use the SQL 2005 tools to generate the script.