Viewing 15 posts - 301 through 315 (of 1,491 total)
>>Now, let’s imagine that my procedure is not finished but, at the same time, the SQL Server engine executes the procedure stored C on the same session.
If you are running...
October 11, 2022 at 10:37 am
Maybe:
SELECT *
FROM YourTable
WHERE ExtractDate >= CONVERT(char(6), DATEADD(month, -6, CAST(YEAR(CURRENT_TIMESTAMP) AS char(4))), 112)
AND ExtractDate < CONVERT(char(6), DATEADD(month, 6, CAST(YEAR(CURRENT_TIMESTAMP) AS char(4))), 112)
October 10, 2022 at 12:51 pm
DECLARE @max_ID int
SELECT @max_ID = MAX(ID) FROM main_table
INSERT INTO main_table
SELECT @max_ID + ROW_NUMBER() OVER(ORDER BY datetime) AS new_ID, ...
FROM new_data
That could produce race conditions and deadlocks. The following is...
October 6, 2022 at 9:08 pm
As ownership chaining only works within a database, with a view you will either have to create domain\MyServiceAccount as a user in the Finance database with SELECT permission on the...
October 5, 2022 at 8:43 pm
SET SHOWPLAN_ALL ON
This is just the estimated plan.
SET STATISTICS PROFILE ON gives the actual plan. SET STATISTICS XML ON gives the XML although I just generally right click on...
October 4, 2022 at 3:28 pm
The execution plan is identical in 120 and 150.
You say the plans at 120 and 150 are identical but have you verified this by saving both Actual (not...
October 4, 2022 at 6:48 am
Row Level Security would usually be based on AD groups or Roles.
While your problem description is vague I suspect Row Level Security is not the best option here due to...
September 22, 2022 at 9:12 pm
Float is an inexact data type so should probably not be used if you want accuracy.
Microsoft changed the inplementation of float in SQL2016. See Converting float and real data in...
September 18, 2022 at 8:36 pm
DECLARE @sumdocument int;
WITH Bollore
AS
(
SELECT SEQ_DOC
FROM OPENQUERY([pprod.link.db.bollore-logistics.com], 'SELECT SEQ_DOC FROM LINK.dbo.DOCUMENT')
)
, Bad
AS
(
SELECT SEQ_DOC
FROM OPENQUERY([pprod.link.db.bad-logistics.com], 'SELECT SEQ_DOC FROM LINK.dbo.DOCUMENT')
)
, AllDocs
AS
(
SELECT SEQ_DOC
FROM Bollore D
WHERE EXISTS
(
SELECT 1
FROM Link.dbo.EVT_ATT L
WHERE L.SEQ_DOC =...
September 18, 2022 at 12:54 pm
-- Your
CREATE TABLE dbo.PermTable
( Value VARCHAR(100) ) COLLATE DATABASE_DEFAULT
-- Should be
CREATE TABLE dbo.PermTable
( Value VARCHAR(100) COLLATE DATABASE_DEFAULT );
-- or just
CREATE TABLE dbo.PermTable
( Value VARCHAR(100));
September 15, 2022 at 8:25 pm
I have never done it but I think prior to SQL2022 query store only worked on the primary replica.
September 13, 2022 at 7:34 am
As a matter of interest, what values are returned by the following queries:
--1
SELECT CAST([value] AS int)/1024
FROM sys.configurations
WHERE [name] = 'max server memory (MB)'
ORDER BY [name]
OPTION (RECOMPILE);
--2
SELECT CAST(ROUND(total_physical_memory_kb/1048576.0,...
September 7, 2022 at 5:34 pm
To be honest, Auto statistics don't work well with indexes with ever-increasing keys. And, even after the improvements they made, I still think that they fall a bit short. Go...
September 1, 2022 at 9:16 pm
Viewing 15 posts - 301 through 315 (of 1,491 total)