SQL Server UPDATE Command Fails without error

Using SSMS running the below UPDATE command I get returned message says 1 row affected. but if I then follow it up with a Select and it shows that the row never updated.

This issue happens in SSMS and a custom application I built in C# using Entity Framework. I have since stopped using Entity Framework generated code and moved straight to a stored proc. All of 3 different ways of performing the same task I randomly get this issue. Sometimes it can be 100’s or 1000’s of updates before the issue happens again or it could be a few updates later it happens again. I have run UPDATE STATISTICS, I have Rebuilt Indexes and Reorganized Indexes.

As a side note, I NEVER have an issue with INSERTs only UPDATEs we never DELETE any records. and total record count on the table is 201,741

UPDATE CreativeWorkFlowQueue     SET CurrentIndicator = 'N' WHERE CreativeWorkFlowQueueId = 198231  SELECT * FROM CreativeWorkFlowQueue WHERE CreativeWorkFlowQueueId = 198231 

enter image description here

here is the table

SET ANSI_NULLS ON GO  SET QUOTED_IDENTIFIER ON GO  CREATE TABLE [dbo].[CreativeWorkFlowQueue](     [CreativeWorkFlowQueueId] [int] IDENTITY(1,1) NOT NULL,     [DigitalCampaignCreativeId] [int] NOT NULL,     [WorkFlowQueueId] [int] NOT NULL,     [CurrentIndicator] [char](1) NOT NULL,     [CreateDate] [datetime] NOT NULL,     [LastUpdatedDate] [datetime] NOT NULL,     [IsDeleted] [bit] NOT NULL, PRIMARY KEY CLUSTERED  (     [CreativeWorkFlowQueueId] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY] GO  ALTER TABLE [dbo].[CreativeWorkFlowQueue] ADD  CONSTRAINT [CreateDate defaults to utcDate on CreativeWorkFlowQueue]  DEFAULT (getutcdate()) FOR [CreateDate] GO  ALTER TABLE [dbo].[CreativeWorkFlowQueue] ADD  CONSTRAINT [LastUpdatedDate defaults to utcDate on CreativeWorkFlowQueue]  DEFAULT (getutcdate()) FOR [LastUpdatedDate] GO  ALTER TABLE [dbo].[CreativeWorkFlowQueue] ADD  CONSTRAINT [DF_CreativeWorkFlowQueue_IsDeleted]  DEFAULT ((0)) FOR [IsDeleted] GO  ALTER TABLE [dbo].[CreativeWorkFlowQueue]  WITH CHECK ADD  CONSTRAINT [CreativeWorkFlowQueue DigitalCampaignCreativeId fk] FOREIGN KEY([DigitalCampaignCreativeId]) REFERENCES [dbo].[DigitalCampaignCreative] ([DigitalCampaignCreativeId]) GO  ALTER TABLE [dbo].[CreativeWorkFlowQueue] CHECK CONSTRAINT [CreativeWorkFlowQueue DigitalCampaignCreativeId fk] GO  ALTER TABLE [dbo].[CreativeWorkFlowQueue]  WITH CHECK ADD  CONSTRAINT [CreativeWorkFlowQueue WorkFlowQueueId fk] FOREIGN KEY([WorkFlowQueueId]) REFERENCES [dbo].[WorkFlowQueue] ([WorkFlowQueueId]) GO  ALTER TABLE [dbo].[CreativeWorkFlowQueue] CHECK CONSTRAINT [CreativeWorkFlowQueue WorkFlowQueueId fk] GO 

EDIT Adding the Stored Proc that also has the same issue.

I did not include this stored proc simply due to the fact that it is complex and if a simple update doesn’t work I figured start there first.

CREATE PROCEDURE [dbo].[sp_WtvToRtl]      -- Add the parameters for the stored procedure here     @tbl DCCIdList READONLY,         @WorkFlowQueueId int AS BEGIN     -- SET NOCOUNT ON added to prevent extra result sets from     -- interfering with SELECT statements.     SET NOCOUNT ON;           DECLARE @dccList TABLE (         CreativeWorkflowQueueId int null,         DigitalCampaignCreativeId int null,         WorkFlowQueueId int null,         CurrentIndicator varchar(1) collate SQL_Latin1_General_CP1_CI_AS null,         LastUpdatedDate datetime null     )      DECLARE @DCIDList TABLE(         DigitalCampaignCreativeId int null     )              DECLARE @res TABLE (         MergeAction VARCHAR(50) collate SQL_Latin1_General_CP1_CI_AS ,         CreativeWorkFlowQueueId INT,          _Position INT         )      BEGIN TRANSACTION t1      BEGIN TRY         INSERT INTO @dccList (CreativeWorkflowQueueId, DigitalCampaignCreativeId,LastUpdatedDate,WorkFlowQueueId,CurrentIndicator)         select CreativeWorkflowQueueId, DigitalCampaignCreativeId,LastUpdatedDate,WorkFlowQueueId, 'N' as CurrentIndicator from          dbo.CreativeWorkFlowQueue Where CurrentIndicator = 'Y'          and IsDeleted = 0         and DigitalCampaignCreativeId In          (SELECT DigitalCampaignCreativeId FROM VRF.DigitalCampaignCreative          WHERE IsDeleted = 0 and SfClosed = 0          and DccId in (Select DccId COLLATE SQL_Latin1_General_CP1_CI_AS from @tbl)         )                    INSERT INTO @DCIDList           SELECT DigitalCampaignCreativeId FROM @dccList          GROUP BY DigitalCampaignCreativeId          INSERT INTO @dccList (DigitalCampaignCreativeId,WorkFlowQueueId,CurrentIndicator)         select DigitalCampaignCreativeId, @WorkFlowQueueId as WorkFlowQueueId, 'Y' as CurrentIndicator from          @DCIDList           MERGE vrf.CreativeWorkFlowQueue a         USING              (             SELECT                  x.CreativeWorkflowQueueId,                 x.DigitalCampaignCreativeId,                 x.LastUpdatedDate,                 x.WorkFlowQueueId,                 x.CurrentIndicator              FROM @dccList x             ) stg                ON stg.CreativeWorkflowQueueId = a.CreativeWorkflowQueueId          WHEN MATCHED THEN             UPDATE SET                  a.CurrentIndicator  = stg.CurrentIndicator,                 a.LastUpdatedDate = getutcdate()         WHEN NOT MATCHED THEN             INSERT                  (                     CurrentIndicator,                     DigitalCampaignCreativeId,                     WorkFlowQueueId                 )             VALUES                  (                     stg.CurrentIndicator,                      stg.DigitalCampaignCreativeId,                      stg.WorkFlowQueueId                 )               -- ********************************************************************             -- Remove this if you don't need to return the results below.             OUTPUT                  INSERTED.CreativeWorkFlowQueueId,                 $  action              INTO @res (CreativeWorkFlowQueueId, MergeAction);             -- ********************************************************************           COMMIT TRANSACTION t1      END TRY     BEGIN CATCH          DECLARE @ErrorMessage NVARCHAR(MAX), @ErrorSeverity INT, @ErrorState INT;         SELECT @ErrorMessage = ERROR_MESSAGE() + ' Line ' + CAST(ERROR_LINE() AS NVARCHAR(5)), @ErrorSeverity = ERROR_SEVERITY(), @ErrorState = ERROR_STATE();         ROLLBACK TRANSACTION t1         --RAISERROR(@ErrorMessage, @ErrorSeverity, @ErrorState);         SELECT 'FAILED' MergeAction,                 s.CreativeWorkflowQueueId,                 s.DigitalCampaignCreativeId,                 '' DccId,                 s.WorkFlowQueueId,                 s.CurrentIndicator,                 null CreateDate,                 null LastUpdatedDate,                 null IsDeleted,                 @ErrorMessage ErrorMessage         FROM @dccList s     END CATCH       -- Normally, I would not have this.  But this will simulate     -- what EF does if you need it.     SELECT          r.MergeAction,         a.CreativeWorkFlowQueueId,         a.DigitalCampaignCreativeId,         d.DccId,         a.WorkFlowQueueId,         a.CurrentIndicator,         a.CreateDate,          a.LastUpdatedDate,         a.IsDeleted,         '' ErrorMessage     FROM vrf.CreativeWorkFlowQueue a      JOIN @res r ON a.CreativeWorkFlowQueueId = r.CreativeWorkFlowQueueId     JOIN vrf.DigitalCampaignCreative d ON a.DigitalCampaignCreativeId = d.DigitalCampaignCreativeId     ORDER BY          r.MergeAction,         r._Position   END 

The User-Defined Table Type is this.

CREATE TYPE [dbo].[DCCIdList] AS TABLE(     [DccId] [nvarchar](18) NULL ) 

Display related posts without a plugin

I’m trying to display the related posts using functions.php:

function posts_related($  related){ if (is_single()) { global $  post; // Build basic custom query arguments $  custom_query = new WP_Query( array(         'posts_per_page' => 8, // Number of related posts to display        'post__not_in' => array($  post->ID), // Ensure that the current post is not displayed        'orderby' => 'rand', // Randomize the results ));  // Run the loop and output data for the results if ( $  custom_query->have_posts() ) : while ( $  custom_query->have_posts() ) : $  custom_query->the_post();   if ( has_post_thumbnail()   ) {                   $  permalink = the_permalink();                  $  post_thumbnail = the_post_thumbnail('medium');                  $  title = the_title();                                         $  related .= '<a href="' . $  permalink .  '"><img src="' . $  post_thumbnail . '/></a>';                               }            $  related .=  '<a href="' .  $  permalink . '"><b>' . $  title . '</b></a>';      endwhile;   else :      $  related .= '<p>Nothing to show.</p>'; endif; // Reset postdata }          echo '<pre>'; var_dump( has_post_thumbnail() ); echo '</pre>';       return $  related;  }    //wp_reset_postdata();  add_filter( "the_content", "posts_related", 99 ); add_theme_support( 'post-thumbnails' ); set_post_thumbnail_size( 100, 50, true ); 

But I’m not being able to handle the output properly. I need it to display below the post (single post).

display childs without parent

The following code displays the parent plus his children on the specific parent- and children-category pages as "filter-buttons". But in this list I do not want to display the parent, (because the parent is already displayed as "ALL"). How can I display list with only the childre/ without the parent?

Thank you for any further help.

<?php $ categories = get_the_category(); foreach($ categories as $ key => $ category) { $ url = get_term_link((int)$ category->term_id,'category'); $ categories[$ key] = "<pre><a href=\"{$ url}\">{$ category->name}</a></pre>"; } echo "" . implode("\n",$ categories) . ""; ?>

Travel Affiliate Website without hosting fees

Travel website are built professionally, SEO friendly and mobile friendly. It runs on the blogger platform and is fully integrated with Whitelabel Travelpayouts. We will register it on Google Business.

Travel affiliate website that have been designed to run automatically and are linked with white label travepayouts (Flights and Hotels) which have been customized to make it look more beautiful and attractive. You can see the website…

Travel Affiliate Website without hosting fees

how to create 5star review rating for testimonials without plugin in WordPress

already I have created a Testimonial post type but I face a problem which is how to create a review 5-star rating system without any plugin in the meta box. This is my 5 start rating codes here… just I wanna fix the rating problem.

Plz, anyone help me.

                            <div class="single-slider">                                 <ul class="star-list">                                  <li><i class="fa fa-star"></i></li>                                 <li><i class="fa fa-star"></i></li>                                 <li><i class="fa fa-star"></i></li>                                 <li><i class="fa fa-star"></i></li>                                 <li><i class="fa fa-star"></i></li>                                                                  </ul>                                    <?php the_content();?>                                 <!-- Client Info -->                                 <div class="t-info">                                     <div class="t-left">                                         <div class="client-head"> <?php the_post_thumbnail('testimonial-img');?></div>                                         <h2><?php the_title();?><span><?php echo get_post_meta(get_the_ID(),'meta-subtitle-Testimonials2', true); ?></span></h2>                                     </div>                                     <div class="t-right">                                         <div class="quote"><i class="fa fa-quote-right"></i></div>                                     </div>                                 </div>                             </div> 

plz check the pic which i wanna

enter image description here

wp_logout without redirect

I am creating my own login page, and checking if the user is logged in. If so, calling wp_logout before rendering my page.

This works, but I do get warnings as WordPress is trying to redirect me. Cannot modify header information

I cannot find a way to simply logout, and carry on. Is there a way to do it, or a reason why this is so hard?

Many thanks

Repairing buggy query server-side – without changes in the app

More external apps are accessing our ERP SW database. As we were adding some columns into our structure, some queries from the external app become buggy because they are not specifying the targeted table in the query and errors out with Ambiguous column name… message.

The app vendor is inaccesible. We cannot repair the query from the app point nor change our structure (it’s for more customers).

Can we do something at the database server level?

How do I run a web app in my WordPress theme without the “wp-content/theme/…/webapp” in URL?

hope everyone’s doing great.

I have a web application that’s pretty much a folder containing an index.html and some javascript stuff. I placed this folder in my theme folder.

It works perfectly when I try to run it like: domain/wp-content/themes/theme-name/webapp/

Here’s the issue. I want to hide the "domain/wp-content/themes/theme-name".

e.g. A normal page looks like this: "domain/page-name". I want the web app to look like this: "domain/webapp".

Is there any way I could go about doing this? I do not wish to touch any code in the webapp if possible, since it’s from a third party.

Thanks in advance!

What do you do when a spell or something says that the target needs to do a saving throw without a number for the throw? [duplicate]

For command, it states, "The target must succeed on a Wisdom saving throw or follow the command on its next turn" without any context to how high the target needs to roll for it to succeed. What does the target need to roll to succeed that saving throw? Is the number specific for command or is it the same for all spells like this? I’d like to get all the info I can for this.

How does the following script manage to pull data from an external domain without requiring CORS headers?

Script in Question: http://samples.geekality.net/image-fetcher/

You can click "view source" at the bottom to pull up the exact PHP and Javascript being used.

I used part of this script to extract images on a site of mine from another on separate domains and servers. I had to go to the one being scraped and add a CORS header "Access-Control-Allow-Origin" to allow my specific domain to do the AJAX $ .post and actually receive data.

The script above does not require any site to have the CORS header for security. As far as I can tell I’m doing nothing different.

I have an HTML form then I’m grabbing the field data with jQuery and doing a $ .post where the action is a PHP file that uses DomDocument to grab the HTML. The PHP then sorts through the data and echoes a JSON object. Then the jQuery sorts it all out and displays it on the page. Same thing they’re doing.

I can’t see how they’re getting around the need for a "Access-Control-Allow-Origin" header on the site they’re grabbing images from?

Thanks for your time and energy in this!