4,707 questions with Developer technologies | Transact-SQL tags

Sort by: Updated
5 answers

How to call multiple Store Procedures in parallel in MS SQL

Hi All, I have 3 store procedures in MSSQL DB. EXEC sp_test_1 (ID) GO EXEC sp_test_2 (ID) GO EXEC sp_test_3 (ID) GO When I execute each store procedure is taking 15 minutes to complete and total of 45 minutes. When I…

Developer technologies Transact-SQL
SQL Server Other
asked 2021-02-18T08:19:12.547+00:00
varaprasadmohan pinagadi 1 Reputation point
commented 2025-06-26T15:55:40.9966667+00:00
ben mosk 41 Reputation points
2 answers One of the answers was accepted by the question author.

Grant access only to a Schema in SQL

Hi All, I have a Database called TM1 and in this database I have 2 schemas. One is called TMS1 and another is called TM1App. There are 5 views under schema TMS1. For Example: TMS1 .View1, TMS1 .View2....TMS1 .View5. These views are reading data from…

Developer technologies Transact-SQL
asked 2020-10-08T00:51:08.743+00:00
Shivendoo Kumar 751 Reputation points
commented 2025-06-19T09:46:58.8566667+00:00
Erik Haase 0 Reputation points
2 answers

How to Get SQL Logs (UPDATE, INSERT and DELETE)of Specific Table from SQL Server if Query run from Website.

Hi, How to Get SQL Logs (UPDATE, INSERT and DELETE)of Specific Table from SQL Server if Query run from Website. Please Help

SQL Server Reporting Services
SQL Server Reporting Services
A SQL Server technology that supports the creation, management, and delivery of both traditional, paper-oriented reports and interactive, web-based reports.
3,061 questions
SQL Server Analysis Services
SQL Server Analysis Services
A Microsoft online analytical data engine used in decision support and business analytics, providing the analytical data for business reports and client applications such as Power BI, Excel, Reporting Services reports, and other data visualization tools.
1,344 questions
Developer technologies Transact-SQL
SQL Server Other
asked 2022-03-17T05:24:08.337+00:00
Faizan Ahmed 1 Reputation point
commented 2025-06-12T11:57:38.4266667+00:00
Ilya 0 Reputation points
9 answers One of the answers was accepted by the question author.

Can you recommend a sql formatter?

Dear colleagues, Which SQL formatter would you recommend? In our organization, we have coding standards. My problem is, there are to many of them. As I am responsible for the repositories containing SQL, I want to enforce a single standard by…

Developer technologies Transact-SQL
SQL Server Other
asked 2020-11-17T14:17:45.18+00:00
Chris Sijtsma 106 Reputation points
answered 2025-06-12T08:53:11.8266667+00:00
Don Price 0 Reputation points
3 answers

Text and NVARCHAR are incompatible

Hi, I am trying to join 2 tables together but once column is a text, and the other nvarchar and as a result, I get the following error message Msg 402, Level 16, State 1, Line 101 The data types text and nvarchar are incompatible in the equal to…

Developer technologies Transact-SQL
SQL Server Other
asked 2021-11-03T09:36:37.253+00:00
Bone_12 361 Reputation points
answered 2025-06-06T16:29:53.77+00:00
Bruce (SqlWork.com) 77,686 Reputation points Volunteer Moderator
4 answers

Best Practice to Decide Partition Table in SQL Server

Hi All, We have a database on SQL server with a large size (about 20 TB) and we plan to partition the existing tables in the database. but we are still confused to determine whether to partition the table, whether it should be partitioned…

SQL Server Analysis Services
SQL Server Analysis Services
A Microsoft online analytical data engine used in decision support and business analytics, providing the analytical data for business reports and client applications such as Power BI, Excel, Reporting Services reports, and other data visualization tools.
1,344 questions
Developer technologies Transact-SQL
SQL Server Other
asked 2022-10-13T03:39:13.957+00:00
Arief Hardiansyah 51 Reputation points
commented 2025-06-04T20:30:39.26+00:00
Erland Sommarskog 121.4K Reputation points MVP Volunteer Moderator
1 answer

How to delete Old database backup files from Azure blob container through Using T-SQL script without using any Azure CLI and PowerShell commands.

Here is the corrected version of your sentence: We are facing an issue with deleting old backup files from the Azure Blob container. Our company is not willing to spend money on this deletion activity. Please let me know how to delete old database…

Developer technologies Transact-SQL
asked 2025-06-03T10:07:37.5933333+00:00
Srinivas Naraipeddi 40 Reputation points
answered 2025-06-03T21:05:15.9966667+00:00
Erland Sommarskog 121.4K Reputation points MVP Volunteer Moderator
3 answers

how to calculate age from date of birth

im required to come up with a script for a solution where you need both peoples date of birth, and age, when registering them its clearly stated that the person wont be asked to input their age, just their dob. but the age is needed what needs to be…

Developer technologies Transact-SQL
asked 2021-07-19T19:05:00.413+00:00
ganeplay506 1 Reputation point
commented 2025-06-01T13:09:11.73+00:00
CrisP 0 Reputation points
0 answers

iNLINE PIVOT QUERY SYNTAX ERROR

a PIVOT query runs without error on its own but gets a syntax query when made into an inline query

Developer technologies Transact-SQL
asked 2025-05-20T19:01:28.2766667+00:00
Canaday, Susan L 0 Reputation points
commented 2025-05-21T13:58:53.9066667+00:00
Canaday, Susan L 0 Reputation points
8 answers

Unable to open the physical file. Operating system error 5: “5(Access is denied.)”

