4,606 questions with Transact-SQL-related tags

Sort by: Updated
2 answers

is there a describe or show function in SQL server 2022?

Is there a description or show function in SQL server 2022? Or a similar way to do this?

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
13,393 questions
SQL Server Transact-SQL
SQL Server Transact-SQL
SQL Server: A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.Transact-SQL: A Microsoft extension to the ANSI SQL language that includes procedural programming, local variables, and various support functions.
73 questions
Transact-SQL
Transact-SQL
A Microsoft extension to the ANSI SQL language that includes procedural programming, local variables, and various support functions.
4,606 questions
asked 2024-07-31T14:11:12.9533333+00:00
Jonathan Brotto 220 Reputation points
answered 2024-07-31T18:53:08.6433333+00:00
Zahid Butt 871 Reputation points
2 answers

Could two queries share the same parameter/variable?

Could two queries share the same parameter/variable?

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
13,393 questions
SQL Server Transact-SQL
SQL Server Transact-SQL
SQL Server: A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.Transact-SQL: A Microsoft extension to the ANSI SQL language that includes procedural programming, local variables, and various support functions.
73 questions
Transact-SQL
Transact-SQL
A Microsoft extension to the ANSI SQL language that includes procedural programming, local variables, and various support functions.
4,606 questions
asked 2024-07-30T20:19:21.79+00:00
Jonathan Brotto 220 Reputation points
commented 2024-07-31T17:33:23.69+00:00
Jonathan Brotto 220 Reputation points
1 answer

more number of rows in database

HI, How to get view which has more number of rows in to it in sql server database

Azure SQL Database
SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
13,393 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,265 questions
Transact-SQL
Transact-SQL
A Microsoft extension to the ANSI SQL language that includes procedural programming, local variables, and various support functions.
4,606 questions
asked 2024-07-31T11:56:17.3+00:00
Vineet S 445 Reputation points
commented 2024-07-31T15:30:45.6166667+00:00
Zahid Butt 871 Reputation points
1 answer

JSON function JSON_VALUE returns invalid json for a string

Given a json object: DECLARE @jsonObject NVARCHAR(MAX) = ' { "name": "John Doe", "age": 30, "address": { "city": "New York", "state": "NY" }, …

Transact-SQL
Transact-SQL
A Microsoft extension to the ANSI SQL language that includes procedural programming, local variables, and various support functions.
4,606 questions
asked 2024-07-29T17:37:09.2+00:00
Mansa 20 Reputation points
edited a comment 2024-07-30T02:59:10.5366667+00:00
Mansa 20 Reputation points
1 answer

TSQL returning the wrong calculation results

I'm very confused. I've been working on this for hours. I have a query: set @interest = @balance * power(1.0 + @curIrate / 365.0,@days) - @balance select @checkDate checkDate, @interest interest, @balance balance, @curIrate curIrate, @days days The…

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
13,393 questions
Transact-SQL
Transact-SQL
A Microsoft extension to the ANSI SQL language that includes procedural programming, local variables, and various support functions.
4,606 questions
asked 2024-07-29T22:30:04.77+00:00
OHPRS Admin 211 Reputation points
edited the question 2024-07-30T00:57:02.3466667+00:00
LiHongMSFT-4306 25,726 Reputation points
1 answer One of the answers was accepted by the question author.

Custom Job schedule - every first Friday after 15 of the month - is it possible?

Good morning, Is it possible to create a job that runs only on first Friday after 15th of each month? I'm trying the following but the option seems to imply it would run every 15th month, not on the first Friday after day 15th:

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
13,393 questions
Transact-SQL
Transact-SQL
A Microsoft extension to the ANSI SQL language that includes procedural programming, local variables, and various support functions.
4,606 questions
asked 2024-07-26T14:05:25.8166667+00:00
Naomi Nosonovsky 545 Reputation points
accepted 2024-07-26T18:33:32.51+00:00
Naomi Nosonovsky 545 Reputation points
3 answers One of the answers was accepted by the question author.

Temp file not shrinking

I have a temp DB file that is not shrinking. Temp DB has 6 mdf files but one is large and not shrinking after multiple attempts. Any idea on how to resolve this? Thanks

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
13,393 questions
Transact-SQL
Transact-SQL
A Microsoft extension to the ANSI SQL language that includes procedural programming, local variables, and various support functions.
4,606 questions
asked 2024-07-22T17:55:17.6866667+00:00
Babawale Dawodu 110 Reputation points
accepted 2024-07-26T08:22:56.3566667+00:00
Babawale Dawodu 110 Reputation points
4 answers

SQL Statement taking long to execute

I have two SQL Databases that is on the same SQL server but on one database it only takes 4 seconds to complete the SQL statement but on the other SQL database it takes 25 minutes to complete. Both databases uses the same SQL elastic pool and I don't see…

