A Microsoft extension to the ANSI SQL language that includes procedural programming, local variables, and various support functions.
4,715 questions with Developer technologies | Transact-SQL tags
How to Write a Pivot Table Query
I have this table: CREATE TABLE [dbo].[Notifications]( FullName varchar(50) NOT NULL, MessageID int NOT NULL, Sent date NOT NULL) Each "FullName" will have several rows with different MessageIDs and Sent dates. MessageID can only have…
Developer technologies | Transact-SQL
Group Transactions in Select Statement
This is a complicated one to explain. My company owns convenience stores and I am trying to track inside merchandise/fuel sales. So if a customer comes in and pays for fuel and buys merchandise in the same transaction. The screen shot I have is just…
Developer technologies | Transact-SQL
A Microsoft extension to the ANSI SQL language that includes procedural programming, local variables, and various support functions.
I want to review the code for several reports
I am researching a new report, and the reports listed below will serve as the foundation for it. To gain a thorough understanding of each report’s purpose, I would like to review the SQL behind each one, as this will provide the most comprehensive…
Developer technologies | Transact-SQL
A Microsoft extension to the ANSI SQL language that includes procedural programming, local variables, and various support functions.
Microsoft SQL Server Studio - Dark Mode
Is there any official method to use Microsoft SQL Server Management Studio Studio with Dark Mode?
Azure SQL Database
An Azure relational database service.
Developer technologies | Transact-SQL
A Microsoft extension to the ANSI SQL language that includes procedural programming, local variables, and various support functions.
Developer technologies | Visual Studio | Other
A family of Microsoft suites of integrated development tools for building applications for Windows, the web, mobile devices and many other platforms. Miscellaneous topics that do not fit into specific categories.
SQL Server | Other
How can I fix a semantic model relationship issue in Power BI?
I have two tables: Table 1: Contains a distinct Employee Code with an Active/Inactive flag for each employee. Table 2: Contains Employee Code along with the courses pursued by employees under the company’s training programs. When I try to create a…
Developer technologies | Transact-SQL
A Microsoft extension to the ANSI SQL language that includes procedural programming, local variables, and various support functions.
What is difference between composite index and cover index?
when we create index then we can mention multiple column name and that is called composite index but when we create cover index then we create index on one column and for cover index we mention other column in include function. so i like to know what…
Developer technologies | Transact-SQL
A Microsoft extension to the ANSI SQL language that includes procedural programming, local variables, and various support functions.
SQL Sorting by Non-Aggregate Field
Hello everyone and thank for the help in advance. I have a SQL Server table that tracks incoming phone calls with the phone number and time entered. I want to create a query where I can also retrieve a count of the number of times a phone called, but…
Developer technologies | Transact-SQL
A Microsoft extension to the ANSI SQL language that includes procedural programming, local variables, and various support functions.
Convert Julian dates in Normal date
How to convert Julian date column in normal date like colum contains 12490,12492 Julian dates
Azure SQL Database
An Azure relational database service.
SQL Server Integration Services
A Microsoft platform for building enterprise-level data integration and data transformations solutions.
Developer technologies | Transact-SQL
A Microsoft extension to the ANSI SQL language that includes procedural programming, local variables, and various support functions.
SQL Server | Other
Invalid object name 'STRING_SPLIT' in SQL Server 2019
Hi Support, Our SQL server version is 2019 and check the compatibility level is 150, but it still have error "Invalid object name 'STRING_SPLIT' ". We also tried the case sensitive according to this link, both of them have the same error. …
Developer technologies | Transact-SQL
A Microsoft extension to the ANSI SQL language that includes procedural programming, local variables, and various support functions.
SQL Server | Other
Add Headers To BCP Export
I am using SQL Server 2016, and I am exporting data using BCP. I need the headers exported as well. I saw an example where I could do bcp "Select ''Field1'', ''Field2'', ''Field3'' UNION ALL Select CHAR(34) + Convert(varchar(10), field1,…
Developer technologies | Transact-SQL
A Microsoft extension to the ANSI SQL language that includes procedural programming, local variables, and various support functions.
fast farward curson vs while loop on @table
hi, need to known weather fast farwand cursor is faster than a while loop made on @table variable haveing less than 15 rows that means 15 iteration. pls tell me which one is faster.
Developer technologies | Transact-SQL
A Microsoft extension to the ANSI SQL language that includes procedural programming, local variables, and various support functions.
Export data from Excel to MS SQL Server
Hi, We have an excel that stores data in it. Some forms are created inside it that are not tabular in structure. So we can consider excel sheets act as individual pages as in any website. now we need to pull data from excel into database. I…
Microsoft 365 and Office | Development | Other
Building custom solutions that extend, automate, and integrate Microsoft 365 apps.
Microsoft 365 and Office | Excel | For business | Windows
A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data
Developer technologies | Transact-SQL
A Microsoft extension to the ANSI SQL language that includes procedural programming, local variables, and various support functions.
SQL Server | Other
How to trap errors in Agent Job execution
I have an agent job with several steps, each step executing a stored proc. A few times each year, when a step EXEC takes place, there's no response, the proc doesn't run at all, and the step quits upon failure. I have error checking in the proc, but I…
Developer technologies | Transact-SQL
A Microsoft extension to the ANSI SQL language that includes procedural programming, local variables, and various support functions.
Convert 14 Char String to Datetime
I have a field in a table called TraceID that stores data like this: 2024040611102200021 The first 8 characters represent the date (YYYYMMDD). The next 6 characters represent the time (HHMMSS). The last five are insignificant numbers. So this would be…
Developer technologies | Transact-SQL
A Microsoft extension to the ANSI SQL language that includes procedural programming, local variables, and various support functions.
SQL Server | Other
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
An Azure service that is used to provision Windows and Linux virtual machines.
Developer technologies | Transact-SQL
A Microsoft extension to the ANSI SQL language that includes procedural programming, local variables, and various support functions.
SQL Server | Other
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
A Microsoft extension to the ANSI SQL language that includes procedural programming, local variables, and various support functions.
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
A Microsoft extension to the ANSI SQL language that includes procedural programming, local variables, and various support functions.
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
A Microsoft extension to the ANSI SQL language that includes procedural programming, local variables, and various support functions.
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
A Microsoft extension to the ANSI SQL language that includes procedural programming, local variables, and various support functions.
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
A Microsoft extension to the ANSI SQL language that includes procedural programming, local variables, and various support functions.