Ms Sql Error Code 512
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up SQL Error [512] [21000]: Subquery returned more than 1 value up vote 1 down vote favorite Why does it not work? (SQL Server) UPDATE someTable SET name='AB' WHERE id IN ( SELECT t.id FROM someTable t WHERE t.name='ABC' ) this one doesn't work too UPDATE someTable SET name='AB' WHERE name='ABC' sql sql-server share|improve this question edited Nov 29 '13 at 14:51 Michael Berkowski 181k23275275 asked Nov 29 '13 at 14:48 rekinyz 3,89011019 add a comment| 1 Answer 1 active oldest votes up vote 7 down vote accepted Because you must have a broken UPDATE trigger on the table. A common error in triggers is not taking into account that a statement can affect multiple or zero rows and thus that the INSERTED/DELETED tables don't always contain exactly one row. Look in the trigger for constructs like SET @ID = (select ID FROM INSERTED) share|improve this answer answered Nov 29 '13 at 14:51 Martin Smith 263k34416488 problem solved! there is an update-trigger on the table!! thank you very much! –rekinyz Nov 29 '13 at 15:00 add a comment| Your Answer draft saved draft discarded Sign up or log in Sign up using Google Sign up using Facebook Sign up using Email and Password Post as a guest Name Email Post as a guest Name Email discard By posting your answer, you agree to the privacy policy and terms of service. Not the an
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up SQL Error http://stackoverflow.com/questions/20288304/sql-error-512-21000-subquery-returned-more-than-1-value 512 while making sql job up vote 0 down vote favorite use character DECLARE @guild_codex varchar(25) DECLARE @character_name0 varchar(40) DECLARE @user_no0 varchar (25), @id varchar (25) DECLARE @user_no varchar (25), @group_id varchar (25), @amount varchar (25) DECLARE @free_amount varchar(25), @2mx_Leader varchar(3), @2mx_member varchar (3) SET @2mx_Leader = 700 SET @2mx_member = 500 SET @id = (SELECT id from [PC-ID].[Cash].[dbo].[user_cash] where free_amount LIKE 0) SET @user_no http://stackoverflow.com/questions/16532872/sql-error-512-while-making-sql-job = (SELECT user_no from [PC-ID].[Cash].[dbo].[user_cash] where free_amount LIKE 0) SET @group_id = (SELECT group_id from [PC-ID].[Cash].[dbo].[user_cash] where free_amount LIKE 0) SET @amount = (SELECT amount from [PC-ID].[Cash].[dbo].[user_cash] where free_amount LIKE 0) SET @free_amount = (SELECT free_amount from [PC-ID].[Cash].[dbo].[user_cash] where free_amount LIKE 0) SET @guild_codex = (SELECT guild_code from siege_info where siege_tag LIKE'Y') SET @character_name0 = (SELECT character_name from guild_char_info where guild_code LIKE @guild_codex and peerage_code LIKE 0) SET @user_no0 = (SELECT user_no from user_character where character_name LIKE @character_name0) use cash UPDATE user_cash SET amount=amount+@2mx_Leader WHERE user_no = @user_no0 ERROR: Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression. Someone know how can i simple solve it? Thanks in advice sql-server share|improve this question edited May 14 '13 at 14:08 asked May 13 '13 at 23:39 Daemon SQL 124 2 SELECT TOP 1 * FROM - or similar –Mark Schultheiss May 13 '13 at 23:41 SQL Server is accusing your code of trying to put multiple values into a simple, not table, variable. You have several SELECTs
: Closed as Not Reproducible Not Reproducible The product team could not reproduce this item https://connect.microsoft.com/SQLServer/feedback/details/922852/upgrade-to-sql-server-2012-failed-on-script-level-upgrade-with-error-512-severity-16-state-1 with the description and steps provided. A more detailed explanation for the resolution of this particular item may have been provided in the comments section. 1 0 Sign into vote ID 922852 Comments 0 Status Closed Workarounds 0 Type Bug Repros 1 Opened 7/17/2014 1:15:22 PM Access Restriction Public Description Recently upgrade of SQL Server ms sql 2008 R2 sp1 to SQL Server 2012 sp1 failed with error: SqlEngineDBStartConfigAction_upgrade_configrc_Cpu64. The following error has occurred: Wait on the Database Engine recovery handle failed. Check the SQL Server error log for potential causes. Error code: 0x851A001A From the SQL Server errorlog: - Error: 512, Severity: 16, State: 1. - Subquery returned more than 1 value. This is ms sql error not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression. Error: 912, Severity: 21, State: 2. - Script level upgrade for database 'master' failed because upgrade step 'msdb110_upgrade.sql' encountered error 512, state 1, severity 16. This is a serious error condition which might interfere with regular operation and the database will be taken offline. If the error happened during upgrade of the 'master' database, it will prevent the entire SQL Server instance from starting. Examine the previous errorlog entries for errors, take the appropriate corrective actions and re-start the database so that the script upgrade steps run to completion. - Error: 3417, Severity: 21, State: 3. - Cannot recover the master database. SQL Server is unable to run. Restore master from a full backup, repair it, or rebuild it. For more information about how to rebuild the master database, see SQL Server Books Online. I was able to start SQL Server service with startup parameters -m -T9