The silly problems we encountered in those years

Source: Internet
Author: User

People are always growing in problems. The following are some silly questions about the project.

1. Stored Procedure not found

When this problem occurs, my first response is that the stored procedure name is incorrect. So I compared the stored procedure name to the database name several times and did not find any problems. In addition, I copied the stored procedure name in the error prompt box and then executed it in the database. It can be executed smoothly. Suddenly I was speechless and began to doubt the initial judgment. Isn't it a problem with the name of the stored procedure? So I started to check the code, and the check process was difficult. Friends, can you guess where the problem is? After a long period of effort, I finally found out the problem-a space before the stored procedure name. Nima! This can be done without words!

2. browser cache Problems

When it comes to caching, I still have a little bit of knowledge about it. Every time I encounter a cache issue, it's okay to close the browser and re-open it. However, on one occasion, I changed the JS file, then checked the change effect in IE, F5 refreshed, and did not see the effect. Hey, there was a cache problem! Close the browser and check the effect again. At this time, there is a kind of subconscious, that is, I re-opened the browser, certainly not a cache problem. Then I found a variety of problems, finally turned back, manually cleaned up the cache, run! It's a cache problem! This total subconscious is enough!

3. String Length issues

We made a combined query function, and then handed over the work to determine which drop-down boxes work to the stored procedure. The code in the interface and stored procedure is as follows:

Declare @ sqlstr varchar (300) -- store SQL statement set @ sqlstr = 'select max (specializedscheduleid) as specializedscheduleid, campusname, buildingname, roomname, coursename, gradename, teachclassname, '+' teachername, schoolyear, semester, startweek, stopweek, oddeven, workday, begintimesectionname, '+ 'endtimesectionname from vb_specializedcoursescheduleinfo' + 'where schoolyear =' + ''' + @ schoolyear + ''' + 'and semester = '+ ''' + @ Semester + ''' +' and workday = '+ ''' + @ week + ''' -- merge SQL statements, query by school year, term, Week, and week by week -- + 'and oddeven =' + ''' + @ oddeven + ''' if (@ gradeid! = '') -- Determine whether to select the grade set @ sqlstr = @ sqlstr + 'and gradeid =' + ''' + @ gradeid + ''' if (@ teachercollegeid! = '') -- Determine whether to select the school where the instructor belongs. Set @ sqlstr = @ sqlstr + 'and teachercollegeid =' + ''' + @ teachercollegeid + ''' if (@ teacherid! = '') -- Determine whether to select the instructor set @ sqlstr = @ sqlstr + 'and teacherid =' + ''' + @ teacherid + ''' if (@ coursecollegeid! = '') -- Determine whether to select the school set @ sqlstr = @ sqlstr + 'and coursecollegeid =' + ''' + @ coursecollegeid + ''' if (@ coursecategoryid! = '') --- Determines whether to select the course category: attribution. It refers to the nature of electives: Set @ sqlstr = @ sqlstr + 'and coursecategoryid =' + ''' + @ coursecategoryid + ''' if (@ coursetypeid! = '') -- Determines whether to select the course type: theory or experiment. Set @ sqlstr = @ sqlstr + 'and coursetypeid =' + ''' + @ coursetypeid + ''' if (@ coursepropertyid! = '') -- Determines whether to select the course nature: set @ sqlstr = @ sqlstr + 'and coursepropertyid =' + ''' + @ coursepropertyid + ''' if (@ coursename! = '') -- Determines whether the course name is set @ sqlstr = @ sqlstr + 'and coursename like'' %' + @ coursename + '% ''if (@ campusid! = '') -- Determine whether to select campus set @ sqlstr = @ sqlstr + 'and campusid =' + ''' + @ campusid + ''' if (@ buildingid! = '') -- Determines whether to select a building set @ sqlstr = @ sqlstr + 'and buildingid =' + ''' + @ buildingid + ''' if (@ roomid! = '') -- Determines whether to select a room set @ sqlstr = @ sqlstr + 'and roomid =' + ''' + @ roomid + ''' if (@ timesectionininid! = '') -- Determine whether to choose the start time set @ sqlstr = @ sqlstr + 'and classbegin =' + ''' + @ timesectionininid + ''' if (@ timesectionendid! = '') --- Determine whether to choose to end the section set @ sqlstr = @ sqlstr + 'and classend =' + ''' + @ timesectionendid + ''' if (@ oddeven! = '') --- Determine whether to choose the end time set @ sqlstr = @ sqlstr + 'and oddeven =' + ''' + @ oddeven + ''' set @ sqlstr = @ sqlstr +' group by campusname, buildingname, roomname, coursename, gradename, '+ 'teachclassname, teachername, schoolyear, semester, startweek, stopweek, oddeven,' + 'workday, expiration, endtimesectionname' exec (@ sqlstr)

This problem is amazing. What is it like? After selecting the query condition, click the query button, but the result is sometimes displayed normally, sometimes there are errors, and the error prompt is different. It will be "there is a syntax error near and ", "A syntax error exists near group ". I checked the code n times carefully and did not find any problems, but the error still exists. I don't know if you can feel the way I was at that time! After multiple tests, I found that the condition drop-down box is rarely used, and there will be no errors. Once a large number of drop-down boxes are used, problems will occur. Finally, I found the problem. It turns out to be "declare
@ Sqlstr varchar (300) "an error occurs. The length of the string is too small. If you select more than a certain number of drop-down boxes, the length of the SQL statement will exceed 300, and an error will occur. Nima, how much effort has been delayed due to such a small problem!

4. The transaction log is full.

Look at the error image:

Transaction Log full? This problem was first encountered. When I checked the Internet, people said it was a space problem. I checked the server where the database is located, and there was a problem. The server's c disk space was only a few megabytes left. So I deleted some C disks and pulled 2 GB space. Thought: This time is okay. Run the program again and execute some operations. Perfect and wood have problems. However, when I run the wrong operation again, the same problem occurs again. I checked the log file, occupying 684 MB of space and allowed a maximum of 700 mb of space. I thought: it would be enough to record such an operation for a few megabytes of space! However, the problem really exists here. When I set the maximum space to 7000, the problem was solved perfectly! Looking back at the log file, we found that it has grown by more than 30 mb. This is an eye open. log files are growing at an astonishing rate. No wonder there is a problem! Okay, I admit, it's just me!

Of course, the problems encountered during the process are far more than that. Here, I just picked a few silly questions to share with you. I wonder if you have encountered the same problem?

Finally, I want to say a word: child, you are still too young!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.