• CELKO (3/5/2015)


    Please follow basic Netiquette and post the DDL we need to answer this. Follow industry and ANSI/ISO standards in your data. You should follow ISO-11179 rules for naming data elements. You should follow ISO-8601 rules for displaying temporal data. We need to know the data types, keys and constraints on the table. Avoid dialect in favor of ANSI/ISO Standard SQL.

    Is it possible to achieve the following ;

    Yes, and you can put a sharp stick in your eyes, too. 🙁 You will need to flatten the rows (rows are not records) , and convert this SQL into a 1950's COBOL file. It will run 2-3 orders of magnitude slower, have no data integrity, etc.

    I have a table with say ... 200 Fields [sic] and I want to check each field [sic] for a value and possibly update if a match is found.

    1. Columns are not fields; this is a fundamental concept in RDBMS :w00t:. Your mindset is locked into 1950's punch cards and mag tape files.

    2. Your next error is not knowing that SQL is a declarative language. We do not use loops and control flow structures in this language.

    something like... <<

    Why did you invent a personal language instead of showing us the SQL or T-SQL code you tried? Or have you even tried anything before asking for help?

    Look up normalization. Your vague narrative seems to say that all columns (NOT fields) are in some way interchangeable. But in RDBMS, each column is a district attribute, with a different meaning and possibly measured on totally different scale.

    Sorry for the delay, I tried to put some of my code in here (the correct way) and the firewall blocked the entire site. I got that resolved but was asked not to use "sql injection" on this site anymore :/

    Anyway I did find a solution to my problem but am unable to post it because the firewall will once again block this site and I need it for the forums and stairways.

    Thanks for your help, much appreciated