Find Jobs
Hire Freelancers

SQL Server Job syntax

$10-30 USD

I përfunduar
Postuar over 1 year ago

$10-30 USD

Paguhet në dorëzim
I am attempting to get the following code to work in a SQL Server 2019 Standard job for basic availability groups but it is failing with the below error and I don't know why. IF (SELECT primary_replica FROM sys.dm_hadr_availability_group_states) is NULL BEGIN PRINT 'This is a not an AG member server. –Not an AG Member Server and Job Execution should continue.' END ELSE IF (SELECT primary_replica FROM sys.dm_hadr_availability_group_states) = @@Servername BEGIN PRINT 'This is a AG Primary Replica. –Do Nothing. This is an AG Primary Replica and Job Execution should continue.' END ELSE IF (Select primary_replica FROM sys.dm_hadr_availability_group_states)= @@Servername BEGIN PRINT 'This is a AG Secondary Replica. –Stop Job. This is an AG Secondary Replica and we do not want Job Execution to continue on this Node.' DECLARE @job_id UNIQUEIDENTIFIER; SET @job_id = CONVERT(UNIQUEIDENTIFIER, CONVERT(VARBINARY(34), '$(ESCAPE_SQUOTE(JOBID))', 1)); EXECUTE msdb.dbo.sp_stop_job @job_id = @job_id; END Error: Msg 512, Level 16, State 1, Line 1 Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression. Msg 512, Level 16, State 1, Line 5 Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression. Msg 512, Level 16, State 1, Line 9 Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression. Code in comments section on this website: [login to view URL] Comment #4
ID e Projektit: 35188171

Rreth projektit

9 propozime
Projekt në distancë
Aktive 2 yrs ago

Po kërkoni të fitoni para?

Përfitimet e ofertës për Freelancer

Vendosni buxhetin dhe afatin tuaj
Paguhuni për punën tuaj
Përshkruani propozimin tuaj
Është falas të regjistrohesh dhe të bësh oferta për punë
I dhënë për:
Avatari i Përdoruesit
$0 USD në 1 ditë
5,0 (7 përshtypje)
5,6
5,6
9 profesionistët e pavarur ofrojnë mesatarisht $27 USD oferta për këtë punë
Avatari i Përdoruesit
I will create, optimize and migrate your SQL,Oracle,MS Access, postgresql, mysql , maridb database.I will help you with database projects and solve any sql queries.I will do database design task and project with sql queries I am a Certified Database Administrator, DB Architect and extensively worked on MySQL, MS SQL Server, AWS RDS, PostgreSQL, Oracle and MariaDB. I Do: Normalization Logical Model and Physical Model ERD and Extended ERD ERD translation User management Table and Report Design Query and Simple and Complex Queries Create Joins and CRUD Functions Query Optimization Database Objects Creation (Index, View, Sequence, etc) Database Implementation. I am at your service, feel free to place your order now.
$50 USD në 7 ditë
5,0 (10 përshtypje)
5,9
5,9
Avatari i Përdoruesit
Hello Friend ! I can help you to fix the SQL Script and make it executable. We can do a 15-minutes free call to discuss the project requirements and our work plan. I have 11+ years of exceptional knowledge and experience in high performance OLTP systems (Microsoft SQL Server). Please feel free to ask for adjustment if my Bid Amount or Hourly Rate does not fit your budget. Warm regards, Kundan Bihari ( SQL Server Consultant )
$40 USD në 1 ditë
5,0 (35 përshtypje)
5,1
5,1
Avatari i Përdoruesit
I can help you with sql server scripts , please ping/connect me now I am available. Please check my reviews and project which I have completed. I can create sql queries for sql server database as per design, let me know when to proceed. I can work on future works for databases also if needed. I will work for cheapest budget within time, budget can be re negotiated again, send the details for the project. Please contact me asap. I have 12+ years of experience in database programming, website designing, powershell scripting and android development. Feel free to message me anytime if you need to discuss this further.
$10 USD në 1 ditë
5,0 (11 përshtypje)
4,4
4,4
Avatari i Përdoruesit
Hello there, I have read your requirements and am confident I am the right candidate for the job. Among other things, I have over ten years of experience in Oracle PLSQL, PostgreSQL, MySQL, MS SQL, and others. Furthermore, I am available 24x7 to answer any questions you may have about the requirements. I am looking forward to hearing from you as soon as possible. I would appreciate it if you would click the chat button for me if you are interested. Thanks a lot. Best regards. Courser Xu
$25 USD në 7 ditë
5,0 (5 përshtypje)
3,8
3,8
Avatari i Përdoruesit
Hi , I am having experience as a software developer with more than two years. I am hoping to help you as a technical person.
$20 USD në 3 ditë
0,0 (0 përshtypje)
0,0
0,0
Avatari i Përdoruesit
If you write SELECT top 1 primary_replica FROM sys.dm_hadr_availability_group_states I think is will correct. The problem is that you want to compare a value with more values.
$20 USD në 7 ditë
0,0 (0 përshtypje)
0,0
0,0

Rreth klientit

Flamuri i UNITED STATES
Conyers, United States
5,0
34
Mënyra e pagesës u verifikua
Anëtar që nga nën 12, 2008

Verifikimi i klientit

Faleminderit! Ne ju kemi dërguar me email një lidhje për të kërkuar kredinë tuaj falas.
Ndodhi një gabim gjatë dërgimit të email-it tuaj. Ju lutemi provoni përsëri.
Përdorues të regjistruar Punë të postuara
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Po ngarkohet shikimi paraprak
Leja u dha për Geolocation.
Seanca e hyrjes ka skaduar dhe ke dalë. Hyr sërish.