RE: [PHP-DB] MSSQL: Spaces in database name
I guess it would depend on your view of usability. To me, there's no shortage of "blanks" in the world, so I prefer to use them asOpposedToHopingTheCapitalizationIsPreserved kind of names. Once I finish designing an app *I* don't have to look at the names much, either, but I prefer the longer, natural-language friendly form when I come back a year later to do any needed maintenance. Old and forgetful, - Robert -Original Message- From: Miles Thompson [mailto:[EMAIL PROTECTED]] Sent: Thursday, August 09, 2001 3:57 AM To: Robert D. Young; '[EMAIL PROTECTED]' Subject: RE: [PHP-DB] MSSQL: Spaces in database name Why have spaces in names at all? To me it's long term aggravation, unnecessary keystrokes, and a future source of bugs. Besides, the end user rarely sees these names. Another case of do it just because you can? If this is an inherited database, my apologies. If you are just starting the project I beg you to reconsider now. Curmudgeonly yours - Miles Thompson At 07:22 PM 8/8/01 -0700, Robert D. Young wrote: >That did it! Using: > ><... stuff > >$dbname = "[Test Database]"; ><... more stuff > >mssql_select_db($dbname); > >worked perfectly. Again, Thanks! > >- Robert > >-Original Message- >From: Beau Lebens [mailto:[EMAIL PROTECTED]] >Sent: Tuesday, August 07, 2001 11:46 PM >To: 'Robert D. Young'; '[EMAIL PROTECTED]' >Subject: RE: [PHP-DB] MSSQL: Spaces in database name > > >i noticed in teh sql of working with some apps that it does things like > >[Test Database].fieldname > >that might work :) > >HTH >Beau > >// -Original Message- >// From: Robert D. Young [mailto:[EMAIL PROTECTED]] >// Sent: Wednesday, 8 August 2001 2:39 PM >// To: '[EMAIL PROTECTED]' >// Subject: [PHP-DB] MSSQL: Spaces in database name >// >// >// How can I get mssql_select_db to accept a database name with >// spaces in it? >// For example, this: >// >// <... stuff > >// $dbname = "Test Database"; >// <... more stuff > >// mssql_select_db($dbname); >// >// doesn't work. But if I change to a database with no space in >// the name (like >// "Test_Database") it works fine. Other apps (Access, SQL >// Admin, etc.) have no >// problems with a database with a space in the name. >// >// - Robert >// >// >// -- >// PHP Database Mailing List (http://www.php.net/) >// To unsubscribe, e-mail: [EMAIL PROTECTED] >// For additional commands, e-mail: [EMAIL PROTECTED] >// To contact the list administrators, e-mail: >// [EMAIL PROTECTED] >// > >-- >PHP Database Mailing List (http://www.php.net/) >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] >To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP-DB] MSSQL: Spaces in database name
Why have spaces in names at all? To me it's long term aggravation, unnecessary keystrokes, and a future source of bugs. Besides, the end user rarely sees these names. Another case of do it just because you can? If this is an inherited database, my apologies. If you are just starting the project I beg you to reconsider now. Curmudgeonly yours - Miles Thompson At 07:22 PM 8/8/01 -0700, Robert D. Young wrote: >That did it! Using: > ><... stuff > >$dbname = "[Test Database]"; ><... more stuff > >mssql_select_db($dbname); > >worked perfectly. Again, Thanks! > >- Robert > >-Original Message- >From: Beau Lebens [mailto:[EMAIL PROTECTED]] >Sent: Tuesday, August 07, 2001 11:46 PM >To: 'Robert D. Young'; '[EMAIL PROTECTED]' >Subject: RE: [PHP-DB] MSSQL: Spaces in database name > > >i noticed in teh sql of working with some apps that it does things like > >[Test Database].fieldname > >that might work :) > >HTH >Beau > >// -Original Message- >// From: Robert D. Young [mailto:[EMAIL PROTECTED]] >// Sent: Wednesday, 8 August 2001 2:39 PM >// To: '[EMAIL PROTECTED]' >// Subject: [PHP-DB] MSSQL: Spaces in database name >// >// >// How can I get mssql_select_db to accept a database name with >// spaces in it? >// For example, this: >// >// <... stuff > >// $dbname = "Test Database"; >// <... more stuff > >// mssql_select_db($dbname); >// >// doesn't work. But if I change to a database with no space in >// the name (like >// "Test_Database") it works fine. Other apps (Access, SQL >// Admin, etc.) have no >// problems with a database with a space in the name. >// >// - Robert >// >// >// -- >// PHP Database Mailing List (http://www.php.net/) >// To unsubscribe, e-mail: [EMAIL PROTECTED] >// For additional commands, e-mail: [EMAIL PROTECTED] >// To contact the list administrators, e-mail: >// [EMAIL PROTECTED] >// > >-- >PHP Database Mailing List (http://www.php.net/) >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] >To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP-DB] MSSQL: Spaces in database name
Understood. Notice that almost all of the MS databases and tables (predefined and samples) have *no* space in them. I'd long ago forgotten the ODBC/SQL syntax (last time I used it was in 95), thanks for the reminder. - Robert (who likes to use human readable names wherever possible) -Original Message- From: Graeme Merrall [mailto:[EMAIL PROTECTED]] Sent: Wednesday, August 08, 2001 8:19 PM To: Robert D. Young Cc: 'Beau Lebens'; '[EMAIL PROTECTED]' Subject: RE: [PHP-DB] MSSQL: Spaces in database name Quoting "Robert D. Young" <[EMAIL PROTECTED]>: > That did it! Using: > > <... stuff > > $dbname = "[Test Database]"; > <... more stuff > > mssql_select_db($dbname); > > worked perfectly. Again, Thanks! This is standard Microsoft (and maybe ODBC?) syntax. Using square brackets will work on most things including table names and field names with spaces in them. This will work fine SELECT [table space].[field space] FROM [table space] It doesn't mean that you should go around putting spaces in your database objects. That's never a good idea :) Cheers, Graeme -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP-DB] MSSQL: Spaces in database name
Quoting "Robert D. Young" <[EMAIL PROTECTED]>: > That did it! Using: > > <... stuff > > $dbname = "[Test Database]"; > <... more stuff > > mssql_select_db($dbname); > > worked perfectly. Again, Thanks! This is standard Microsoft (and maybe ODBC?) syntax. Using square brackets will work on most things including table names and field names with spaces in them. This will work fine SELECT [table space].[field space] FROM [table space] It doesn't mean that you should go around putting spaces in your database objects. That's never a good idea :) Cheers, Graeme -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP-DB] MSSQL: Spaces in database name
That did it! Using: <... stuff > $dbname = "[Test Database]"; <... more stuff > mssql_select_db($dbname); worked perfectly. Again, Thanks! - Robert -Original Message- From: Beau Lebens [mailto:[EMAIL PROTECTED]] Sent: Tuesday, August 07, 2001 11:46 PM To: 'Robert D. Young'; '[EMAIL PROTECTED]' Subject: RE: [PHP-DB] MSSQL: Spaces in database name i noticed in teh sql of working with some apps that it does things like [Test Database].fieldname that might work :) HTH Beau // -Original Message- // From: Robert D. Young [mailto:[EMAIL PROTECTED]] // Sent: Wednesday, 8 August 2001 2:39 PM // To: '[EMAIL PROTECTED]' // Subject: [PHP-DB] MSSQL: Spaces in database name // // // How can I get mssql_select_db to accept a database name with // spaces in it? // For example, this: // // <... stuff > // $dbname = "Test Database"; // <... more stuff > // mssql_select_db($dbname); // // doesn't work. But if I change to a database with no space in // the name (like // "Test_Database") it works fine. Other apps (Access, SQL // Admin, etc.) have no // problems with a database with a space in the name. // // - Robert // // // -- // PHP Database Mailing List (http://www.php.net/) // To unsubscribe, e-mail: [EMAIL PROTECTED] // For additional commands, e-mail: [EMAIL PROTECTED] // To contact the list administrators, e-mail: // [EMAIL PROTECTED] // -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP-DB] MSSQL: Spaces in database name
i noticed in teh sql of working with some apps that it does things like [Test Database].fieldname that might work :) HTH Beau // -Original Message- // From: Robert D. Young [mailto:[EMAIL PROTECTED]] // Sent: Wednesday, 8 August 2001 2:39 PM // To: '[EMAIL PROTECTED]' // Subject: [PHP-DB] MSSQL: Spaces in database name // // // How can I get mssql_select_db to accept a database name with // spaces in it? // For example, this: // // <... stuff > // $dbname = "Test Database"; // <... more stuff > // mssql_select_db($dbname); // // doesn't work. But if I change to a database with no space in // the name (like // "Test_Database") it works fine. Other apps (Access, SQL // Admin, etc.) have no // problems with a database with a space in the name. // // - Robert // // // -- // PHP Database Mailing List (http://www.php.net/) // To unsubscribe, e-mail: [EMAIL PROTECTED] // For additional commands, e-mail: [EMAIL PROTECTED] // To contact the list administrators, e-mail: // [EMAIL PROTECTED] // -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]