![]() | |
![]() |
| | Thread Tools | Search this Thread | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I want to store some application-wide data in my database. The table that stores this will store the different data in each field, and there will only need to be one record. Since there will only be one record, I haven't bothered to add a key (primary or otherwise). This seems to work fine but I'm trying to figure out what my SQL UPDATE statement would look like. The first time my code runs, I guess I need to create the single record. But, once created, I don't want to insert additional records. But without a primary key and some sort of reference to it, I don't know how to update the single record. Can anyone help? -- Jonathan Wood SoftCircuits Programming http://www.softcircuits.com |
#3
| |||
| |||
|
|
I want to store some application-wide data in my database. The table that stores this will store the different data in each field, and there will only need to be one record. Since there will only be one record, I haven't bothered to add a key (primary or otherwise). This seems to work fine but I'm trying to figure out what my SQL UPDATE statement would look like. The first time my code runs, I guess I need to create the single record. But, once created, I don't want to insert additional records. But without a primary key and some sort of reference to it, I don't know how to update the single record. Can anyone help? -- Jonathan Wood SoftCircuits Programming http://www.softcircuits.com |
#4
| |||
| |||
|
|
UPDATE table SET field = value "Jonathan Wood" <jwood (AT) softcircuits (DOT) com> wrote in message news:OQBOrdeQIHA.2268 (AT) TK2MSFTNGP02 (DOT) phx.gbl... I want to store some application-wide data in my database. The table that stores this will store the different data in each field, and there will only need to be one record. Since there will only be one record, I haven't bothered to add a key (primary or otherwise). This seems to work fine but I'm trying to figure out what my SQL UPDATE statement would look like. The first time my code runs, I guess I need to create the single record. But, once created, I don't want to insert additional records. But without a primary key and some sort of reference to it, I don't know how to update the single record. Can anyone help? -- Jonathan Wood SoftCircuits Programming http://www.softcircuits.com |
#5
| |||
| |||
|
|
So no WHERE is needed? Cool, but can you tell me what this command does if there are more than one records? Thanks! -- Jonathan Wood SoftCircuits Programming http://www.softcircuits.com "Brendan G" <bgreen (AT) nospam (DOT) nospam> wrote in message news:eM1VpSfQIHA.4712 (AT) TK2MSFTNGP04 (DOT) phx.gbl... UPDATE table SET field = value "Jonathan Wood" <jwood (AT) softcircuits (DOT) com> wrote in message news:OQBOrdeQIHA.2268 (AT) TK2MSFTNGP02 (DOT) phx.gbl... I want to store some application-wide data in my database. The table that stores this will store the different data in each field, and there will only need to be one record. Since there will only be one record, I haven't bothered to add a key (primary or otherwise). This seems to work fine but I'm trying to figure out what my SQL UPDATE statement would look like. The first time my code runs, I guess I need to create the single record. But, once created, I don't want to insert additional records. But without a primary key and some sort of reference to it, I don't know how to update the single record. Can anyone help? -- Jonathan Wood SoftCircuits Programming http://www.softcircuits.com |
#6
| |||
| |||
|
|
Simply, it will update all rows. You could still create a primary key with a checked value (of example a byte pk whose value must be necessarily 0) to express that you can only have a single record in this table (even if for documentation purpose only). -- Patrice "Jonathan Wood" <jwood (AT) softcircuits (DOT) com> a écrit dans le message de news: %23ptf0dfQIHA.5988 (AT) TK2MSFTNGP02 (DOT) phx.gbl... So no WHERE is needed? Cool, but can you tell me what this command does if there are more than one records? Thanks! -- Jonathan Wood SoftCircuits Programming http://www.softcircuits.com "Brendan G" <bgreen (AT) nospam (DOT) nospam> wrote in message news:eM1VpSfQIHA.4712 (AT) TK2MSFTNGP04 (DOT) phx.gbl... UPDATE table SET field = value "Jonathan Wood" <jwood (AT) softcircuits (DOT) com> wrote in message news:OQBOrdeQIHA.2268 (AT) TK2MSFTNGP02 (DOT) phx.gbl... I want to store some application-wide data in my database. The table that stores this will store the different data in each field, and there will only need to be one record. Since there will only be one record, I haven't bothered to add a key (primary or otherwise). This seems to work fine but I'm trying to figure out what my SQL UPDATE statement would look like. The first time my code runs, I guess I need to create the single record. But, once created, I don't want to insert additional records. But without a primary key and some sort of reference to it, I don't know how to update the single record. Can anyone help? -- Jonathan Wood SoftCircuits Programming http://www.softcircuits.com |
#7
| |||
| |||
|
|
I want to store some application-wide data in my database. The table that stores this will store the different data in each field, and there will only need to be one record. Since there will only be one record, I haven't bothered to add a key (primary or otherwise). This seems to work fine but I'm trying to figure out what my SQL UPDATE statement would look like. The first time my code runs, I guess I need to create the single record. But, once created, I don't want to insert additional records. But without a primary key and some sort of reference to it, I don't know how to update the single record. Can anyone help? -- Jonathan Wood SoftCircuits Programming http://www.softcircuits.com |
#8
| |||
| |||
|
|
I might consider using Extended Properties to store this information as it's not really relational data--not unless it's used in a JOIN with other tables.. -- __________________________________________________ ________________________ William R. Vaughn President and Founder Beta V Corporation Author, Mentor, Dad, Grandpa Microsoft MVP (425) 556-9205 (Pacific time) Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition) __________________________________________________ __________________________________________ "Jonathan Wood" <jwood (AT) softcircuits (DOT) com> wrote in message news:OQBOrdeQIHA.2268 (AT) TK2MSFTNGP02 (DOT) phx.gbl... I want to store some application-wide data in my database. The table that stores this will store the different data in each field, and there will only need to be one record. Since there will only be one record, I haven't bothered to add a key (primary or otherwise). This seems to work fine but I'm trying to figure out what my SQL UPDATE statement would look like. The first time my code runs, I guess I need to create the single record. But, once created, I don't want to insert additional records. But without a primary key and some sort of reference to it, I don't know how to update the single record. Can anyone help? -- Jonathan Wood SoftCircuits Programming http://www.softcircuits.com |
#9
| |||
| |||
|
|
It's not used in a JOIN. I don't know what Extended Properties are but it seems to be working fine now. Perhaps I'll find out what Extended Properties are at some point. -- Jonathan Wood SoftCircuits Programming http://www.softcircuits.com "William Vaughn" <billvaNoSPAM (AT) betav (DOT) com> wrote in message news:BC36B3E5-2690-4ED5-91D8-5A60DA355AB6 (AT) microsoft (DOT) com... I might consider using Extended Properties to store this information as it's not really relational data--not unless it's used in a JOIN with other tables.. -- __________________________________________________ ________________________ William R. Vaughn President and Founder Beta V Corporation Author, Mentor, Dad, Grandpa Microsoft MVP (425) 556-9205 (Pacific time) Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition) __________________________________________________ __________________________________________ "Jonathan Wood" <jwood (AT) softcircuits (DOT) com> wrote in message news:OQBOrdeQIHA.2268 (AT) TK2MSFTNGP02 (DOT) phx.gbl... I want to store some application-wide data in my database. The table that stores this will store the different data in each field, and there will only need to be one record. Since there will only be one record, I haven't bothered to add a key (primary or otherwise). This seems to work fine but I'm trying to figure out what my SQL UPDATE statement would look like. The first time my code runs, I guess I need to create the single record. But, once created, I don't want to insert additional records. But without a primary key and some sort of reference to it, I don't know how to update the single record. Can anyone help? -- Jonathan Wood SoftCircuits Programming http://www.softcircuits.com |
#10
| |||
| |||
|
|
See http://msdn2.microsoft.com/en-us/library/aa496030.aspx -- __________________________________________________ ________________________ William R. Vaughn President and Founder Beta V Corporation Author, Mentor, Dad, Grandpa Microsoft MVP (425) 556-9205 (Pacific time) Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition) __________________________________________________ __________________________________________ "Jonathan Wood" <jwood (AT) softcircuits (DOT) com> wrote in message news:u0P7UtnQIHA.2396 (AT) TK2MSFTNGP02 (DOT) phx.gbl... It's not used in a JOIN. I don't know what Extended Properties are but it seems to be working fine now. Perhaps I'll find out what Extended Properties are at some point. -- Jonathan Wood SoftCircuits Programming http://www.softcircuits.com "William Vaughn" <billvaNoSPAM (AT) betav (DOT) com> wrote in message news:BC36B3E5-2690-4ED5-91D8-5A60DA355AB6 (AT) microsoft (DOT) com... I might consider using Extended Properties to store this information as it's not really relational data--not unless it's used in a JOIN with other tables.. -- __________________________________________________ ________________________ William R. Vaughn President and Founder Beta V Corporation Author, Mentor, Dad, Grandpa Microsoft MVP (425) 556-9205 (Pacific time) Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition) __________________________________________________ __________________________________________ "Jonathan Wood" <jwood (AT) softcircuits (DOT) com> wrote in message news:OQBOrdeQIHA.2268 (AT) TK2MSFTNGP02 (DOT) phx.gbl... I want to store some application-wide data in my database. The table that stores this will store the different data in each field, and there will only need to be one record. Since there will only be one record, I haven't bothered to add a key (primary or otherwise). This seems to work fine but I'm trying to figure out what my SQL UPDATE statement would look like. The first time my code runs, I guess I need to create the single record. But, once created, I don't want to insert additional records. But without a primary key and some sort of reference to it, I don't know how to update the single record. Can anyone help? -- Jonathan Wood SoftCircuits Programming http://www.softcircuits.com |
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
| |