Database consistency check for 2 TB database taking 14 hours 20 mins
1)Database size is 2 TB 2)Largest Tables (only one large table) Total pages it has - 274190987 3)Execution for this single DB consistency check is 13 hours 38 minutes 23 seconds. ---most of the time we had to cancel the execution just to avoid conflicts…
Why Dynamic Sql written in procedure working and returning data on development server but not returning on production server
Why Dynamic Sql written in procedure working and returning data on development server but not returning on production server
Cannot connect to SQL Management studio 19.3
Hi Microsoft team, I have been trying to connect to the SQL server for a long time now and i have been getting error message cannot connect to.... How can i overcome this challenge?
Subquery makes complet code very slow
Hello, I have the following query that uses another query. As I understand the runtime behavior, this second query is called again every time the main query creates a new record. Both queries are actually quite fast. Unfortunately, the overall construct…
SQL Server unit test Item - Unable to locate version 17.10
Hi, I have installed Visual Code v 17.10 to start Unit testing but I'm unable to locate new item called Unit Test, Any thoughts where to locate or install to see SQL Server Unit Test item?
Best Practice/Standard Alias Schema/Table Convention
Just looking for suggestions for best practices and/or standards for table aliases in a Query. I know this is very subjective...but just looking for some general guidelines from experts and their experience and what works and what might not work. Should…
select query where condition with in operator and string with %
Hi, Below query is not working with in operator and string having % sign. DECLARE @types Table ( ID int, type varchar(50) mailtype varchar(50) ) INSERT INTO @types (ID, type, mailtype) SELECT 1, 'Redem', 'ABS_HOME' UNION SELECT 2,…
Grouping Data
Hello there, I need a help about the SQL Query. Data example: Date Amount 2024-01-11 10:15 1000 2024-01-11 11:10 2000 2024-01-12 10:16 5000 2024-01-13 11:12 4000 2024-01-13 11:18 4000 Expeceted result: Date Amount…
Azure SQL Database Stored Procedure long execution time issue
In my Azure SQL Database I have Stored Procedure sp_subledger (Attached the code : sp_subledger.txt) The Stored Procedure is completing within 1 min when Tenant = 1 is provided but when Tenant = 2 is provided it is running for more than 2 hours. for…
language of sql server 2022 and SSMS
Hello, I installed sql server 2022 and ssms in English on my machine. how to change the language to French of my sql server 2022 and my ssms. Best Regards
Where to graph precise tsql for a query run from php
I'd like to pin a plan for a query by adding a table hint. I've read the docs that says the query text pasted into @stmt must be the same as came from the app. I used the Extended Events 'sql_statement_completed' and 'rpc_completed' to get precise sql…
sql select query
Hi, We get data from vendor and import into table like this TxID BCode Ecode SType SCode Desc 12345 SR SR MF Abc This is one type 12346 SD SD MF Bcd One more type 12347 CC SD OF Efg New type 12348 SR SR MF Xyz I get…
The underlying provider failed on Open. while connecting to SQL Azure database through mvc application login
I've deployed my MVC application successfully on Azure..But while logging into application I get "The underlying provider failed on Open." I've implemented transient failure in code also. I connected my application locally to Azure SQL DB, its…
How to calculate number of weeks worked by an employee for a fiscal year in sql server
How to determine the total weeks an employee has worked during a fiscal year using SQL Server. My start date is 12-28-2023 and till today, I would like to calculate the no.of weeks worked by an employee during that time.
How can I close this Configuration review point 'Sanitize Database and Application User Input '
How we can close this configuration review point on Sanitize Database and Application User Input can you please guide me to close
From which version did SQL Server start showing the actual duplicate value in primary key violations
Dear Experts, Could you please let me know from which version did SQL Server start showing the actual duplicate values in primary key violations. Take for example, in some older versions, I only see something like this. "Violation of PRIMARY KEY…
T-SQL R language - return fewer columns
I'm running an R language script under T-SQL where I use REGEX to validate data in two columns. However I only want to output the id column in my result set. My script is: EXECUTE sp_execute_external_script @language = N'R', @script = N' pattern =…
sqlpackage export data
Is it possible to export data only of all the tables in the DB using sqlpackage export action? Schema is not to be included in the .bacpac file.
How to do the bulk insert of one lack records in sql server using node js
Hi, I will store the data in following Json format. Now I want to insert this one lack. records in sql server. Kindly Please provide the best solution and if it's possible share your solution with sql query. [ { key: value, key: value, key: value, key:…
Tempdb Shrink Issue in SQL Server
Dear Support Team, I need your consultancy regarding this issue: After shrinking the tempdb in Microsoft sql management studio the tempdb does not shrink and the disk size is not reclaimed even though the db is not being used only works after a restart…