I am working with an Arcgis Enterprise SDE Database in SQL Server.
I am attempting to use a SQL update query to update a new field for many of the records in the database. This field is populated from a table that is created in other processing steps. In the query I update Table Views, which can then be QA/QC’d before being integrating into the database.
(see below for code)
When I test the query in SSMS, for all the datasets I want to update, it works with no errors. The issue is that when I attempt to run the same query via a batch file in command line it hangs indefinitely (16+ hours with no response). It does not even output messages to suggest it has started processing. I have no idea if it is a specific table that is causing the problem, or if it is throwing some kind of error.
My major confusion is that it only hangs when I run the test for all of the datasets. If I run the query for a small subset of the tables (1 or 2) it works in both SSMS and in Command Line and prints outputs to command line as intended.
My DBA insists that my query will not work, even though it works without error in SSMS. She says I must use a cursor to do this. However she has yet to give any kind of explanation as to why she believes this. Thus I am asking the community.
My main question is, what is happening here? Or, if this is not enough information, how can I potentially debug this to identify and fix the issue?
SET NOCOUNT ON EXEC dbase.sde.set_current_version "VERSION.TEST"; EXEC dbase.sde.edit_version "VERSION.TEST", 1; BEGIN TRY BEGIN TRAN; RAISERROR ('B processing begun', 10,1) WITH NOWAIT UPDATE BV SET BV.MA = ( SELECT BJ.MC FROM BJ WHERE BJ.Key = BV.Key AND BJ.MA <> BJ.MC ) WHERE EXISTS ( SELECT 1 FROM BJ WHERE BJ.Key = BV.Key AND BJ.MA <> BJ.MC ); -- Repeat above for each desired dataset starting with RAISEERROR RAISERROR ('All Processing Complete, Commiting Transaction.', 10,1) WITH NOWAIT COMMIT; EXEC devsde.sde.edit_version "SYOKLIC1.TEST", 2; END TRY BEGIN CATCH COMMIT; EXEC dbase.sde.edit_version "VERSION.TEST", 2; PRINT '*************Error Detail****************'; PRINT 'Error Number :' + CAST(ERROR_NUMBER() AS VARCHAR); PRINT 'Error Severity:' + CAST(ERROR_SEVERITY() AS VARCHAR); PRINT 'Error State :' + CAST(ERROR_STATE() AS VARCHAR); PRINT 'Error Line :' + CAST(ERROR_LINE() AS VARCHAR); PRINT 'Error Message :' + ERROR_MESSAGE(); END CATCH
@echo on python preprocessing.py sqlcmd -U username -P password -S server\dbase -i myquery.sql python postprocessing.py pause
✓ Extra quality
ExtraProxies brings the best proxy quality for you with our private and reliable proxies
✓ Extra anonymity
Top level of anonymity and 100% safe proxies – this is what you get with every proxy package
✓ Extra speed
1,ooo mb/s proxy servers speed – we are way better than others – just enjoy our proxies!
USA proxy location
We offer premium quality USA private proxies – the most essential proxies you can ever want from USA
Our proxies have TOP level of anonymity + Elite quality, so you are always safe and secure with your proxies
Use your proxies as much as you want – we have no limits for data transfer and bandwidth, unlimited usage!
Superb fast proxy servers with 1,000 mb/s speed – sit back and enjoy your lightning fast private proxies!
99,9% servers uptime
Alive and working proxies all the time – we are taking care of our servers so you can use them without any problems
No usage restrictions
You have freedom to use your proxies with every software, browser or website you want without restrictions
Perfect for SEO
We are 100% friendly with all SEO tasks as well as internet marketing – feel the power with our proxies
Buy more proxies and get better price – we offer various proxy packages with great deals and discounts
We are working 24/7 to bring the best proxy experience for you – we are glad to help and assist you!