Skip to content

Database

Discussions on database access, SQL, and ADO

This category can be followed from the open social web via the handle database@forum.codeproject.com

17.1k Topics 61.8k Posts
  • On error resume next

    help database tutorial question career
    8
    0 Votes
    8 Posts
    0 Views
    L
    vanikanc wrote: Thank you for all your suggestions! My pleasure, hope I wasn't too rude. vanikanc wrote: It is just some inherited code, Ah, that's always a good one to include on the first post. If we see code, we assume you wrote it, and partially understand it. vanikanc wrote: There was an error entering the value, it was supposed to be 50 and the user keyed in 500000. So, the business wants us to put aside such errors and continue processing the data. On Error Resume Next indeed. That's not how engineers work; if it fails, it fails for a reason. It get's corrected or excluded beforehand, not ignored. It's how managers work; if it fails, and nothing is burning, it's not a problem. Just ship the damn product already, we'll fix the bugs later. Perhaps this would be a good time to add a validator to the entry-field of that user, and sanitize his/her input before it gets into the system. Once the value has been entered, it should be treated as "correct". You heard about Knight Capital? Seems they had an "On Error Resume Next" idea to, and the algo kept buying stocks in packages of 100 at a time, 20 to 25 times a second - for over an half hour! (Total >440 million* losses - let's just be glad they weren't a hospital and relying on that software) Ignoring errors is the worst offence in IT; the system could have skipped customer 59 for all we know. The best approach is preached by (forgive me) PHP, and it's called "do or die". Either the app does what it should do, or there's an unexpected exception - and since we cannot guarantee that the we're still working with valid data (unexpected situation, who knows what variables are loaded and not?) we have only one realistic option; let the app die. Terminate. That's always better than continuing and writing records with an outdated identity-value after an exception, and not nowing that you're corrupting a database that was still correct when the app died. *) I checked this time whether I should use million or billion. Bastard Programmer from Hell :suss: if you can't read my code, try converting it here[^]
  • Causes of Urecognized Database Format

    database security question announcement
    5
    0 Votes
    5 Posts
    0 Views
    L
    Did you use Microsoft Access in an environment where multiple users would manipulate data at the same time? Is your database on some network-share? Microsoft Access is a damn good tool to manipulate single-user local-file databases with strong reporting capabilities. It's not built to be a sharing-facility for data. If that's what you need, you'll need to switch to a real server - otherwise crap like this will happen again. Bastard Programmer from Hell :suss: if you can't read my code, try converting it here[^]
  • Replication Help

    csharp database help question
    6
    0 Votes
    6 Posts
    0 Views
    L
    I didn't supply any; the relevant sections are in the manual, and it takes some study and configuration. Bastard Programmer from Hell :suss: if you can't read my code, try converting it here[^]
  • SSRS

    database sql-server
    2
    0 Votes
    2 Posts
    0 Views
    L
    Arul R Ece wrote: I want to know the future Hang on a second, while I go fetch my crystal ball. Arul R Ece wrote: of SSRS in SQL There's a 95% chance that it will still be supported in the next five years. Anything particular that you're worried about? If not, I suggest bookmarking their blog[^]. Bastard Programmer from Hell :suss: if you can't read my code, try converting it here[^]
  • Problem with MySQL Full-Text Search

    database mysql regex help
    3
    0 Votes
    3 Posts
    1 Views
    J
    I tried it but still the same problem. I am getting result which has no relation to the string entered! here is my result: Abdul Rahma Salma Ali Jassim Jassim Rahma Jassim Rahma Mohd Jassim Maki because it's returning Jassim OR Rahma but I want Jassim AND Rahma
  • split string in MySQL

    database mysql question
    3
    0 Votes
    3 Posts
    1 Views
    J
    one more question please.. if I have the string as jassim rahma or jassim ali rahma or anything else how can split that to be: <pre>SELECT file_no, old_file_no, account_number, id_number, full_name, date_of_birth FROM patients WHERE MATCH(full_name) AGAINST('jassim' WITH QUERY EXPANSION) and MATCH(full_name) AGAINST('rahma' WITH QUERY EXPANSION) ORDER BY full_name;</pre>
  • 0 Votes
    1 Posts
    0 Views
    No one has replied
  • help with MySQL dynamic sql

    csharp database mysql sales help
    6
    0 Votes
    6 Posts
    0 Views
    L
    Invest some time here[^]. Bastard Programmer from Hell :suss: if you can't read my code, try converting it here[^]
  • 0 Votes
    1 Posts
    0 Views
    No one has replied
  • wcf

    question csharp wcf windows-admin hosting
    3
    0 Votes
    3 Posts
    0 Views
    L
    From your QA question: wcf information and web service information[^] Why is common sense not common? Never argue with an idiot. They will drag you down to their level where they are an expert. Sometimes it takes a lot of work to be lazy Please stand in front of my pistol, smile and wait for the flash - JSOP 2012
  • 0 Votes
    6 Posts
    0 Views
    R
    Hi Michael I had wondered about multiple warehouses :) In this particular case the product can exist in other warehouses, however the cost in the others does not need to be the same - only warehouse 01 and 02 must be the same. I did test your query, and it works perfectly! Thanks as I'm sure I'll need something like this in the future
  • Searching Content of Documents in Database

    database algorithms regex question
    10
    0 Votes
    10 Posts
    0 Views
    P
    Implement in the language of your choice: // universal CV parser boolean is_bullsh-t(string cv) { return true; } Cheers, Peter Software rusts. Simon Stephenson, ca 1994. So does this signature. me, 2012
  • SET NOCOUNT

    database sql-server sysadmin tutorial question
    13
    0 Votes
    13 Posts
    0 Views
    _
    Member 3487632 wrote: select statement it is giving -1 always Why you are checking the SET NOCOUNT in the case of select? Instead of that you can check your result-set rows.. Check your result-set rows for the number of rows selected.. :) Read the article "Table Valued Parameters". --Amit
  • SET NOCOUNT

    database sysadmin tutorial
    3
    0 Votes
    3 Posts
    0 Views
    U
    Hi Even then rows effected i'm getting -1 in select statement . What i'm observing is that when i put SET NOCOUNT ON before sql statement even then it is returning -1. I guess it shud return 0 . I'm having sql server 2005 . Please help. Thanks
  • Problem saving file to MySQL

    help sharepoint database mysql data-structures
    20
    0 Votes
    20 Posts
    0 Views
    L
    :) Current code & message. Bastard Programmer from Hell :suss: if you can't read my code, try converting it here[^]
  • problem modeling messages tables

    help
    5
    0 Votes
    5 Posts
    0 Views
    A
    you are right thank you very much
  • 0 Votes
    3 Posts
    0 Views
    J
    yousefshokati wrote: This produces me me a big problem Increasing session timeout so you can track users is unlikely to ever be a good idea. As one example exactly what do you think is going to happen to your system if a 'user' goes on vacation for two weeks but that user remains logged in? Also it appears that you are attempting to manage permissions by user rather than role. And that is going to become a problem with more than a couple of users.
  • SQL server 2008 Replication problem

    database csharp sql-server sysadmin help
    4
    0 Votes
    4 Posts
    0 Views
    _
    Basically with merge replication when a synchronization occurs, the final state of the rows is what is merged with the other side. So if I have a stock tracking table which each stock is updated thousands of times between synchronizations only the last value of the stock will be replicated. With transactional replication with updateable subscribers the changes (the DML) will be replicated as transactions. So if a row in our stock table is updated 1,000 times there will be 1000 indivdual transactions will be replicated. Now updateable subscribers is being deprecated and will likely not show up in SQL 11 and peer to peer is the desired upgrade path. So if you need transactions replicated transactionally you would want updateable subscribers, if you want bi-directional synschronization between nodes which are frequently disconnected - merge replication is the way to go. Read the article "Table Valued Parameters". --Amit
  • 0 Votes
    4 Posts
    0 Views
    S
    @Michael thanks for the info, I recently made a solution for this used some of your previous advice, also will consider your recent advice as it's needed.
  • SSIS and SSAS

    database sql-server security performance
    3
    0 Votes
    3 Posts
    0 Views
    J
    Member 9270499 wrote: based on the firing of a particular event Does this mean that the OLAP db have to be kept up to date immediately when the OLTP is updated? Or can it be updated in a batch?