Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
288 views
in Technique[技术] by (71.8m points)

sql server - Blocking resource running sql statement

I'm getting a connection from another SQL server (sqlServerB) using the server connected to this sql server (sqlServerMain).

A script executing the sqlServerB command is giving timeout. I can see from the logs, but I could not find which resource running in sqlServerB is running this sql string.

    DECLARE @p1 INT
SET @p1 = NULL
EXEC sp_prepexec
    @p1 OUTPUT,
    N'@P1 bigint',
    N'SELECT "Tbl1081"."stockCode" "Col2006","Tbl1081"."stockName" "Col2007" FROM "myDatabase"."dbo"."descriptonTable" "Tbl1081" WITH (NOLOCK) WHERE @P1="Tbl1081"."recordId" ORDER BY "Col2006" ASC',
    2512
SELECT
        @p1

It is not possible for me to block sqlServerB connecting to me with the connected Server. But is it possible to just block this wrong sql String with a database trigger?

or How should I go about it?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...