Viewing 15 posts - 301 through 315 (of 1,494 total)
It is up to you but personally, if at all possible, I would avoid nested transactions like the plague.
I would still strip out the transactions from SubProc1 etc and rename...
October 12, 2022 at 2:03 pm
I think you should check for @@TRANCOUNT and not XACT_STATE().
Also remove all TRYs, CATCHes and TRANsactions in the SubProcs. Something like the following should then work reasonably well:
October 12, 2022 at 9:34 am
What I want to know is whether, in the same session, several independent stored procedures could be performed at the same time..
Obviously not. (Except if you are bold enough...
October 11, 2022 at 2:53 pm
>>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
Viewing 15 posts - 301 through 315 (of 1,494 total)