Table Rows Missing (not shown) after updated with a query

%3CLINGO-SUB%20id%3D%22lingo-sub-100967%22%20slang%3D%22en-US%22%3ETable%20Rows%20Missing%20(not%20shown)%20after%20updated%20with%20a%20query%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-100967%22%20slang%3D%22en-US%22%3E%3CP%3EI%20ran%20into%20a%20situation%20and%20wonder%20whether%20someone%20knows%20how%20to%20fix%20it.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20am%20using%20Microsoft%20SQL%20server%20Management%20Studio%20to%20update%20the%20database.%26nbsp%3B%20There%20is%20one%20row%20which%20I%20could%20see%20but%20could%20not%20update%20because%20it%20is%20more%20than%20200%20rows%20(I%20did%20learn%20my%20lesson%20and%20I%20would%20change%20the%20option%20instead%20next%20time).%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAnyway%2C%26nbsp%3BI%20applied%20following%20query%3A%26nbsp%3B%20%22Update%20%5Bccnetwork_mdl%5D.%5Bdbo%5D.%5Bmdl_message%5D%20set%20useridto%3D'286'%20where%20id%3D'3140'%3B%22%26nbsp%3B%20And%26nbsp%3Bever%20since%20that%2C%20all%20rows%20where%20useridto%20field%20is%20%22286%22%20could%20not%20be%20seen%20by%20the%20%22SELECT%22%20query.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAny%20suggestions%20would%20be%20appreciated!%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-101129%22%20slang%3D%22en-US%22%3ERe%3A%20Table%20Rows%20Missing%20(not%20shown)%20after%20updated%20with%20a%20query%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-101129%22%20slang%3D%22en-US%22%3EThank%20you%20so%20very%20much%20for%20responding%20to%20my%20question!%3CBR%20%2F%3E%3CBR%20%2F%3EAfter%20trying%20to%20answer%20those%20information%20you%20said%20I%20should%20include%20in%20my%20post%2C%20I%20came%20upon%20an%20old%20page%20which%20I%20applied%20to%20retrieve%20the%20information%20from%20the%20table.%20It%20turned%20out%20that%20this%20table%20is%20supposed%20to%20keep%20only%20unread%20messages.%20What%20happened%20was%2C%20when%20I%20update%20the%20specific%20entry%2C%20this%20person%20%5Buseridto%3D'286'%5D%20who%20happened%20to%20open%20and%20read%20all%20messages%20received.%20And%20that%20action%20wiped%20out%20all%20entries%20which%20useridto%20is%20'286'%20from%20this%20table.%20That%20is%20why.%3CBR%20%2F%3E%3CBR%20%2F%3EI%20do%20appreciate%20your%20kindly%20advice.%20Without%20you%2C%20I%20would%20probably%20still%20stay%20panicky%20and%20helpless.%20Really%20thank%20you!!!%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-101055%22%20slang%3D%22en-US%22%3ERe%3A%20Table%20Rows%20Missing%20(not%20shown)%20after%20updated%20with%20a%20query%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-101055%22%20slang%3D%22en-US%22%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CBLOCKQUOTE%3E%3CHR%20%2F%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F74460%22%20target%3D%22_blank%22%3E%40Shih-Hua%20Fu%3C%2FA%3Ewrote%3A%3CBR%20%2F%3E%3CP%3EI%20ran%20into%20a%20situation%20and%20wonder%20whether%20someone%20knows%20how%20to%20fix%20it.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20am%20using%20Microsoft%20SQL%20server%20Management%20Studio%20to%20update%20the%20database.%26nbsp%3B%20There%20is%20one%20row%20which%20I%20could%20see%20but%20could%20not%20update%20because%20it%20is%20more%20than%20200%20rows%20(I%20did%20learn%20my%20lesson%20and%20I%20would%20change%20the%20option%20instead%20next%20time).%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAnyway%2C%26nbsp%3BI%20applied%20following%20query%3A%26nbsp%3B%20%22Update%20%5Bccnetwork_mdl%5D.%5Bdbo%5D.%5Bmdl_message%5D%20set%20useridto%3D'286'%20where%20id%3D'3140'%3B%22%26nbsp%3B%20And%26nbsp%3Bever%20since%20that%2C%20all%20rows%20where%20useridto%20field%20is%20%22286%22%20could%20not%20be%20seen%20by%20the%20%22SELECT%22%20query.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAny%20suggestions%20would%20be%20appreciated!%3C%2FP%3E%3CHR%20%2F%3E%3C%2FBLOCKQUOTE%3E%3CP%3EGood%20day%26nbsp%3BechShih-Hua%20Fu%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20can%20give%20you%20a%20lot%20of%20suggestion%20but%20these%20will%20not%20fit%20your%20case%20probably%20as%20I%20have%20no%20idea%20what%20is%20your%20case.%20You%20did%20not%20gave%20us%20any%20information%20regarding%20your%20database%20structure.%20We%20don't%20event%20know%20if%20you%20havce%20a%20column%20name%20%22id%22%20and%20what%20is%20the%20relation%20between%20the%20column%20%22id%22%20and%20the%20column%20%22useridto%22%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIf%20you%20want%20to%20get%20help%20min%20forums%20you%20should%20remember%20that%20we%20cannot%20see%20your%20system%20and%20we%20have%20no%20mind%20reading%20ability%20(I%20don't%20have%20at%20least)%20therefore%2C%20you%20should%20always%20post%3A%3C%2FP%3E%3CP%3E1)%20Queries%20to%20CREATE%20your%20table(s)%20including%20indexes%3CBR%20%2F%3E2)%20Queries%20to%20INSERT%20sample%20data.%3CBR%20%2F%3E3)%20The%20desired%20result%20given%20the%20sample%2C%20as%20text%20or%20image%20of%20excel%20for%20example.%3CBR%20%2F%3E4)%20A%20short%20description%20of%20the%20business%20rules%2C%20and%20how%20you%20got%201-2%20of%20the%20results%3CBR%20%2F%3E5)%20Which%20version%20of%20SQL%20Server%20you%20are%20using%20(this%20will%20help%20to%20fit%20the%20query%20to%20your%20version).%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ERegards%2C%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
New Contributor

