Error occurs when I call ALTER TABLE REBUILD in one stored procedure and try to SELECT data in another simultaneously.
CREATE PROCEDURE IF NOT EXISTS RebuildContent()
AS
BEGIN
INSERT INTO dbo.Log (Date, Message)
VALUES ( DateTime.UtcNow, "Starting Content table rebuilding ..." );
ALTER TABLE dbo.Content REBUILD;
ALTER TABLE dbo.ContentCrc REBUILD;
INSERT INTO dbo.Log (Date, Message)
VALUES ( DateTime.UtcNow, "Completed Content table rebuilding ..." );
END;
Are there any solutions to avoid it? Thank you in advance!