Execution of the stored procedure gives different result comparing with the direct execution
Hi everybody, I'm getting very puzzling results executing stored procedure vs executing subset of the code from that stored procedure directly. I have the following code to execute SP: DECLARE @RC INT DECLARE @inp_region_nbr TINYINT = 1 DECLARE @inp_npi…
SQL Server Transact-SQL

Issue with SQL Azure Secure Enclave: LIKE Clause Failing with Error".
I am using Microsoft SQL Azure (RTM) - 12.0.2000.8 , where I configured the secure enclave with VBS where I am using keyvalut for creating column master key. All the operators are working fine except like. Able to insert, update with where clause. Tried…
SQL Server Transact-SQL

Using IsNull with different data types in SQL SERVER
Hi Team, I am working on on premises SQL Server. I have a requirement where I need to apply left outer join between 2 tables and use IsNull to show default data when columns are having null. Under ISNULL, if a column is null what shall i put for below…
SQL Server Transact-SQL

Regarding the stability of the execution plan generation
My English is not good, so I use a translator to communicate. Please excuse me if it's not accurate I'm optimizing an sql,I created a few indexes, and the cost exceeded the parallel threshold, and it reported that the optimization was prematurely…
SQL Server Transact-SQL
SQL Linked Server Connection to Oracle
I have a linked server connection between my SQL server and remote Oracle server. I can query the Oracle server from SQL without issue. I need to insert data from SQL into Oracle. The problem is the table names in SQL are different than Oracle. I tried…
SQL Server Transact-SQL
Inquiry About Extended Stored Procedures
Hi Team, I hope you're doing well. I would appreciate it if you could help me understand the following: What is an Extended Stored Procedure in SQL Server? Why did Microsoft deprecate Extended Stored Procedures? A brief explanation would be greatly…
SQL Server Transact-SQL

Contains/Containstable and search in Like mode
I have indexed the "Contenido" field in Full Text. Searching with CONTAINS/CONTAINSTABLE in Like mode yields no matches when using words that contain the text "ous" (house). If I remove the asterisks and I write 'house', the text is…
SQL Server Transact-SQL

Enable parallelism for TSQL scalar UDFs involving CLR function call in SQL Server
We are working on a UDF solution for MSSQL Server. Currently we have scalar TSQL UDFs which calls CLR functions. CLR functions (written in C#) further calls C functions present in a DLL file which is imported by C# layer using DLLImport. Also due to some…
SQL Server Transact-SQL

SQLServerBulkCSVFileRecord java and quotes problem
i can't laod using SQLServerBulkCSVFileRecord (ver 12.10) a file like this: xxx;yyyy;test"test;zzzz simple file with 1 simple quote in nvarchar column, give error "com.microsoft.sqlserver.jdbc.SQLServerException: Unable to retrieve data from…
SQL Server Transact-SQL
Avoiding table locking while Update
Hi Team, I am working on a SQL Server Stored Procedure, where I need to update a column of a table in a no. of rows. This stored procedure will be called from a timer trigger Azure function, which will scale so that 2 function instances may call the…
SQL Server Transact-SQL
Sql connectionstring "Old Password" attribute not working on OLE DB Driver for SQL Server - getting error "Invalid connection string attribute"
Sql connectionstring "Old Password" attribute not working on OLE DB Driver for SQL Server - getting error "Invalid connection string attribute" We have downloaded the OLE DB diver…
SQL Server Transact-SQL
Error - FOR XML could not serialize the data for node 'NoName'
I am using FOR XML to concatenate varchar data. The data came from user input so it could have garbage characters. Getting the "Error - FOR XML Could Not Serialize the data for node NoName". Not really picky about what to do with the bad data,…
SQL Server Transact-SQL
Table locked
Good day, My colleague was using Import/Export wizard and the package got stuck. He since killed SSMS, but the table got locked somehow. We're unable to truncate it or rename it. What can be done to unlock it? Thanks in advance.
SQL Server Transact-SQL

Restore Database from .MDF and .LDF files in Sql Server 2019
Hello, We have Sql Server 2019 and we need to restore the database using .MDF and .LDF file into existing database. We have received .MDF and .LDF file from another server which is also Sql 2019 and our current server which has already database which is…
SQL Server Transact-SQL
What is the performance cost of using PIVOT in Microsoft SQL Server
I'm using PIVOT in my query, but it's resulting in high logical reads and performance degradation. Could you recommend a more optimal alternative approach.
SQL Server Transact-SQL

Can a column name used as part of a CTE be used in the SELECT query that creates the CTE?
When converting a SQL script from SQL Anywhere to SQL Server, my code generated an error for the following CTE code sample; the error says that the column name used in the ROW_NUMBER function is invalid. Any suggestions on how to fix this would be…
SQL Server Transact-SQL

How to script views by a pattern
Hi, I'm wondering if there is a simple way to script views definitions by some pattern, e.g. views in a particular schema and named using 'ndb' in the name? Thanks in advance.
SQL Server Transact-SQL
Query hang on single user database
We created a new 24 vcore SQL Azure instance and are getting hangs for 81 minutes with no timeouts on an update which previous took seconds. There is only one user and no blocking session SELECT s.login_name, DB_NAME(r.database_id) AS…
SQL Server Transact-SQL

Cannot insert Bassa Vah characters into SQL Server database
I am using SQL Server and Visual Studio 2022 for a language database, but I am unable to insert characters from this page for the Bassa Vah script (https://scriptsource.org/cms/scripts/page.php?item_id=character_list&key=16AD0). I tried NVARCHAR…
SQL Server Transact-SQL

Getting a Table Column value in Catch section while using Output clause for Update Statement
Hi Team, I am working on a SQL Server Stored Procedure which uses Output clause for Update Statement. Table getting updated is having a column name as ID. I need to put Try Catch in this SP and make sure that row which has errored, I am able to get the…