Viewing 15 posts - 1 through 15 (of 1,311 total)
The FORMAT function return type is NVARCHAR , which is a string.
https://docs.microsoft.com/en-us/sql/t-sql/functions/format-transact-sql?view=sql-server-ver16
You can get the same result by replacing FORMAT with
CONVERT(varchar(10), [YourDateField], 120)
June 22, 2022 at 7:52 am
SQL does not have a Year-Month only data type
June 20, 2022 at 10:25 am
Working purely with the data that you provided, and getting totals by Match_Id, TeamId, isServe, and CtTeamWinRally you can quickly calculate what the expected values are
SELECT td.Match_Id,...
June 10, 2022 at 12:11 pm
There is nothing in your table that links those records together (Like CustomerID).
Create some sample data
CREATE TABLE #SLA (
CustomerID int
,...
June 9, 2022 at 1:30 pm
Looks like you have too many quotes.
Try replacing all your '''' with ''.
Also use PRINT(@SQL) to check your D-Sql
June 8, 2022 at 5:09 pm
You may want to take a look at the following 2 articles
https://qa.sqlservercentral.com/articles/cross-tabs-and-pivots-part-2-dynamic-cross-tabs
In the meantime, when posting a question, please help us to help you. Give us...
June 7, 2022 at 1:23 pm
You can do something like this for the dynamic SQL
DECLARE @SQL nvarchar(MAX);
IF OBJECT_ID(N'dbo.tblDoesntExist', N'U') IS NULL
BEGIN
-- TABLE does not exist
SET @SQL = N'
...
June 7, 2022 at 11:08 am
I would create an iTVF to search a string for the starting positions of a keyword
CREATE FUNCTION dbo.GetAllStartingPositions (
@String varchar(8000)
,...
May 27, 2022 at 2:38 pm
@Jeff Moden
I have a fiber outage at the moment, so was unable to catch your Group By session on GUIDS V.S. FRAGMENTATION last night.
Is there perhaps a recording...
May 26, 2022 at 6:21 am
@jeff Moden
I have a fiber outage at the moment, so was unable to catch your Group By session on GUIDS V.S. FRAGMENTATION last night.
Is there perhaps a recording...
May 25, 2022 at 5:39 am
The queries would look something like this
SELECT TOP ( 10 )
...
May 24, 2022 at 12:02 pm
Try taking a look at theses 2 management views. Change the ORDER BY in your queries to get highest use per I/O, CPU, Memry sys.dm_exec_query_stats
May 24, 2022 at 11:12 am
Try taking a look at theses 2 management views. Change the ORDER BY in your queries to get highest use per I/O, CPU, Memry
May 23, 2022 at 11:39 am
You cannot index all those nvarchar fields. So the sql engine has to do a full table scan to look for the matches.
May 17, 2022 at 6:34 am
Based on your terrible table designs, I cant think of anything that will help you.
Things that immediately stand out as what will hurt
May 17, 2022 at 6:20 am
Viewing 15 posts - 1 through 15 (of 1,311 total)