|
database
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Best way to insert data into tables without primary keysI am working on a SQL Server database in which there are no primary
keys set on the tables. I can tell what they are using for a key. It is usually named ID, has a data type of int and does not allow nulls. However, since it is not set as a primary key you can create a duplicate key. This whole thing was created by someone who is long gone. I don't know how long I will be here and I don't want to break anything. I just want to work with things the way they are. So if I want to insert a new record, and I want the key, which is named ID, to be the next number in the sequence, is there something I can do in an insert sql statement to do this? You can use MAX function to get maximum and use next number.
select MAX(Id) from T -- Show quoteThis posting is provided "AS IS" with no warranties, and confers no rights. <tomca***@gmail.com> wrote in message news:1157578420.373154.312080@m79g2000cwm.googlegroups.com... >I am working on a SQL Server database in which there are no primary > keys set on the tables. I can tell what they are using for a key. It > is usually named ID, has a data type of int and does not allow nulls. > However, since it is not set as a primary key you can create a > duplicate key. > > This whole thing was created by someone who is long gone. I don't > know how long I will be here and I don't want to break anything. I > just want to work with things the way they are. > > So if I want to insert a new record, and I want the key, which is > named ID, to be the next number in the sequence, is there something I > can do in an insert sql statement to do this? > And make sure that the ID field is indexed.
-- Show quoteArnie Rowland, Ph.D. Westwood Consulting, Inc Most good judgment comes from experience. Most experience comes from bad judgment. - Anonymous "Andrew Petrochuk [MSFT]" <andrew.petroc***@microsoft.com> wrote in message news:%23lqQI1f0GHA.1040@TK2MSFTNGP06.phx.gbl... > You can use MAX function to get maximum and use next number. > > select MAX(Id) from T > > -- > > This posting is provided "AS IS" with no warranties, and confers no > rights. > > > <tomca***@gmail.com> wrote in message > news:1157578420.373154.312080@m79g2000cwm.googlegroups.com... >>I am working on a SQL Server database in which there are no primary >> keys set on the tables. I can tell what they are using for a key. It >> is usually named ID, has a data type of int and does not allow nulls. >> However, since it is not set as a primary key you can create a >> duplicate key. >> >> This whole thing was created by someone who is long gone. I don't >> know how long I will be here and I don't want to break anything. I >> just want to work with things the way they are. >> >> So if I want to insert a new record, and I want the key, which is >> named ID, to be the next number in the sequence, is there something I >> can do in an insert sql statement to do this? >> > tomca***@gmail.com wrote:
> I am working on a SQL Server database in which there are no primary If it is that bad then maybe you'll break something just by using it.> keys set on the tables. I can tell what they are using for a key. It > is usually named ID, has a data type of int and does not allow nulls. > However, since it is not set as a primary key you can create a > duplicate key. > > This whole thing was created by someone who is long gone. I don't > know how long I will be here and I don't want to break anything. I > just want to work with things the way they are. Tread carefully. > So if I want to insert a new record, and I want the key, which is Now I'm not sure you are asking the right question. Do you mean the> named ID, to be the next number in the sequence, is there something I > can do in an insert sql statement to do this? table doesn't have a key or do you mean the table doesn't have an IDENTITY column? They are not the same thing at all. Generating an arbitrary key doesn't seem like the smartest way to proceed. -- David Portas, SQL Server MVP Whenever possible please post enough code to reproduce your problem. Including CREATE TABLE and INSERT statements usually helps. State what version of SQL Server you are using and specify the content of any error messages. SQL Server Books Online: http://msdn2.microsoft.com/library/ms130214(en-US,SQL.90).aspx -- >> I am working on a SQL Server database in which there are no primary keys set on the tables. << By definition, it is not a table at all, but a simple file written withSQL .. >> I can tell what they are using for a key. It is usually named ID, has a data type of int and does not allow nulls.<< Ah yes, the Magical, Universal "id" that God put on all things increation. To hell with ISO-11179 and metadata, to hell with Aristotle and the law of identity! >> However, since it is not set as a primary key you can create a duplicate key. << Duplicate key is an oxymoron>> This whole thing was created by someone who is long gone. I don't know how long I will be here and I don't want to break anything. << A better question; how long can an enterprise with a DB like thissurvive? I'd be updating the resume and stealing office supplies. >> > So if I want to insert a new record [sic], and I want the key, which is named ID, to be the next number in the sequence, is there something I can do in an insert statement to do this? << Rows are not anything like records; the failure of the first guy tounderstand this is why he mimiced a magnetic tape file system's record numbers instad of providing a relational key. The stinking dirty kludge is to use "SELECT MAX(id)+1 FROM Foobar" in the INSERT INTO statements. Oh, you also need to checl for dups and add a uniqueness constraint (mop the floor and fix the leak). The right answer is to re-design this system properly. >Rows are not anything like records; the failure of the first guy to I guess I'm showing my age. I wrote COBOL for the first 20 years of my>understand this is why he mimiced a magnetic tape file system's record >numbers instad of providing a relational key. programming life. Old verbal habits change slowly. But we called them records on ISAM files, long after magnetic tape files were obsolete. What exactly is the difference between a record in an ISAM file and a row in a SQL Server database? >> What exactly is the difference between a record in an ISAM file and a row in SQL << I changed your question a bit. Like most new ideas, the hard part ofunderstanding what the relational model is comes in un-learning what you know about file systems. As Artemus Ward (William Graham Sumner, 1840-1910) put it, "It ain't so much the things we don't know that get us into trouble. It's the things we know that just ain't so." If you already have a background in data processing with traditional file systems, the first things to un-learn are: (0) Databases are not file sets. (1) Tables are not files. (2) Rows are not records. (3) Columns are not fields. Modern data processing began with punch cards. The influence of the punch card lingered on long after the invention of magnetic tapes and disk for data storage. This is why early video display terminals were 80 columns across. Even today, files which were migrated from cards to magnetic tape files or disk storage still use 80 column records. But the influence was not just on the physical side of data processing. The methods for handling data from the prior media were imitated in the new media. Data processing first consisted of sorting and merging decks of punch cards (later, sequential magnetic tape files) in a series of distinct steps. The result of each step feed into the next step in the process. This leads to temp table and other tricks to mimic that kind of processing. Relational databases do not work that way. Each user connects to the entire database all at once, not to one file at time in a sequence of steps. The users might not all have the same database access rights once they are connected, however. Magnetic tapes could not be shared among users at the same time, but shared data is the point of a database. Tables versus Files A file is closely related to its physical storage media. A table may or may not be a physical file. DB2 from IBM uses one file per table, while Sybase puts several entire databases inside one file. A table is a <i>set<i> of rows of the same kind of thing. A set has no ordering and it makes no sense to ask for the first or last row. A deck of punch cards is sequential, and so are magnetic tape files. Therefore, a <i>physical<i> file of ordered sequential records also became the <i>mental<i> model for data processing and it is still hard to shake. Anytime you look at data, it is in some physical ordering. The various access methods for disk storage system came later, but even these access methods could not shake the mental model. Another conceptual difference is that a file is usually data that deals with a whole business process. A file has to have enough data in itself to support applications for that business process. Files tend to be "mixed" data which can be described by the name of the business process, such as "The Payroll file" or something like that. Tables can be either entities or relationships within a business process. This means that the data which was held in one file is often put into several tables. Tables tend to be "pure" data which can be described by single words. The payroll would now have separate tables for timecards, employees, projects and so forth. Tables as Entities An entity is physical or conceptual "thing" which has meaning be itself. A person, a sale or a product would be an example. In a relational database, an entity is defined by its attributes, which are shown as values in columns in rows in a table. To remind users that tables are sets of entities, I like to use collective or plural nouns that describe the function of the entities within the system for the names of tables. Thus "Employee" is a bad name because it is singular; "Employees" is a better name because it is plural; "Personnel" is best because it is collective and does not summon up a mental picture of individual persons. If you have tables with exactly the same structure, then they are sets of the same kind of elements. But you should have only one set for each kind of data element! Files, on the other hand, were PHYSICALLY separate units of storage which could be alike -- each tape or disk file represents a step in the PROCEDURE , such as moving from raw data, to edited data, and finally to archived data. In SQL, this should be a status flag in a table. Tables as Relationships A relationship is shown in a table by columns which reference one or more entity tables. Without the entities, the relationship has no meaning, but the relationship can have attributes of its own. For example, a show business contract might have an agent, an employer and a talent. The method of payment is an attribute of the contract itself, and not of any of the three parties. Rows versus Records Rows are not records. A record is defined in the application program which reads it; a row is defined in the database schema and not by a program at all. The name of the field in the READ or INPUT statements of the application; a row is named in the database schema. Likewise, the PHYSICAL order of the field names in the READ statement is vital (READ a,b,c is not the same as READ c, a, b; but SELECT a,b,c is the same data as SELECT c, a, b. All empty files look alike; they are a directory entry in the operating system with a name and a length of zero bytes of storage. Empty tables still have columns, constraints, security privileges and other structures, even tho they have no rows. This is in keeping with the set theoretical model, in which the empty set is a perfectly good set. The difference between SQL's set model and standard mathematical set theory is that set theory has only one empty set, but in SQL each table has a different structure, so they cannot be used in places where non-empty versions of themselves could not be used. Another characteristic of rows in a table is that they are all alike in structure and they are all the "same kind of thing" in the model. In a file system, records can vary in size, datatypes and structure by having flags in the data stream that tell the program reading the data how to interpret it. The most common examples are Pascal's variant record, C's struct syntax and Cobol's OCCURS clause. The OCCURS keyword in Cobol and the Variant records in Pascal have a number which tells the program how many time a record structure is to be repeated in the current record. Unions in 'C' are not variant records, but variant mappings for the same physical memory. For example: union x {int ival; char j[4];} myStuff; defines myStuff to be either an integer (which are 4 bytes on most modern C compilers, but this code is non-portable) or an array of 4 bytes, depending on whether you say myStuff.ival or myStuff.j[0]; But even more than that, files often contained records which were summaries of subsets of the other records -- so called control break reports. There is no requirement that the records in a file be related in any way -- they are literally a stream of binary data whose meaning is assigned by the program reading them. Columns versus Fields A field within a record is defined by the application program that reads it. A column in a row in a table is defined by the database schema. The datatypes in a column are always scalar. The order of the application program variables in the READ or INPUT statements is important because the values are read into the program variables in that order. In SQL, columns are referenced only by their names. Yes, there are shorthands like the SELECT * clause and INSERT INTO <table name> statements which expand into a list of column names in the physical order in which the column names appear within their table declaration, but these are shorthands which resolve to named lists. The use of NULLs in SQL is also unique to the language. Fields do not support a missing data marker as part of the field, record or file itself. Nor do fields have constraints which can be added to them in the record, like the DEFAULT and CHECK() clauses in SQL. Relationships among tables within a database Files are pretty passive creatures and will take whatever an application program throws at them without much objection. Files are also independent of each other simply because they are connected to one application program at a time and therefore have no idea what other files looks like. A database actively seeks to maintain the correctness of all its data. The methods used are triggers, constraints and declarative referential integrity. Declarative referential integrity (DRI) says, in effect, that data in one table has a particular relationship with data in a second (possibly the same) table. It is also possible to have the database change itself via referential actions associated with the DRI. For example, a business rule might be that we do not sell products which are not in inventory. This rule would be enforce by a REFERENCES clause on the Orders table which references the Inventory table and a referential action of ON DELETE CASCADE Triggers are a more general way of doing much the same thing as DRI. A trigger is a block of procedural code which is executed before, after or instead of an INSERT INTO or UPDATE statement. You can do anything with a trigger that you can do with DRI and more. However, there are problems with TRIGGERs. While there is a standard syntax for them in the SQL-92 standard, most vendors have not implemented it. What they have is very proprietary syntax instead. Secondly, a trigger cannot pass information to the optimizer like DRI. In the example in this section, I know that for every product number in the Orders table, I have that same product number in the Inventory table. The optimizer can use that information in setting up EXISTS() predicates and JOINs in the queries. There is no reasonable way to parse procedural trigger code to determine this relationship. The CREATE ASSERTION statement in SQL-92 will allow the database to enforce conditions on the entire database as a whole. An ASSERTION is not like a CHECK() clause, but the difference is subtle. A CHECK() clause is executed when there are rows in the table to which it is attached. If the table is empty then all CHECK() clauses are effectively TRUE. Thus, if we wanted to be sure that the Inventory table is never empty, and we wrote: CREATE TABLE Inventory ( ... CONSTRAINT inventory_not_empty CHECK ((SELECT COUNT(*) FROM Inventory) > 0), ... ); it would not work. However, we could write: CREATE ASSERTION Inventory_not_empty CHECK ((SELECT COUNT(*) FROM Inventory) > 0); and we would get the desired results. The assertion is checked at the schema level and not at the table level. Thanks for taking the time to post that CELKO. It was very helpful. I
am going to save it and read over it again tomorrow. --CELKO-- wrote: Show quote > >> What exactly is the difference between a record in an ISAM file and a row in SQL << > > I changed your question a bit. Like most new ideas, the hard part of > understanding what the relational model is comes in un-learning what > you know about file systems. As Artemus Ward (William Graham Sumner, > 1840-1910) put it, "It ain't so much the things we don't know that get > us into trouble. It's the things we know that just ain't so." > > If you already have a background in data processing with traditional > file systems, the first things to un-learn are: > > (0) Databases are not file sets. > (1) Tables are not files. > (2) Rows are not records. > (3) Columns are not fields. > > Modern data processing began with punch cards. The influence of the > punch card lingered on long after the invention of magnetic tapes and > disk for data storage. This is why early video display terminals were > 80 columns across. Even today, files which were migrated from cards to > magnetic tape files or disk storage still use 80 column records. > > But the influence was not just on the physical side of data processing. > The methods for handling data from the prior media were imitated in > the new media. > > Data processing first consisted of sorting and merging decks of punch > cards (later, sequential magnetic tape files) in a series of distinct > steps. The result of each step feed into the next step in the process. > This leads to temp table and other tricks to mimic that kind of > processing. > > Relational databases do not work that way. Each user connects to the > entire database all at once, not to one file at time in a sequence of > steps. The users might not all have the same database access rights > once they are connected, however. Magnetic tapes could not be shared > among users at the same time, but shared data is the point of a > database. > > Tables versus Files > > A file is closely related to its physical storage media. A table may > or may not be a physical file. DB2 from IBM uses one file per table, > while Sybase puts several entire databases inside one file. A table is > a <i>set<i> of rows of the same kind of thing. A set has no ordering > and it makes no sense to ask for the first or last row. > > A deck of punch cards is sequential, and so are magnetic tape files. > Therefore, a <i>physical<i> file of ordered sequential records also > became the <i>mental<i> model for data processing and it is still hard > to shake. Anytime you look at data, it is in some physical ordering. > > The various access methods for disk storage system came later, but even > these access methods could not shake the mental model. > > Another conceptual difference is that a file is usually data that deals > with a whole business process. A file has to have enough data in > itself to support applications for that business process. Files tend > to be "mixed" data which can be described by the name of the business > process, such as "The Payroll file" or something like that. > > Tables can be either entities or relationships within a business > process. This means that the data which was held in one file is often > put into several tables. Tables tend to be "pure" data which can be > described by single words. The payroll would now have separate tables > for timecards, employees, projects and so forth. > > Tables as Entities > > An entity is physical or conceptual "thing" which has meaning be > itself. A person, a sale or a product would be an example. In a > relational database, an entity is defined by its attributes, which are > shown as values in columns in rows in a table. > > To remind users that tables are sets of entities, I like to use > collective or plural nouns that describe the function of the entities > within the system for the names of tables. Thus "Employee" is a bad > name because it is singular; "Employees" is a better name because it is > plural; "Personnel" is best because it is collective and does not > summon up a mental picture of individual persons. > > If you have tables with exactly the same structure, then they are sets > of the same kind of elements. But you should have only one set for > each kind of data element! Files, on the other hand, were PHYSICALLY > separate units of storage which could be alike -- each tape or disk > file represents a step in the PROCEDURE , such as moving from raw data, > to edited data, and finally to archived data. In SQL, this should be a > status flag in a table. > > Tables as Relationships > > A relationship is shown in a table by columns which reference one or > more entity tables. Without the entities, the relationship has no > meaning, but the relationship can have attributes of its own. For > example, a show business contract might have an agent, an employer and > a talent. The method of payment is an attribute of the contract > itself, and not of any of the three parties. > > Rows versus Records > > Rows are not records. A record is defined in the application program > which reads it; a row is defined in the database schema and not by a > program at all. The name of the field in the READ or INPUT statements > of the application; a row is named in the database schema. Likewise, > the PHYSICAL order of the field names in the READ statement is vital > (READ a,b,c is not the same as READ c, a, b; but SELECT a,b,c is the > same data as SELECT c, a, b. > > All empty files look alike; they are a directory entry in the operating > system with a name and a length of zero bytes of storage. Empty tables > still have columns, constraints, security privileges and other > structures, even tho they have no rows. > > This is in keeping with the set theoretical model, in which the empty > set is a perfectly good set. The difference between SQL's set model > and standard mathematical set theory is that set theory has only one > empty set, but in SQL each table has a different structure, so they > cannot be used in places where non-empty versions of themselves could > not be used. > > Another characteristic of rows in a table is that they are all alike in > structure and they are all the "same kind of thing" in the model. In a > file system, records can vary in size, datatypes and structure by > having flags in the data stream that tell the program reading the data > how to interpret it. The most common examples are Pascal's variant > record, C's struct syntax and Cobol's OCCURS clause. > > The OCCURS keyword in Cobol and the Variant records in Pascal have a > number which tells the program how many time a record structure is to > be repeated in the current record. > > Unions in 'C' are not variant records, but variant mappings for the > same physical memory. For example: > > union x {int ival; char j[4];} myStuff; > > defines myStuff to be either an integer (which are 4 bytes on most > modern C compilers, but this code is non-portable) or an array of 4 > bytes, depending on whether you say myStuff.ival or myStuff.j[0]; > > But even more than that, files often contained records which were > summaries of subsets of the other records -- so called control break > reports. There is no requirement that the records in a file be related > in any way -- they are literally a stream of binary data whose meaning > is assigned by the program reading them. > > Columns versus Fields > > A field within a record is defined by the application program that > reads it. A column in a row in a table is defined by the database > schema. The datatypes in a column are always scalar. > > The order of the application program variables in the READ or INPUT > statements is important because the values are read into the program > variables in that order. In SQL, columns are referenced only by their > names. Yes, there are shorthands like the SELECT * clause and INSERT > INTO <table name> statements which expand into a list of column names > in the physical order in which the column names appear within their > table declaration, but these are shorthands which resolve to named > lists. > > The use of NULLs in SQL is also unique to the language. Fields do not > support a missing data marker as part of the field, record or file > itself. Nor do fields have constraints which can be added to them in > the record, like the DEFAULT and CHECK() clauses in SQL. > > Relationships among tables within a database > > Files are pretty passive creatures and will take whatever an > application program throws at them without much objection. Files are > also independent of each other simply because they are connected to one > application program at a time and therefore have no idea what other > files looks like. > > A database actively seeks to maintain the correctness of all its data. > The methods used are triggers, constraints and declarative referential > integrity. > > Declarative referential integrity (DRI) says, in effect, that data in > one table has a particular relationship with data in a second (possibly > the same) table. It is also possible to have the database change > itself via referential actions associated with the DRI. > > For example, a business rule might be that we do not sell products > which are not in inventory. This rule would be enforce by a REFERENCES > clause on the Orders table which references the Inventory table and a > referential action of ON DELETE CASCADE > > Triggers are a more general way of doing much the same thing as DRI. A > trigger is a block of procedural code which is executed before, after > or instead of an INSERT INTO or UPDATE statement. You can do anything > with a trigger that you can do with DRI and more. > > However, there are problems with TRIGGERs. While there is a standard > syntax for them in the SQL-92 standard, most vendors have not > implemented it. What they have is very proprietary syntax instead. > Secondly, a trigger cannot pass information to the optimizer like DRI. > In the example in this section, I know that for every product number in > the Orders table, I have that same product number in the Inventory > table. The optimizer can use that information in setting up EXISTS() > predicates and JOINs in the queries. There is no reasonable way to > parse procedural trigger code to determine this relationship. > > The CREATE ASSERTION statement in SQL-92 will allow the database to > enforce conditions on the entire database as a whole. An ASSERTION is > not like a CHECK() clause, but the difference is subtle. A CHECK() > clause is executed when there are rows in the table to which it is > attached. If the table is empty then all CHECK() clauses are > effectively TRUE. Thus, if we wanted to be sure that the Inventory > table is never empty, and we wrote: > > CREATE TABLE Inventory > ( ... > CONSTRAINT inventory_not_empty > CHECK ((SELECT COUNT(*) FROM Inventory) > 0), ... ); > > it would not work. However, we could write: > > CREATE ASSERTION Inventory_not_empty > CHECK ((SELECT COUNT(*) FROM Inventory) > 0); > > and we would get the desired results. The assertion is checked at the > schema level and not at the table level. >> Thanks for taking the time to post that CELKO. It was very helpful. I am going to save it and read over it again tomorrow. << I recommend booze with some of my posting :)Seriously, RDBMS is a *major* paradigm shift (remember that buzz word?) from files. If you want some help, try to find a copy of my DATA & DATABASES. It is a look at foundations that is not a ton of math and theory. When you go to Newsgroups, you most often get a kludge. One of my old stock postings was that if someone asked "What is the best rock to pound screws into fine furniture?" in a woodworker's newgroup, they would be told "Granite! cheap, hard, easy to find!" instead of being told "There is this thing called a screwdriver ..." Whart scares me is that sooooo many kids posting just want the kludge and not the right answer. And when you point out that what they are doing is wrong, they get pissed off at you. Try this article: http://www.apa.org/journals/psp/psp7761121.html Journal of Personality and Social Psychology Selected Article © 1999 by the American Psychological Association For personal use only--not for distribution December 1999 Vol. 77, No. 6, 1121-1134 ------------------------------------------------------------------------ Unskilled and Unaware of It: How Difficulties in Recognizing One's Own Incompetence Lead to Inflated Self-Assessments Justin Kruger and David Dunning Department of Psychology Cornell University Abstract: People tend to hold overly favorable views of their abilities in many social and intellectual domains. The authors suggest that this overestimation occurs, in part, because people who are unskilled in these domains suffer a dual burden: Not only do these people reach erroneous conclusions and make unfortunate choices, but their incompetence robs them of the metacognitive ability to realize it. Across 4 studies, the authors found that participants scoring in the bottom quartile on tests of humor, grammar, and logic grossly overestimated their test performance and ability. Although their test scores put them in the 12th percentile, they estimated themselves to be in the 62nd. Several analyses linked this miscalibration to deficits in metacognitive skill, or the capacity to distinguish accuracy from error. Paradoxically, improving the skills of participants, and thus increasing their metacognitive competence, helped them recognize the limitations of their abilities. Joe,
Thanks for this post. I have read your articles in the past, and at least one on this topic, but this is much more comprehensive than what I have come accross previously. For the record, folks don't usually get pissed off because they are told that their approach or outlook is wrong, but rather because of how they are told. Too often your advise makes it sound like someone doing something wrong is incompetent, as opposed to "still learning". Most folks don't mind someone pointing out that they can learn more and improve their work/abilities/knowledge. They do tend to get offended if they are told they are incompetent and should not be allowed to do their job until they learn the right way. Although that may sometimes be the case, in most jobs today you learn as you go. Few of us in the field have degrees in our particular area, and few companies are willing to invest the time and money into the training necessary to create the sort of expertise that you expect. Most of us simply work in IT and learn different technologies (programming, OS, database, etc.) as the job requires. I have personally done everything from Excell and Access to PeopleSoft and SQR to javascript and ASP to Oracle and SQL Server and more, because that is what the job required at the time. Most of my coworkers over the years have been in the same boat, and out of 50 or 60 developers and DBAs, only a handful actually went to school for what they do (my degree is in business administration). Our business dictates that folks learn new things and change their focus constantly. Only consultants like yourself have the luxury of focusing one subject in order to learn it so completely, the rest of us do the best we can with the resources available. "--CELKO--" <jcelko***@earthlink.net> wrote in message row in SQL <<news:1157590838.257552.157090@e3g2000cwe.googlegroups.com... > >> What exactly is the difference between a record in an ISAM file and a Show quote > > I changed your question a bit. Like most new ideas, the hard part of > understanding what the relational model is comes in un-learning what > you know about file systems. As Artemus Ward (William Graham Sumner, > 1840-1910) put it, "It ain't so much the things we don't know that get > us into trouble. It's the things we know that just ain't so." > > If you already have a background in data processing with traditional > file systems, the first things to un-learn are: > > (0) Databases are not file sets. > (1) Tables are not files. > (2) Rows are not records. > (3) Columns are not fields. > > Modern data processing began with punch cards. The influence of the > punch card lingered on long after the invention of magnetic tapes and > disk for data storage. This is why early video display terminals were > 80 columns across. Even today, files which were migrated from cards to > magnetic tape files or disk storage still use 80 column records. > > But the influence was not just on the physical side of data processing. > The methods for handling data from the prior media were imitated in > the new media. > > Data processing first consisted of sorting and merging decks of punch > cards (later, sequential magnetic tape files) in a series of distinct > steps. The result of each step feed into the next step in the process. > This leads to temp table and other tricks to mimic that kind of > processing. > > Relational databases do not work that way. Each user connects to the > entire database all at once, not to one file at time in a sequence of > steps. The users might not all have the same database access rights > once they are connected, however. Magnetic tapes could not be shared > among users at the same time, but shared data is the point of a > database. > > Tables versus Files > > A file is closely related to its physical storage media. A table may > or may not be a physical file. DB2 from IBM uses one file per table, > while Sybase puts several entire databases inside one file. A table is > a <i>set<i> of rows of the same kind of thing. A set has no ordering > and it makes no sense to ask for the first or last row. > > A deck of punch cards is sequential, and so are magnetic tape files. > Therefore, a <i>physical<i> file of ordered sequential records also > became the <i>mental<i> model for data processing and it is still hard > to shake. Anytime you look at data, it is in some physical ordering. > > The various access methods for disk storage system came later, but even > these access methods could not shake the mental model. > > Another conceptual difference is that a file is usually data that deals > with a whole business process. A file has to have enough data in > itself to support applications for that business process. Files tend > to be "mixed" data which can be described by the name of the business > process, such as "The Payroll file" or something like that. > > Tables can be either entities or relationships within a business > process. This means that the data which was held in one file is often > put into several tables. Tables tend to be "pure" data which can be > described by single words. The payroll would now have separate tables > for timecards, employees, projects and so forth. > > Tables as Entities > > An entity is physical or conceptual "thing" which has meaning be > itself. A person, a sale or a product would be an example. In a > relational database, an entity is defined by its attributes, which are > shown as values in columns in rows in a table. > > To remind users that tables are sets of entities, I like to use > collective or plural nouns that describe the function of the entities > within the system for the names of tables. Thus "Employee" is a bad > name because it is singular; "Employees" is a better name because it is > plural; "Personnel" is best because it is collective and does not > summon up a mental picture of individual persons. > > If you have tables with exactly the same structure, then they are sets > of the same kind of elements. But you should have only one set for > each kind of data element! Files, on the other hand, were PHYSICALLY > separate units of storage which could be alike -- each tape or disk > file represents a step in the PROCEDURE , such as moving from raw data, > to edited data, and finally to archived data. In SQL, this should be a > status flag in a table. > > Tables as Relationships > > A relationship is shown in a table by columns which reference one or > more entity tables. Without the entities, the relationship has no > meaning, but the relationship can have attributes of its own. For > example, a show business contract might have an agent, an employer and > a talent. The method of payment is an attribute of the contract > itself, and not of any of the three parties. > > Rows versus Records > > Rows are not records. A record is defined in the application program > which reads it; a row is defined in the database schema and not by a > program at all. The name of the field in the READ or INPUT statements > of the application; a row is named in the database schema. Likewise, > the PHYSICAL order of the field names in the READ statement is vital > (READ a,b,c is not the same as READ c, a, b; but SELECT a,b,c is the > same data as SELECT c, a, b. > > All empty files look alike; they are a directory entry in the operating > system with a name and a length of zero bytes of storage. Empty tables > still have columns, constraints, security privileges and other > structures, even tho they have no rows. > > This is in keeping with the set theoretical model, in which the empty > set is a perfectly good set. The difference between SQL's set model > and standard mathematical set theory is that set theory has only one > empty set, but in SQL each table has a different structure, so they > cannot be used in places where non-empty versions of themselves could > not be used. > > Another characteristic of rows in a table is that they are all alike in > structure and they are all the "same kind of thing" in the model. In a > file system, records can vary in size, datatypes and structure by > having flags in the data stream that tell the program reading the data > how to interpret it. The most common examples are Pascal's variant > record, C's struct syntax and Cobol's OCCURS clause. > > The OCCURS keyword in Cobol and the Variant records in Pascal have a > number which tells the program how many time a record structure is to > be repeated in the current record. > > Unions in 'C' are not variant records, but variant mappings for the > same physical memory. For example: > > union x {int ival; char j[4];} myStuff; > > defines myStuff to be either an integer (which are 4 bytes on most > modern C compilers, but this code is non-portable) or an array of 4 > bytes, depending on whether you say myStuff.ival or myStuff.j[0]; > > But even more than that, files often contained records which were > summaries of subsets of the other records -- so called control break > reports. There is no requirement that the records in a file be related > in any way -- they are literally a stream of binary data whose meaning > is assigned by the program reading them. > > Columns versus Fields > > A field within a record is defined by the application program that > reads it. A column in a row in a table is defined by the database > schema. The datatypes in a column are always scalar. > > The order of the application program variables in the READ or INPUT > statements is important because the values are read into the program > variables in that order. In SQL, columns are referenced only by their > names. Yes, there are shorthands like the SELECT * clause and INSERT > INTO <table name> statements which expand into a list of column names > in the physical order in which the column names appear within their > table declaration, but these are shorthands which resolve to named > lists. > > The use of NULLs in SQL is also unique to the language. Fields do not > support a missing data marker as part of the field, record or file > itself. Nor do fields have constraints which can be added to them in > the record, like the DEFAULT and CHECK() clauses in SQL. > > Relationships among tables within a database > > Files are pretty passive creatures and will take whatever an > application program throws at them without much objection. Files are > also independent of each other simply because they are connected to one > application program at a time and therefore have no idea what other > files looks like. > > A database actively seeks to maintain the correctness of all its data. > The methods used are triggers, constraints and declarative referential > integrity. > > Declarative referential integrity (DRI) says, in effect, that data in > one table has a particular relationship with data in a second (possibly > the same) table. It is also possible to have the database change > itself via referential actions associated with the DRI. > > For example, a business rule might be that we do not sell products > which are not in inventory. This rule would be enforce by a REFERENCES > clause on the Orders table which references the Inventory table and a > referential action of ON DELETE CASCADE > > Triggers are a more general way of doing much the same thing as DRI. A > trigger is a block of procedural code which is executed before, after > or instead of an INSERT INTO or UPDATE statement. You can do anything > with a trigger that you can do with DRI and more. > > However, there are problems with TRIGGERs. While there is a standard > syntax for them in the SQL-92 standard, most vendors have not > implemented it. What they have is very proprietary syntax instead. > Secondly, a trigger cannot pass information to the optimizer like DRI. > In the example in this section, I know that for every product number in > the Orders table, I have that same product number in the Inventory > table. The optimizer can use that information in setting up EXISTS() > predicates and JOINs in the queries. There is no reasonable way to > parse procedural trigger code to determine this relationship. > > The CREATE ASSERTION statement in SQL-92 will allow the database to > enforce conditions on the entire database as a whole. An ASSERTION is > not like a CHECK() clause, but the difference is subtle. A CHECK() > clause is executed when there are rows in the table to which it is > attached. If the table is empty then all CHECK() clauses are > effectively TRUE. Thus, if we wanted to be sure that the Inventory > table is never empty, and we wrote: > > CREATE TABLE Inventory > ( ... > CONSTRAINT inventory_not_empty > CHECK ((SELECT COUNT(*) FROM Inventory) > 0), ... ); > > it would not work. However, we could write: > > CREATE ASSERTION Inventory_not_empty > CHECK ((SELECT COUNT(*) FROM Inventory) > 0); > > and we would get the desired results. The assertion is checked at the > schema level and not at the table level. > >> ...if they are told they are incompetent and should not be allowed to do Not to support reckless rants, but regarding the above statement, that is >> their job until they learn the right way. what should be done though, right? Of course, there are shops that allows on the job training assuming all potential risks. But being a professional, isn't it one's obligation to learn the right way before doing his/her job? None among us would approve of an incompetent doctor practicing medicine until they learn the right way. Or an incompetent builder building bridges or a bad mechanic fixing cars for that matter. So why is it considered offensive in the IT field? -- Anith The difference is doctors specialize in what they do, and that is all that
they do. In business, people are called upon to fill a variety of roles, even more so in IT. People only go to a doctor when they have specific issues or needs. Companies rely on their IT department every day, for every need. As technology changes IT shops adopt new technologies, and people's responsabilities change. One day you are writing reports and developing applications within an ERP system using their tools, the next you are writing ASP and dynamic HTML to implement that same ERP's cutting edge (bleeding edge) web access technology. A few months later that technology is thrown away and now you are developing in ASP.Net and everything you know about classic ASP is useless. Then your application gets outsourced and they throw you into a DBA role. Technology demands frequent change. If you don't change you become an obsolete expert overnight. If you do change you become a jack of all trades, master of none. Companies have a tendency to demand the latter and avoid the former. When they want an expert, they hire a consultant, not a permanent employee. Show quote "Anith Sen" <an***@bizdatasolutions.com> wrote in message news:OiFMU%23p0GHA.2036@TK2MSFTNGP05.phx.gbl... > >> ...if they are told they are incompetent and should not be allowed to do > >> their job until they learn the right way. > > Not to support reckless rants, but regarding the above statement, that is > what should be done though, right? Of course, there are shops that allows > on the job training assuming all potential risks. But being a professional, > isn't it one's obligation to learn the right way before doing his/her job? > > None among us would approve of an incompetent doctor practicing medicine > until they learn the right way. Or an incompetent builder building bridges > or a bad mechanic fixing cars for that matter. So why is it considered > offensive in the IT field? > > -- > Anith > > Doctors and engineers have 'practices', it's only the lowly car mechanic
that we expect to 'know everything'. Otherwise, we are all 'always' practicing our craft. However, I will grant that perhaps you too know absolutely everything and do not require any 'practice'! -- Show quoteArnie Rowland, Ph.D. Westwood Consulting, Inc Most good judgment comes from experience. Most experience comes from bad judgment. - Anonymous "Anith Sen" <an***@bizdatasolutions.com> wrote in message news:OiFMU%23p0GHA.2036@TK2MSFTNGP05.phx.gbl... >>> ...if they are told they are incompetent and should not be allowed to do >>> their job until they learn the right way. > > Not to support reckless rants, but regarding the above statement, that is > what should be done though, right? Of course, there are shops that allows > on the job training assuming all potential risks. But being a > professional, isn't it one's obligation to learn the right way before > doing his/her job? > > None among us would approve of an incompetent doctor practicing medicine > until they learn the right way. Or an incompetent builder building bridges > or a bad mechanic fixing cars for that matter. So why is it considered > offensive in the IT field? > > -- > Anith > >> Otherwise, we are all 'always' practicing our craft. However, I will Are you pretending to be dumb or a real idiot? Who said anything about >> grant that perhaps you too know absolutely everything and do not require >> any 'practice'! knowing everything? Are you thick enough to ignore the difference between someone wrecking a system without knowing the fundamentals of his trade and someone who realize the systemic limitations around him, yet strive to be competent? -- Anith Anith,
Stooping to 'name calling' is something for which I had not given you credit. You've certainly lowered your 'esteem' in my, and hopefully, others minds. That was completely uncalled for, and extremely 'unprofessional' -- Show quoteArnie Rowland, Ph.D. Westwood Consulting, Inc Most good judgment comes from experience. Most experience comes from bad judgment. - Anonymous "Anith Sen" <an***@bizdatasolutions.com> wrote in message news:%237iY6br0GHA.1536@TK2MSFTNGP02.phx.gbl... >>> Otherwise, we are all 'always' practicing our craft. However, I will >>> grant that perhaps you too know absolutely everything and do not require >>> any 'practice'! > > Are you pretending to be dumb or a real idiot? Who said anything about > knowing everything? Are you thick enough to ignore the difference between > someone wrecking a system without knowing the fundamentals of his trade > and someone who realize the systemic limitations around him, yet strive to > be competent? > > -- > Anith > Apologies for the knee-jerk response. Didn't mean to come across that rude.
Wish I had read it twice before hitting the send button... Sorry :-( -- Anith who do you mean by "us" in your statement "None among us would approve
of an incompetent doctor practicing medicine until they learn the right way". The very idea that there is only one right way to practice medicine does not have 100% support anywhere in the world to put it mildly. If you spend some time studying the history of medicine, you will easily come up with hundreds of examples when "the rigth way" in medicine makes 180 degree turns in half no time. In database design and programming there is no such thing as the only one right way either... >> The very idea that there is only one right way to practice medicine does not have 100% support anywhere in the world to put it mildly. << The huge advantage we have in IT over medical sciences is a branch ofmathematics. We are supposed to be part of engineering and hard science. Computer Science is a branch of math, not biology, sciology, etc. The cowboy coder is the one who says he is being creative and does not need to justify his work, like a beatnik painter. The truth is tha the does not know the basics. >> ... and programming there is no such thing as the only one right way either. << I disagree with that sentiment. When there are two or more ways, theycan be logically compared and measured -- O(n) versus O(n^2) and all that jazz. Remember Zohar Manna, Ed Dijkstra, David Gries, et al and the correctness proofs of programs? 30+ years of RM theory and proofs? Coupling and cohesion as basic engineering principles? You can prove a theorem many ways, but only a few will be elegant -- a mathematical term that means they use the fewest axioms, use shortest steps and are obvious to the reader. But more often than not, SQL newbies do not sovle the problem at all -- they allow bad data in the schema and it is slow. Slow and correct is better than fast and wrong. They miss both points. It's actually good that you've mentioned mathematics. In mathematics,
you choose a set of axioms and use logic to derive your conclusions. So, if somebody else chooses a different set of axioms and comes at different conclusions, that does not - repeat, not - mean bad mathematics. A professional mathematician will not call another mathematician a bad mathematician if the other one has chosen different axioms, used correct logic, and arrived at different conclusions - as long as the logic is correct, of course. For instance, Lobachevskij had used a set of axioms quite different from Euclid's, and Lobachevskij's conclusions were quite different. However, AFAIK Lobachevskij has never ever called Euclid a bad mathematician. However I disagree that IT "is a branch of mathematics". I think IT is a branch of business that uses applied mathematics. As such, different sets of axioms are not equal. For instance, you seem to always stick to some axioms such as - there must be a middle tier - portability is of paramount importance and, first of all IMO these axioms make perfect sense if it is a big huge enterprise, a large corporation. In other cases they may just not apply. Suppose once in a while I am using a different set of axioms, because it better fits my situation at hand, such as - expected turnaround (the time between the customer got an idea and the solution has been deployed) is one week - expected lifespan of the solution is at most 3 months Suppose I have used waterproof logic and arrived at some conclusions: - there will be no middle tier *in this particular case* - I will not care about portability *in this particular case* In mathematics, I am free to choose my set of axioms. As long as my logic is correct, my mathematics is just as good as anybody else's. Even if my conclusions are, say, non-conformist. In business, I am getting a lot of valuable feedback indicating if my choice of axioms actually helps my customers make money. Makes sense? Alexander,
How do you say "flogging a dead horse" in whatever language you desire... Dinosaurs don't move very easily -they are fossilized! -- Show quoteArnie Rowland, Ph.D. Westwood Consulting, Inc Most good judgment comes from experience. Most experience comes from bad judgment. - Anonymous "Alexander Kuznetsov" <AK_TIREDOFSPAM@hotmail.COM> wrote in message news:1157738017.901655.239680@b28g2000cwb.googlegroups.com... > It's actually good that you've mentioned mathematics. In mathematics, > you choose a set of axioms and use logic to derive your conclusions. > So, if somebody else chooses a different set of axioms and comes at > different conclusions, that does not - repeat, not - mean bad > mathematics. > A professional mathematician will not call another mathematician a bad > mathematician if the other one has chosen different axioms, > used correct logic, and arrived at different conclusions - as long as > the logic is correct, of course. > For instance, Lobachevskij had used a set of axioms quite different > from Euclid's, and Lobachevskij's conclusions were quite different. > However, AFAIK Lobachevskij has never ever called Euclid a bad > mathematician. > > However I disagree that IT "is a branch of mathematics". I think IT is > a branch of business that uses applied mathematics. As such, > different sets of axioms are not equal. For instance, you seem to > always stick to some axioms such as > - there must be a middle tier > - portability is of paramount importance > and, first of all > IMO these axioms make perfect sense if it is a big huge enterprise, a > large corporation. In other cases they may just not apply. > > Suppose once in a while I am using a different set of axioms, because > it better fits my situation at hand, such as > - expected turnaround (the time between the customer got an idea and > the solution has been deployed) is one week > - expected lifespan of the solution is at most 3 months > > Suppose I have used waterproof logic and arrived at some conclusions: > - there will be no middle tier *in this particular case* > - I will not care about portability *in this particular case* > > In mathematics, I am free to choose my set of axioms. As long as my > logic is correct, my mathematics is just as good as anybody else's. > Even if my conclusions are, say, non-conformist. > In business, I am getting a lot of valuable feedback indicating if my > choice of axioms actually helps my customers make money. > > Makes sense? > Another bigger question. There were two comment earlier that really
made me think: "If it is that bad then maybe you'll break something just by using it. Tread carefully." "A better question; how long can an enterprise with a DB like this survive? I'd be updating the resume and stealing office supplies." I am wondering the same thing myself. There are 40 people working at this company and they depend on the database for their work. It has been up and running for some time, but I don't know how screwed up it could get if I start making changes. If the whole thing crashes I will be blamed. I am not sure how to proceed. I like the guy who owns the company and would like to help him out. I am thinking of bringing in someone who is more on top of the technology to give us a second opinon. I just came out of retirement a few months ago and don't want to wreck someone's business. Then again I could just tell him I don't think I'm qualified to solve his problem and leave. I have only been there three days. What would you do in my position? tom c wrote: Show quote > >Rows are not anything like records; the failure of the first guy to > >understand this is why he mimiced a magnetic tape file system's record > >numbers instad of providing a relational key. > > I guess I'm showing my age. I wrote COBOL for the first 20 years of my > programming life. Old verbal habits change slowly. But we called them > records on ISAM files, long after magnetic tape files were obsolete. > > What exactly is the difference between a record in an ISAM file and a > row in a SQL Server database? Tell them the truth - as you see it the system needs improvements. If you
decide not to make them, then suggest bringing someone else in to help. If they can't handle the truth you can still leave (without breaking anything). ML --- http://milambda.blogspot.com/ I understand that there are no constraints preventing duplicate keys.
The question is, ARE there duplicates in fact? If there are not, it would appear that the application was written well enough to at least not screw that up. And IF there are NO duplicates, I would seriously consider defining the keys (or unique constraints, or unique indexes) now. Yes, it is possible that it will cause problems, but if the data is clean now the odds may be with you. Worth thinking about, anyway. I worked for a while extracting data from a package, JD Edwards, on an AS/400, and putting it in a data warehouse. I could find NO "table" (files really, despite using DB2) in that database that had any unique contraint defined. NONE. For some of the tables, such as invoice items (!), this was pure hell. For other tables, such as the Address Book, it did not matter that there was no constraint because the data was clean anyway. (For some reason the vendor ran into problems porting the application to SQL Server or Oracle or some such relational-only RDBMS.) Roy Harvey Beacon Falls, CT On 6 Sep 2006 14:33:40 -0700, tomca***@gmail.com wrote: Show quote >I am working on a SQL Server database in which there are no primary >keys set on the tables. I can tell what they are using for a key. It >is usually named ID, has a data type of int and does not allow nulls. >However, since it is not set as a primary key you can create a >duplicate key. > >This whole thing was created by someone who is long gone. I don't >know how long I will be here and I don't want to break anything. I >just want to work with things the way they are. > >So if I want to insert a new record, and I want the key, which is >named ID, to be the next number in the sequence, is there something I >can do in an insert sql statement to do this? I think I am getting in over
my head. I was retired and decided to do this because I thought it would be interesting and fun. This was supposed to be a low pressure part time job where I set my own hours and do minor enhancements to his system. Now it is a major fix, which could be very high pressure, since 40 people are dependent on this thing to work every day if they are going to have jobs. I think I am going to tell him it is too big a job for me, and I will help him hire a more skilled full time person. Maybe I can still end up working there part time, helping the full time person. The other thing I am wondering about is legal liability. I am doing this as a contractor, not an employee. I am not a LLC. I think that leaves me open to being sued if he thinks I made his system crash and put him out of business. The legal concern is definitely one to give consideration.
Should you continue, I highly recommend obtaining "Error and Omissions" insurance ASAP. As you indicate, the personal risks can be very high. -- Show quoteArnie Rowland, Ph.D. Westwood Consulting, Inc Most good judgment comes from experience. Most experience comes from bad judgment. - Anonymous "tom c" <tomca***@gmail.com> wrote in message news:1157599354.566386.190220@p79g2000cwp.googlegroups.com... >I think I am getting in over > my head. I was retired and decided to do this because I thought it > would be interesting and fun. This was supposed to be a low pressure > part time job where I set my own hours and do minor enhancements to his > system. Now it is a major fix, which could be very high pressure, > since 40 people are dependent on this thing to work every day if they > are going to have jobs. I think I am going to tell him it is too big > a job for me, and I will help him hire a more skilled full time person. > Maybe I can still end up working there part time, helping the full > time person. > > The other thing I am wondering about is legal liability. I am doing > this as a contractor, not an employee. I am not a LLC. I think that > leaves me open to being sued if he thinks I made his system crash and > put him out of business. > I will look into insurance if I continue, but I had thought that a
contract that said I was not responsible would be enough. Arnie Rowland wrote: Show quote > The legal concern is definitely one to give consideration. > > Should you continue, I highly recommend obtaining "Error and Omissions" > insurance ASAP. As you indicate, the personal risks can be very high. > > -- > Arnie Rowland, Ph.D. > Westwood Consulting, Inc > > Most good judgment comes from experience. > Most experience comes from bad judgment. > - Anonymous > > > "tom c" <tomca***@gmail.com> wrote in message > news:1157599354.566386.190220@p79g2000cwp.googlegroups.com... > >I think I am getting in over > > my head. I was retired and decided to do this because I thought it > > would be interesting and fun. This was supposed to be a low pressure > > part time job where I set my own hours and do minor enhancements to his > > system. Now it is a major fix, which could be very high pressure, > > since 40 people are dependent on this thing to work every day if they > > are going to have jobs. I think I am going to tell him it is too big > > a job for me, and I will help him hire a more skilled full time person. > > Maybe I can still end up working there part time, helping the full > > time person. > > > > The other thing I am wondering about is legal liability. I am doing > > this as a contractor, not an employee. I am not a LLC. I think that > > leaves me open to being sued if he thinks I made his system crash and > > put him out of business. > > Contracts are "full employment programs" for attorneys.
There are 'contracts' and then there are certain non-contractible issues, such as "due diligence", "reasonable care", "professional advice", etc. Regardless of how good your contract may appear, when lawyers get involved, it will cost you a lot of money -even if you ultimately prevail. With insurance, the insurer pays the legal fees. You have to broaden you concept of E&O insurance to think of it a 'pre-paid' legal fees. -- Show quoteArnie Rowland, Ph.D. Westwood Consulting, Inc Most good judgment comes from experience. Most experience comes from bad judgment. - Anonymous "tom c" <tomca***@gmail.com> wrote in message news:1157635713.631092.4540@e3g2000cwe.googlegroups.com... >I will look into insurance if I continue, but I had thought that a > contract that said I was not responsible would be enough. > > > Arnie Rowland wrote: >> The legal concern is definitely one to give consideration. >> >> Should you continue, I highly recommend obtaining "Error and Omissions" >> insurance ASAP. As you indicate, the personal risks can be very high. >> >> -- >> Arnie Rowland, Ph.D. >> Westwood Consulting, Inc >> >> Most good judgment comes from experience. >> Most experience comes from bad judgment. >> - Anonymous >> >> >> "tom c" <tomca***@gmail.com> wrote in message >> news:1157599354.566386.190220@p79g2000cwp.googlegroups.com... >> >I think I am getting in over >> > my head. I was retired and decided to do this because I thought it >> > would be interesting and fun. This was supposed to be a low pressure >> > part time job where I set my own hours and do minor enhancements to his >> > system. Now it is a major fix, which could be very high pressure, >> > since 40 people are dependent on this thing to work every day if they >> > are going to have jobs. I think I am going to tell him it is too big >> > a job for me, and I will help him hire a more skilled full time person. >> > Maybe I can still end up working there part time, helping the full >> > time person. >> > >> > The other thing I am wondering about is legal liability. I am doing >> > this as a contractor, not an employee. I am not a LLC. I think that >> > leaves me open to being sued if he thinks I made his system crash and >> > put him out of business. >> > > >> The other thing I am wondering about is legal liability. I am doing this as a contractor, not an employee. I am not a LLC. I think that leaves me open to being sued if he thinks I made his system crash and put him out of business. << My financial services company (USAA) has written $1 Million policiesfor me in such situations. The only thing they required was that I not work on medical systems where human life was involved. You might also remind them that the boss can go to jail if an audit fails. Let's all hear it for Enron, et al !! So what does a $1 Million "Error and Omissions" policy cost?
--CELKO-- wrote: Show quote > >> The other thing I am wondering about is legal liability. I am doing this as a contractor, not an employee. I am not a LLC. I think that leaves me open to being sued if he thinks I made his system crash and put him out of business. << > > My financial services company (USAA) has written $1 Million policies > for me in such situations. The only thing they required was that I not > work on medical systems where human life was involved. > > You might also remind them that the boss can go to jail if an audit > fails. Let's all hear it for Enron, et al !! >> So what does a $1 Million "Error and Omissions" policy cost? << You have to contact your agent to find out. It depends on what you aredoing, what your reputation is, etc. MIne was dirt cheap. I have been with my company since I was born (literally!) and have everything (house, cars, credit cards, 401-k, checking, etc.) with them, so you might not do as well as I did. I think you are in the UK Tom?
Check out Professional Indeminity cover - www.insuredrisks.co.uk (Hiscox Insurance) for instance; for £250K it cost me £196 a year. Tony. -- Show quoteTony Rogerson SQL Server MVP http://sqlblogcasts.com/blogs/tonyrogerson - technical commentary from a SQL Server Consultant http://sqlserverfaq.com - free video tutorials "tom c" <tomca***@gmail.com> wrote in message news:1157653825.299057.245540@m73g2000cwd.googlegroups.com... > So what does a $1 Million "Error and Omissions" policy cost? > > > > --CELKO-- wrote: >> >> The other thing I am wondering about is legal liability. I am doing >> >> this as a contractor, not an employee. I am not a LLC. I think that >> >> leaves me open to being sued if he thinks I made his system crash and >> >> put him out of business. << >> >> My financial services company (USAA) has written $1 Million policies >> for me in such situations. The only thing they required was that I not >> work on medical systems where human life was involved. >> >> You might also remind them that the boss can go to jail if an audit >> fails. Let's all hear it for Enron, et al !! > Unfortunately, in the US, $450K would just be enough to get the lawyers
salivating. Our legal system is all about making money for attorneys -not about equality and justice. -- Show quoteArnie Rowland, Ph.D. Westwood Consulting, Inc Most good judgment comes from experience. Most experience comes from bad judgment. - Anonymous "Tony Rogerson" <tonyroger***@sqlserverfaq.com> wrote in message news:eP52few0GHA.4972@TK2MSFTNGP03.phx.gbl... >I think you are in the UK Tom? > > Check out Professional Indeminity cover - www.insuredrisks.co.uk (Hiscox > Insurance) for instance; for £250K it cost me £196 a year. > > Tony. > > -- > Tony Rogerson > SQL Server MVP > http://sqlblogcasts.com/blogs/tonyrogerson - technical commentary from a > SQL Server Consultant > http://sqlserverfaq.com - free video tutorials > > > "tom c" <tomca***@gmail.com> wrote in message > news:1157653825.299057.245540@m73g2000cwd.googlegroups.com... >> So what does a $1 Million "Error and Omissions" policy cost? >> >> >> >> --CELKO-- wrote: >>> >> The other thing I am wondering about is legal liability. I am doing >>> >> this as a contractor, not an employee. I am not a LLC. I think that >>> >> leaves me open to being sued if he thinks I made his system crash and >>> >> put him out of business. << >>> >>> My financial services company (USAA) has written $1 Million policies >>> for me in such situations. The only thing they required was that I not >>> work on medical systems where human life was involved. >>> >>> You might also remind them that the boss can go to jail if an audit >>> fails. Let's all hear it for Enron, et al !! >> > > |
|||||||||||||||||||||||