Azure SQL Database
SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
13,393 questions
SQL Server Transact-SQL
SQL Server Transact-SQL
SQL Server: A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.Transact-SQL: A Microsoft extension to the ANSI SQL language that includes procedural programming, local variables, and various support functions.
73 questions
Transact-SQL
Transact-SQL
A Microsoft extension to the ANSI SQL language that includes procedural programming, local variables, and various support functions.
4,606 questions
asked 2024-07-15T03:15:50.06+00:00
WingHong Shiu 5 Reputation points
commented 2024-07-26T08:19:06.6866667+00:00
Erland Sommarskog 107.4K Reputation points MVP
1 answer

How to create 12-months projection query in SQL

Hi Team, Have requirement as bellow, need to write query to get next 12 months projection data include current month. Could you please help me. Please find-out bellow example input outputs. SQL QUERY: CREATE TABLE [dbo].[Projection]( [YearMonth]…

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
13,393 questions
Transact-SQL
Transact-SQL
A Microsoft extension to the ANSI SQL language that includes procedural programming, local variables, and various support functions.
4,606 questions
asked 2024-07-25T02:42:36.0533333+00:00
Bala Narasimha Challa 466 Reputation points
commented 2024-07-25T10:53:40.34+00:00
Viorel 115.2K Reputation points
1 answer

Transaction replication is getting failed for creating snapshot with message as "Prefetch objects failed for Database"

This issue "Message: Prefetch objects failed for Database " has been happening everytime I run the snapshot after 96% completed I was getting this issue (I need to wait for 5 hours for this). What ever .bcp files got created in storage account…

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
13,393 questions
Transact-SQL
Transact-SQL
A Microsoft extension to the ANSI SQL language that includes procedural programming, local variables, and various support functions.
4,606 questions
asked 2024-07-12T11:33:24.7133333+00:00
Ravi Padakanti 0 Reputation points
commented 2024-07-25T02:16:57.1333333+00:00
LucyChenMSFT-4874 3,470 Reputation points
3 answers

Error the datediff function resulted in an overflow. The number of dateparts separating two date/time instances is too large.

i work on sql server 2019 i face issue when run query to get queries run on server i get error Msg 535, Level 16, State 0, Line 1 The datediff function resulted in an overflow. The number of dateparts separating two date/time instances is too…

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
13,393 questions
Transact-SQL
Transact-SQL
A Microsoft extension to the ANSI SQL language that includes procedural programming, local variables, and various support functions.
4,606 questions
asked 2022-03-02T16:17:16.63+00:00
ahmed salah 3,216 Reputation points
commented 2024-07-23T18:43:32.7033333+00:00
Karnvir Moudgill 0 Reputation points
1 answer One of the answers was accepted by the question author.

How to figure out the total number of doses within a time span given to a client as dose are being added and stopped.?

If the cadence values are different, even if the dates overlap the records must be separate. If an order for the same dose and cadence value (including nulls) starts on the same day or the next day (+or-1 day) the record should continue. outlook of…

Azure SQL Database
SQL Server Transact-SQL
SQL Server Transact-SQL
SQL Server: A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.Transact-SQL: A Microsoft extension to the ANSI SQL language that includes procedural programming, local variables, and various support functions.
73 questions
Transact-SQL
Transact-SQL
A Microsoft extension to the ANSI SQL language that includes procedural programming, local variables, and various support functions.
4,606 questions
SQL Server Training
SQL Server Training
SQL Server: A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.Training: Instruction to develop new skills.
11 questions
asked 2024-07-22T22:24:04.8633333+00:00
andrew omofonma 61 Reputation points
accepted 2024-07-23T17:36:56.54+00:00
andrew omofonma 61 Reputation points
2 answers

unable to convert unique identifier

Hi Team, unable to convert this value as an unique identifier and getting null values SELECT try_convert(uniqueidentifier,''9UIC32D1-932-4V03-45E9-FGSGDASASDATY'')testid

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
13,393 questions
SQL Server Integration Services
SQL Server Integration Services
A Microsoft platform for building enterprise-level data integration and data transformations solutions.
2,532 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,265 questions
Transact-SQL
Transact-SQL
A Microsoft extension to the ANSI SQL language that includes procedural programming, local variables, and various support functions.
4,606 questions
asked 2024-06-12T07:17:37.1633333+00:00
Vineet S 445 Reputation points
edited the question 2024-07-18T08:49:02.3533333+00:00
ShaktiSingh-MSFT 14,491 Reputation points Microsoft Employee
1 answer One of the answers was accepted by the question author.

left and right join

Hi, table 1 Table 2 select A.* from table1a LEFT join table2 b on a.col1=b.col1 output: which is correct but on right join it shows above results how to calculate this join and how it will react on NULL and blank

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
13,393 questions
SQL Server Integration Services
SQL Server Integration Services
A Microsoft platform for building enterprise-level data integration and data transformations solutions.
2,532 questions
Transact-SQL
Transact-SQL
A Microsoft extension to the ANSI SQL language that includes procedural programming, local variables, and various support functions.
4,606 questions
asked 2024-06-23T11:34:41.0833333+00:00
Vineet S 445 Reputation points
edited the question 2024-07-18T07:23:47.01+00:00
ShaktiSingh-MSFT 14,491 Reputation points Microsoft Employee
2 answers One of the answers was accepted by the question author.

Select alternate rows basis on pattern.

I have a table like below I want the result like below Please help on this. Thanks in advance.

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
13,393 questions
Transact-SQL
Transact-SQL
A Microsoft extension to the ANSI SQL language that includes procedural programming, local variables, and various support functions.
4,606 questions
asked 2024-07-01T12:00:38.2466667+00:00
sourav dutta 231 Reputation points
edited the question 2024-07-15T00:59:58.8533333+00:00
LiHongMSFT-4306 25,726 Reputation points
2 answers One of the answers was accepted by the question author.

SQL with bunch of or clauses

Trying to get the result with a bunch of or clauses. SELECT * FROM SA15B WHERE PoNo In…

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
13,393 questions
Transact-SQL
Transact-SQL
A Microsoft extension to the ANSI SQL language that includes procedural programming, local variables, and various support functions.
4,606 questions
asked 2024-07-12T14:10:10.2066667+00:00
Jonathan Brotto 220 Reputation points
commented 2024-07-12T14:40:33.5066667+00:00
Olaf Helper 43,411 Reputation points
2 answers

SSIS : Decimal Places not loading from Excel Source to SQL table

Hi Team - I have an excel file with few columns but the issue is with one of the column, Lets say Column A. Column A : FY20 Work Extra Feb 4 4,401,0089 3,81,68182.01 27,381.59 - 42590062.77 99.8% Few of the numeric values above are rounding off in…

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
13,393 questions
SQL Server Integration Services
SQL Server Integration Services
A Microsoft platform for building enterprise-level data integration and data transformations solutions.
2,532 questions
SQL Server Transact-SQL
SQL Server Transact-SQL
SQL Server: A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.Transact-SQL: A Microsoft extension to the ANSI SQL language that includes procedural programming, local variables, and various support functions.
73 questions
Transact-SQL
Transact-SQL
A Microsoft extension to the ANSI SQL language that includes procedural programming, local variables, and various support functions.
4,606 questions
asked 2024-07-12T04:39:32.5766667+00:00
kkran 831 Reputation points
answered 2024-07-12T09:00:49.7366667+00:00
ZoeHui-MSFT 35,556 Reputation points
2 answers

updare dateid in table

HI, Hw to update date datatype into integer column to varchar column create table table1(dateid date,dateid1 int,dateid2 varchar(23) ) dateid --------------------- dateid1 -------------dateid2 2024-01-01…

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
13,393 questions
SQL Server Integration Services
SQL Server Integration Services
A Microsoft platform for building enterprise-level data integration and data transformations solutions.
2,532 questions
Transact-SQL
Transact-SQL
A Microsoft extension to the ANSI SQL language that includes procedural programming, local variables, and various support functions.
4,606 questions
asked 2024-07-10T18:59:02.5066667+00:00
RUPESH SHELAR 0 Reputation points
commented 2024-07-12T02:02:29.6333333+00:00
LiHongMSFT-4306 25,726 Reputation points
1 answer

email not been send to all in the ssrs report subscription

HI there I have a very bizarre situation in production environment of my work space where not all of the emails are been sent when the ssrs report is been published to go out. For example i have three emails(not real emails) like…

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.
2,883 questions
Transact-SQL
Transact-SQL
A Microsoft extension to the ANSI SQL language that includes procedural programming, local variables, and various support functions.
4,606 questions
asked 2021-05-26T09:46:56.46+00:00
Farhan Jamil 421 Reputation points
commented 2024-07-11T05:35:03.8966667+00:00
Radhai Krish 191 Reputation points
2 answers

Error while installing SQL Server 2022(Express Edition)

Kindly need help with SQL 2022 installation process. This is my summary.txt file, Overall summary: Final result: Failed: see details below Exit code (Decimal): -2068774911 Exit facility code: …

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
13,393 questions
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.
2,883 questions
Transact-SQL
Transact-SQL
A Microsoft extension to the ANSI SQL language that includes procedural programming, local variables, and various support functions.
4,606 questions
asked 2022-12-19T06:24:16.09+00:00
Mohd Azam Ikhwal Bin Azmi 6 Reputation points
answered 2024-07-10T12:15:29.9633333+00:00
Ijaz Muhammad 81 Reputation points