Issue with create statement in SQL Server 2016

Vijay Kumar 2,036 Reputation points
2022-03-21T20:54:39.067+00:00

Hi Team,

Today we are facing a strange issue.
Like even simple create statement is not executing on this DB

Version: SQL Server 2016 with CU 17 on Windows Server 2012 VM

this DB is around 4.5 TB (Part of Always on) no DR.

example:
CREATE TABLE Persons (
PersonID int,
LastName varchar(255),
);

this statement ran for 8 mins still not completed and i canceled.
Don't know what's going on.
This issue was started in the past 2 days and no recent changes.

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
14,134 questions
Transact-SQL
Transact-SQL
A Microsoft extension to the ANSI SQL language that includes procedural programming, local variables, and various support functions.
4,665 questions
0 comments No comments
{count} votes

Accepted answer
  1. Erland Sommarskog 113.3K Reputation points MVP
    2022-03-21T23:11:37.233+00:00

    Sounds like a blocking issue, like a process holding a lock on system tables.

    You could use my beta_lockinfo to investigate the blocking. Start the CREATE TABLE statement and look for rows with !! in the BlkLvl column. That is the root blocker.


2 additional answers

Sort by: Most helpful
  1. Bert Zhou-msft 3,431 Reputation points
    2022-03-22T01:45:09.927+00:00

    Hi,@Vijay Kumar

    Welcome to Microsoft T-SQL Q&A Forum!

    If you are recreating a dropped table then I feel that the definition of the table must conform to the foreign key constraints referencing it.
    It must have the correct column names and types, and must have an index on the referenced key. If not, does the system prompt any error message or code?

    Best regards,
    Bert Zhou


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our Documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

  2. Isabellaz-1451 3,616 Reputation points
    2022-03-22T03:13:56.327+00:00

    Hi @Vijay Kumar

    Here is the official article about how to investigate the blocking,please check out this thread:https://learn.microsoft.com/en-US/troubleshoot/sql/performance/understand-resolve-blocking
    185443-image.png

    Best Regards,
    Isabella


    If the answer is the right solution, please click "Accept Answer" and upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.