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

Sort by: Updated
5 answers

Performance of View with where clause

I have a table say employee(employeeid,employeename,salary,dateofbirth) which has around 1M+ records.. now i have created a view as below (i) create view vw_emp as select * from employee my question is:- what is the impact of performance if i…

Developer technologies | Transact-SQL
asked 2022-03-26T16:33:44.827+00:00
Chitra Swaroop 1 Reputation point
commented 2025-08-27T22:06:41.2066667+00:00
Jeff Moden 11 Reputation points
4 answers One of the answers was accepted by the question author.

Calculating Elapsed Time From Start & End Time

Hi, Running SQL Server 2008 R2. I have the following sample table: CREATE TABLE [dbo].[Test] ( [Test_ID] [int] NOT NULL, [Start_Time] [char](5) NULL, [End_Time] [char](5) NULL, [Elapsed_Time] [char](5) NULL, CONSTRAINT …

Developer technologies | Transact-SQL
asked 2021-09-24T14:29:55.9+00:00
VDT-7677 161 Reputation points
commented 2025-08-24T03:55:12.63+00:00
Husayn Lipkin 0 Reputation points
3 answers

Transaction Log Cannot Be Truncated After Memory-Optimized Filegroup Removal

Hello there, One of our clients is facing an issue with a database where the memory-optimized filegroup was forcibly removed using DBCC CHECKDB (test, REPAIR_ALLOW_DATA_LOSS). The database remains functional, but the transaction log continues to grow and…

Developer technologies | Transact-SQL
SQL Server | Other
asked 2025-02-11T04:59:42.99+00:00
kedar giri 81 Reputation points
edited a comment 2025-08-20T16:59:28.3766667+00:00
Palm Plumb 0 Reputation points
2 answers

unable to import data into SSMS

HI Team, Am unable to import data into SSMS from network location. ERROR: TITLE: SQL Server Import and Export Wizard The operation could not be completed. ADDITIONAL INFORMATION: The 'Microsoft.ACE.OLEDB.16.0' provider is not registered on the local…

Developer technologies | Transact-SQL
asked 2025-08-12T12:47:34.66+00:00
Damodara Kuntrapaku 0 Reputation points
answered 2025-08-12T21:31:59.9166667+00:00
Erland Sommarskog 124.9K Reputation points MVP Volunteer Moderator
6 answers

which is best for performance filtering on where or filtering on join ?

I work on sql server 2019 i don't know which is best for performance filtering on where condition or filtering on join with another meaning which is best first query select A.* from A inner join B on A.ID=B.ID INNER JOIN C ON C.ID=B.ID …

Developer technologies | Transact-SQL
SQL Server | Other
asked 2022-07-28T07:09:10.783+00:00
ahmed salah 3,216 Reputation points
commented 2025-08-01T15:18:50.57+00:00
Mark Ferguson 0 Reputation points
13 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
commented 2025-07-30T10:39:50.1066667+00:00
peter R 0 Reputation points
2 answers

Stored Procedure not executing as SQL Agent Job

I have a stored procedure (1) that updates JSON data (via JSON_Modify()) in an auditing table to replace raw binary with a short string 'Binary column data.'. This stored procedure functions when executed in SSMS, but when I try to have a SQL Agent Job…

Developer technologies | Transact-SQL
SQL Server | Other
asked 2021-06-30T18:09:33.473+00:00
Bryan Lee Briggs 1 Reputation point
commented 2025-07-27T21:54:14.65+00:00
Ed Morcos 0 Reputation points
4 answers One of the answers was accepted by the question author.

To identify the performance of sqlserver between 1 month of different years.

Hi, How can I identify the performance load of SQL Server between 2 period of different years, Any script to calculate the I/O load and performance of SQL Server. I s there any tools to identify the performance and I/O load on SQL Server between 2…

Developer technologies | Transact-SQL
SQL Server | Other
asked 2022-07-06T18:54:16.927+00:00
SVA 121 Reputation points
answered 2025-07-24T13:52:25.77+00:00
Don Price 0 Reputation points
8 answers One of the answers was accepted by the question author.

Pull values to the Left of a dash

I am trying to pull from a field called "Location" that includes a number of varying lengths after a dash. I only want to pull the value of the field before the dash. My expression below worked with the LTRIM to pull values after the dash but…

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,076 questions
Microsoft 365 and Office | Excel | For business | Windows
Developer technologies | Transact-SQL
asked 2021-05-25T02:32:50.59+00:00
Evan Stroum 21 Reputation points
answered 2025-07-22T04:16:29.9233333+00:00
Ashish Mathur 99,595 Reputation points Volunteer Moderator
4 answers

What are the advantages always square brackets sql server objects inside procedure

Hi What are the advantages always square brackets sql server objects inside procedure? --proc format 01 CREATE [schema].[Proc_getdata01] AS BEGIN SELECT [column01],[column01] FROM [schema].[table] WHERE [column03]='01'; END GO --proc format…

Developer technologies | Transact-SQL
SQL Server | Other
asked 2021-05-29T11:10:26.877+00:00
Tharindu Dhaneenja 1 Reputation point
commented 2025-07-18T15:28:18.41+00:00
Todd Moyer 0 Reputation points
3 answers

IF EXIST UPDATE, IF NOT EXIST INSERT

Hi, i want to know how update a row if exist and if don't exist insert a new row Example:

Developer technologies | Transact-SQL
SQL Server | Other
asked 2021-04-26T15:18:32.48+00:00
EvansGxz 1 Reputation point
edited an answer 2025-07-17T14:14:47.44+00:00
Vadim Rapp 0 Reputation points
2 answers One of the answers was accepted by the question author.

Getting this error: Msg 3609, Level 16, State 1, Line 88 The transaction ended in the trigger. The batch has been aborted.

So I'm trying an exercise Trigger Code that would send an email if someone tries to insert into the adventure database a special offer that is equal to or greater than 80%, My Code goes Like this: ----------------------- The…

Developer technologies | Transact-SQL
SQL Server | Other
asked 2021-12-11T12:01:56.03+00:00
salma dodin 96 Reputation points
commented 2025-07-09T16:47:40.3333333+00:00
Niarchos Ioannis 0 Reputation points
2 answers

BACKUP LOG Write Fail to Azure Storage

Hello, We have a SQL VM running out of Azure with SQL Agent jobs running BACKUP LOG every x hours to Azure Blob. These jobs have been running fine for a long time until recently. We keep getting the below error and these jobs fail intermittently for…

SQL Server on Azure Virtual Machines
Azure Storage
Azure Storage
Globally unique resources that provide access to data management services and serve as the parent namespace for the services.
3,606 questions
Developer technologies | Transact-SQL
SQL Server | Other
asked 2022-06-13T18:07:29.267+00:00
sidney l 21 Reputation points
answered 2025-07-02T21:20:53.65+00:00
Andy Soushek 0 Reputation points
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,076 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,349 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
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) 79,526 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,349 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 124.9K 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 124.9K 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