I ran into a situation and wonder whether someone knows how to fix it.

 

I am using Microsoft SQL server Management Studio to update the database.  There is one row which I could see but could not update because it is more than 200 rows (I did learn my lesson and I would change the option instead next time). 

 

Anyway, I applied following query:  "Update [ccnetwork_mdl].[dbo].[mdl_message] set useridto='286' where id='3140';"  And ever since that, all rows where useridto field is "286" could not be seen by the "SELECT" query.

 

Any suggestions would be appreciated!

2 Replies
Highlighted

 


@Shih-Hua Fu wrote:

I ran into a situation and wonder whether someone knows how to fix it.

 

I am using Microsoft SQL server Management Studio to update the database.  There is one row which I could see but could not update because it is more than 200 rows (I did learn my lesson and I would change the option instead next time). 

 

Anyway, I applied following query:  "Update [ccnetwork_mdl].[dbo].[mdl_message] set useridto='286' where id='3140';"  And ever since that, all rows where useridto field is "286" could not be seen by the "SELECT" query.

 

Any suggestions would be appreciated!


Good day echShih-Hua Fu,

 

I can give you a lot of suggestion but these will not fit your case probably as I have no idea what is your case. You did not gave us any information regarding your database structure. We don't event know if you havce a column name "id" and what is the relation between the column "id" and the column "useridto"

 

If you want to get help min forums you should remember that we cannot see your system and we have no mind reading ability (I don't have at least) therefore, you should always post:

1) Queries to CREATE your table(s) including indexes
2) Queries to INSERT sample data.
3) The desired result given the sample, as text or image of excel for example.
4) A short description of the business rules, and how you got 1-2 of the results
5) Which version of SQL Server you are using (this will help to fit the query to your version).

 

Regards,

Highlighted
Thank you so very much for responding to my question!

After trying to answer those information you said I should include in my post, I came upon an old page which I applied to retrieve the information from the table. It turned out that this table is supposed to keep only unread messages. What happened was, when I update the specific entry, this person [useridto='286'] who happened to open and read all messages received. And that action wiped out all entries which useridto is '286' from this table. That is why.

I do appreciate your kindly advice. Without you, I would probably still stay panicky and helpless. Really thank you!!!