Viewing 15 posts - 166 through 180 (of 1,464 total)
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
If you convert your @DB_Users table variable to a temp table, the following code will dynamically create the cross-tab in SQL
DECLARE @Query nvarchar(MAX);
SET @Query = 'WITH cteData...
May 11, 2022 at 9:09 am
You can take a look at the following articles by Jeff Moden on dynamically creating PIVOTs and CROSS_TABs
https://www.sqlservercentral.com/articles/cross-tabs-and-pivots-part-2-dynamic-cross-tabs
May 11, 2022 at 8:38 am
The following query will satisfy your requirements
WITH cteData AS (
SELECT t.*
, rn = ROW_NUMBER() OVER (...
May 6, 2022 at 7:49 am
This should give you the same result as your complicated calculation
SELECT @naam = 'I' + CONVERT(char(4), GETDATE(), 12) + '-' + RIGHT('00000' + @MAX_naam, 5)
April 28, 2022 at 6:58 pm
Can you please show us a partial query so that we can see what you mean. No need to add all 60 date fields.
If you have something like this
April 4, 2022 at 12:31 pm
You can use TRY_CAST or TRY_CONVERT
UPDATE #Data
SET Number = TRY_CAST(Number AS float);
March 30, 2022 at 9:47 am
CursorID is an integer, not a collection.
You need to declare a variable for each field that the cursor returns
March 23, 2022 at 3:00 pm
SQL does not necessarily evaluate a CTE or sub-query when you think it does. It will un-nest them if it believes that it is more efficient to do so.
Watch the...
March 16, 2022 at 9:02 am
...
5. 6070. As I wrote in the initial post, I would expect the inner query to return these rows, a fairly small number, then give me the top one...
March 16, 2022 at 4:19 am
The following code satisfies your requirement
SELECT t.Testid
, t.Status
, t.Startdate
...
March 15, 2022 at 3:47 pm
So, taking a guess at what you are looking for ....
WITH cteData AS (
SELECT t.Testid
, t.Status
...
March 15, 2022 at 3:35 pm
Viewing 15 posts - 166 through 180 (of 1,464 total)