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

Sort by: Updated
3 answers One of the answers was accepted by the question author.

Preventing Database Deletion in SSMS

prevent accidental database deletions within SQL Server Management Studio (SSMS). Currently, I am exploring options to enforce this restriction effectively implemented a DDL trigger Is the above DDL trigger approach appropriate for preventing…

SQL Server on Azure Virtual Machines
Developer technologies | Transact-SQL
Developer technologies | Transact-SQL
A Microsoft extension to the ANSI SQL language that includes procedural programming, local variables, and various support functions.
4,710 questions
SQL Server | Other
asked 2024-06-28T13:20:16.26+00:00
Niket Kumar Singh 830 Reputation points
answered 2025-10-24T13:17:36.25+00:00
Ramana Kopparapu 306 Reputation points
4 answers

MERGE Statement results in a Cannot insert duplicate key in object

So we have a MERGE Statement that looks as though it should do the INSERT on NOT MATCHED and the UPDATE on MATCHED correctly. However when processing for some reason it seems to be falling into the NOT MATCHED INSERT portion of the MERGE rather than the…

Developer technologies | Transact-SQL
Developer technologies | Transact-SQL
A Microsoft extension to the ANSI SQL language that includes procedural programming, local variables, and various support functions.
4,710 questions
asked 2022-05-11T15:17:02.74+00:00
Bobby P 231 Reputation points
commented 2025-10-23T20:44:51.4333333+00:00
Erland Sommarskog 127.4K Reputation points MVP Volunteer Moderator
2 answers

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
Developer technologies | Transact-SQL
A Microsoft extension to the ANSI SQL language that includes procedural programming, local variables, and various support functions.
4,710 questions
asked 2025-05-09T14:17:25.23+00:00
Gil Robinson 0 Reputation points
answered 2025-10-23T14:18:10.99+00:00
Ramana Kopparapu 306 Reputation points
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
Developer technologies | Transact-SQL
A Microsoft extension to the ANSI SQL language that includes procedural programming, local variables, and various support functions.
4,710 questions
asked 2021-07-19T19:05:00.413+00:00
ganeplay506 1 Reputation point
commented 2025-10-23T14:11:38.26+00:00
Ramana Kopparapu 306 Reputation points
1 answer

SSIS using Kingswaysoft

Hi Team, I want to do the On prem CRM migration from 8.1 to 9.1 where we have a 9 TB SQL data which is the big challange for us. Someone suggested to do this using Kingswaysoft tool which handles a large data migration. Could you please provide us…

Developer technologies | Transact-SQL
Developer technologies | Transact-SQL
A Microsoft extension to the ANSI SQL language that includes procedural programming, local variables, and various support functions.
4,710 questions
asked 2025-09-22T10:14:44.2133333+00:00
Sachin Joshi 0 Reputation points
edited the question 2025-10-17T13:02:41.63+00:00
Rekha 0 Reputation points Microsoft External Staff Moderator
3 answers One of the answers was accepted by the question author.

How can convert decimal value into time format as its

How can change to decimal values in to time format as it is without any change in values declare @intime decimal (10,2) = 7.50 declare @intime1 decimal (10,2) = 17.50 declare @breakhrs decimal (10,2) = .45 declare @breakhrs decimal (10,2) = 1.00 …

Developer technologies | Transact-SQL
Developer technologies | Transact-SQL
A Microsoft extension to the ANSI SQL language that includes procedural programming, local variables, and various support functions.
4,710 questions
asked 2021-02-02T16:11:12.91+00:00
Polachan Paily 226 Reputation points
edited an answer 2025-10-17T05:03:43.4933333+00:00
bruce 0 Reputation points
2 answers

sp_prepare and sp_execute vs sp_executesql

I have noticed sp_executesql also makes a single plan for a stmt when a stmt is calle in a loop. Generally plan is evicted from cache from first in first out or usage basis.so if i use sp_executesql then i should be fine in a loop in stored procedure…

Developer technologies | Transact-SQL
Developer technologies | Transact-SQL
A Microsoft extension to the ANSI SQL language that includes procedural programming, local variables, and various support functions.
4,710 questions
asked 2025-10-09T06:11:42.3533333+00:00
rajesh yadav 291 Reputation points
commented 2025-10-16T09:50:21.26+00:00
Raymond Huynh (WICLOUD CORPORATION) 2,215 Reputation points Microsoft External Staff
3 answers One of the answers was accepted by the question author.

MSDN forum directs me to here

Hello all, I go to this link: https://social.msdn.microsoft.com/Forums/en-US/home and it directs me to : https://free.blessedness.top/en-us/answers/questions/ask.html?WT.mc_id=msdnredirect-web-msdn Does anyone know what the reason is? …

Developer technologies | Transact-SQL
Developer technologies | Transact-SQL
A Microsoft extension to the ANSI SQL language that includes procedural programming, local variables, and various support functions.
4,710 questions
asked 2021-02-02T03:38:04.39+00:00
CouldsInSky 41 Reputation points
commented 2025-10-15T05:47:51.6333333+00:00
Jackson Wordan 0 Reputation points
4 answers

Looking for SQL Server 2019 Architecture Diagram

I am looking for an Architecture Diagram for SQL Server 2019. Can someone point me to a web site? I cannot find anything current.