I am trying to work on a query to attach a database (UNC path) remotely. I have SQL Server management studio (SSMS) installed in SQL Server machine (machineSQL) and also in another machine (machineRemote) in same domain. Query:: CREATE DATABASE…

Developer technologies Transact-SQL
SQL Server Other
asked 2020-09-24T01:18:45.57+00:00
Nishant Kumar 1 Reputation point
answered 2025-05-17T18:42:24.1733333+00:00
Bruce (SqlWork.com) 77,686 Reputation points Volunteer Moderator
3 answers

SQL server. Updated data is lost and reverted back to the past data

SQL SERVER. I have a database that works fine and saves the update of the data and i see that data updated, but after a possible week or month, I find that the data returns to its original position before the modification and the modification completely…

Developer technologies Transact-SQL
SQL Server Other
asked 2022-02-10T12:30:52.267+00:00
basel khalil 1 Reputation point
commented 2025-05-12T12:39:54.12+00:00
Panduranga Javalageri 0 Reputation points
1 answer

can the ROW_NUMBER() function be used without the PARTITION clause?

I'd like to get row numbers for my output without having to use ROW_NUMBER() OVER(PARTITION BY ...). Is this possible, and can you provide an example?

Developer technologies Transact-SQL
asked 2025-05-09T14:17:25.23+00:00
Gil Robinson 0 Reputation points
edited an answer 2025-05-09T15:23:10.28+00:00
Viorel 122.5K Reputation points
1 answer

Last passoword updated/changed date and time in Azure SQL Database for sql logins

Hi Team, as part of compliance we are planning to generate report about when was the last time password changed/updated on all Azure sql database sql logins. Because each a every Azure SQL databases we found around 150 logins. Please provide any T-SQL

Developer technologies Transact-SQL
asked 2025-04-22T23:04:14.5866667+00:00
Vijay Kumar 2,036 Reputation points
answered 2025-05-08T15:25:31.4333333+00:00
Naveen Kumar M 175 Reputation points
2 answers One of the answers was accepted by the question author.

How to Delete top 1 item after using CTE (Common Table Expression)

I am trying to delete top 1* item after using CTE. I have the bottom T-SQL statement which works fine with select statement on the second part. with cte as ( select *, email_cnt = count(*) over (partition by "User"), …

Developer technologies Transact-SQL
asked 2025-04-15T19:23:50.7666667+00:00
King Java 790 Reputation points
answered 2025-05-07T20:59:30.2666667+00:00
Erland Sommarskog 121.4K Reputation points MVP Volunteer Moderator
2 answers

sql query to recon data between 2 systems

--SQL query for getting data from 2 vendor systems   --Hi All, --I get data from 2 vendor systems. I need to reconcile this data and match. I have very limited fields to compare   DECLARE @vendor1 TABLE                 (                                …

Developer technologies Transact-SQL
asked 2025-04-16T16:21:05.32+00:00
Spunny 366 Reputation points
commented 2025-05-07T20:55:28.8966667+00:00
Erland Sommarskog 121.4K Reputation points MVP Volunteer Moderator
3 answers One of the answers was accepted by the question author.

Stored procedure not sending out emails using sp_send_dbmail

Greetings again mates, The following stored proc performs several different tasks at once. At the top of the SP, the SELECT statement queries two tables (Employees and AuthorizedUsers) to pull names and email addresses of employees based on some WHERE…

Developer technologies Transact-SQL
SQL Server Other
asked 2023-11-04T16:50:41.1533333+00:00
Simflex 321 Reputation points
accepted 2025-04-29T00:07:22.98+00:00
Simflex 321 Reputation points
1 answer

XTP_THREAD_POOL- lot of spids running in background when no sql workload is there.

In our L&P systems, before the actual run kickoffs we have a SOP to run rebuild indices and update statistics job. Recently we are seeing SQL memory consumption is great than 80 % even after the above jobs get completed and there is no SQL workload…

Developer technologies Transact-SQL
SQL Server Other
asked 2021-07-09T04:26:29.84+00:00
Sreeni G 1 Reputation point
commented 2025-04-25T09:03:28.1566667+00:00
Ilya 0 Reputation points
2 answers

SQL Server Update particular record in a table

DROP TABLE if exists #test create table #test ( PID int, Category varchar(100), status varchar(10) ) Insert into #test values (123,'Lessthan8','compliant'), (123,'greatherthan8','compliant'), (456,'Lessthan8','Missing'), …

Developer technologies Transact-SQL
asked 2025-04-23T19:43:53.2666667+00:00
kalyan Dhanekula 0 Reputation points
commented 2025-04-23T21:09:36.54+00:00
kalyan Dhanekula 0 Reputation points
5 answers One of the answers was accepted by the question author.

cast float to numeric

Hi! I import transactions from a table where the amount column is set to Float and some values in the column is scientific numbers (example below). I need to Cast the float column to decimal values but i cant find any solution on how to do that. Is…

Developer technologies Transact-SQL
asked 2022-05-02T09:29:02.477+00:00
Olsson Arne 81 Reputation points
commented 2025-04-22T17:35:23.5266667+00:00
Efigenia Parmer 0 Reputation points
1 answer

Group By and it's Highest Value using SQL Query

In the table below, how do I group by Unit and then get the highest value from Quantity of that group? I have put 21 in row 4 under HighestValue column since its the highest value among all records in Unit

Developer technologies Transact-SQL
asked 2025-04-16T17:41:44.86+00:00
Malam Malam 266 Reputation points
answered 2025-04-17T14:04:36.3633333+00:00
Viorel 122.5K Reputation points