Viewing 15 posts - 121 through 135 (of 1,435 total)
DECLARE @ErrList table (
LogID int NOT NULL IDENTITY(1,1)
, ErrDesc nvarchar(4000) NOT NULL
);
INSERT INTO @ErrList ( ErrDesc )
VALUES ( 'Company (105): Error:...
July 7, 2022 at 2:12 pm
Take a look at my answer to your previous related question
https://www.sqlservercentral.com/forums/topic/which-table-design-is-better#post-4059010
July 6, 2022 at 5:28 am
I...
July 5, 2022 at 11:09 am
As Jo mentioned, it depends on your requirements
I would most likely use the following
tb_Worker
WorkerID
FName
LName
-- Other Worker Attributes
tb_Course
CourseID
CourseDescription
-- Other Course Attributes
tb_WorkerCourse
WorkerID
CourseID
DateCompleted
July 5, 2022 at 9:55 am
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://www.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
Viewing 15 posts - 121 through 135 (of 1,435 total)