Developer technologies | Transact-SQL
Developer technologies | Transact-SQL
A Microsoft extension to the ANSI SQL language that includes procedural programming, local variables, and various support functions.
4,710 questions
SQL Server | Other
asked 2021-02-19T01:43:00.273+00:00
LCerni 1 Reputation point
answered 2025-10-10T15:34:37.3066667+00:00
long pham 0 Reputation points
2 answers One of the answers was accepted by the question author.

Why there are null values in stop_execution_date column of msdb.dbo.sysjobactivity table

Hello, We are using below code to identify and stop running SQL Server Agent jobs. SELECT 1 FROM msdb.dbo.sysjobs_view job INNER JOIN msdb.dbo.sysjobactivity activity ON (job.job_id = activity.job_id) …

Developer technologies | Transact-SQL
Developer technologies | Transact-SQL
A Microsoft extension to the ANSI SQL language that includes procedural programming, local variables, and various support functions.
4,710 questions
SQL Server | Other
asked 2022-01-31T10:57:54.733+00:00
anil kumar 1,646 Reputation points
commented 2025-09-25T14:13:51.73+00:00
BORDIER Stephane 0 Reputation points
3 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
Developer technologies | Transact-SQL
A Microsoft extension to the ANSI SQL language that includes procedural programming, local variables, and various support functions.
4,710 questions
SQL Server | Other
asked 2021-06-30T18:09:33.473+00:00
Bryan Lee Briggs 1 Reputation point
answered 2025-09-22T13:49:49.2833333+00:00
Don Price 0 Reputation points
4 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
Developer technologies | Transact-SQL
A Microsoft extension to the ANSI SQL language that includes procedural programming, local variables, and various support functions.
4,710 questions
SQL Server | Other
asked 2021-04-26T15:18:32.48+00:00
EvansGxz 1 Reputation point
answered 2025-09-17T13:41:56.9333333+00:00
Victor Garret 0 Reputation points
4 answers One of the answers was accepted by the question author.

How to debug SP procedure from SSMS

My sql server database is Microsoft SQL Server 2017 (RTM) - 14.0.1000.169 (X64) Aug 22 2017 17:04:49 Copyright (C) 2017 Microsoft Corporation Standard Edition (64-bit) on Windows Server 2019 Standard 10.0 <X64> (Build 17763: ) i want to…

Developer technologies | Transact-SQL
Developer technologies | Transact-SQL
A Microsoft extension to the ANSI SQL language that includes procedural programming, local variables, and various support functions.
4,710 questions
SQL Server | Other
asked 2020-12-09T11:01:09.817+00:00
Sudip Bhatt 2,281 Reputation points
commented 2025-09-11T07:36:08.94+00:00
Tahir Nawaz 0 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
Developer technologies | Transact-SQL
A Microsoft extension to the ANSI SQL language that includes procedural programming, local variables, and various support functions.
4,710 questions
asked 2021-09-24T14:29:55.9+00:00
VDT-7677 171 Reputation points
commented 2025-08-24T03:55:12.63+00:00
Husayn Lipkin 0 Reputation points
3 answers One of the answers was accepted by the question author.

SQL Server: query performance

I would like to write a fast query returning the data that the following query returns: SELECT M,COmb,Mod,Loc,Initial, Final,Kms_,R,Franq,Num_Fleet,Pneus,Cli,Active,Interv, Cost1,Cost2,Name,Colab_Cod,col.colName FROM tFleetCars AS v OUTER APPLY ( …

Developer technologies | Transact-SQL
Developer technologies | Transact-SQL
A Microsoft extension to the ANSI SQL language that includes procedural programming, local variables, and various support functions.
4,710 questions
SQL Server | Other
asked 2021-11-12T11:29:35.293+00:00
JDias 161 Reputation points
commented 2025-09-03T20:50:29.1866667+00:00
Erland Sommarskog 127.4K Reputation points MVP Volunteer Moderator
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
Developer technologies | Transact-SQL
A Microsoft extension to the ANSI SQL language that includes procedural programming, local variables, and various support functions.
4,710 questions
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.

Error handler would not be running in case of sequence error

Group Because leaving my sequence name incorrect ( sqc_LogReplic_tmpx ) it would not be entering the error handling routine. And adjusting to the correct name ( sqc_LogReplic_tmp ) and the routine executing the division by 0 instruction would…

Developer technologies | Transact-SQL
Developer technologies | Transact-SQL
A Microsoft extension to the ANSI SQL language that includes procedural programming, local variables, and various support functions.
4,710 questions
SQL Server | Other
asked 2022-04-13T01:53:10.227+00:00
Claudinei Aparecido da Silva 41 Reputation points
accepted 2025-09-15T12:59:40.0733333+00:00
Claudinei Aparecido da Silva 41 Reputation points
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
Developer technologies | Transact-SQL
A Microsoft extension to the ANSI SQL language that includes procedural programming, local variables, and various support functions.
4,710 questions
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
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
Developer technologies | Transact-SQL
A Microsoft extension to the ANSI SQL language that includes procedural programming, local variables, and various support functions.
4,710 questions
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
Developer technologies | Transact-SQL
A Microsoft extension to the ANSI SQL language that includes procedural programming, local variables, and various support functions.
4,710 questions
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 127.4K Reputation points MVP Volunteer Moderator