From jwcolby at colbyconsulting.com Fri Dec 1 14:00:15 2006 From: jwcolby at colbyconsulting.com (JWColby) Date: Fri, 1 Dec 2006 15:00:15 -0500 Subject: [dba-SQLServer] join pulls no records Message-ID: <007401c71583$53268180$657aa8c0@m6805> I have two tables. Each has an nvarchar 50 field which contains a string consisting of the first 5 characters of about 5 different fields, which is called in the client's industry a "match code" and is used to find the same name / address record in a different table. I have made the field the PK, so there is an index and it is unique. A join of the two tables pulls no records. I can manually look in the two tables and see visually identical data, i.e. it looks like the match code matches but an inner join does not pull records. Any clue why not? John W. Colby Colby Consulting www.ColbyConsulting.com From ssharkins at setel.com Fri Dec 1 14:08:43 2006 From: ssharkins at setel.com (Susan Harkins) Date: Fri, 1 Dec 2006 15:08:43 -0500 Subject: [dba-SQLServer] join pulls no records In-Reply-To: <007401c71583$53268180$657aa8c0@m6805> Message-ID: <006801c71584$8c0bfa10$f7b62ad1@SUSANONE> John, try a quick query on the foreign key table using a cut and paste of a primary key value as the criteria in the foreign key field -- just to make sure that even though the values "look" the same that they are the same. Susan H. I have two tables. Each has an nvarchar 50 field which contains a string consisting of the first 5 characters of about 5 different fields, which is called in the client's industry a "match code" and is used to find the same name / address record in a different table. I have made the field the PK, so there is an index and it is unique. A join of the two tables pulls no records. I can manually look in the two tables and see visually identical data, i.e. it looks like the match code matches but an inner join does not pull records. Any clue why not? From jlawrenc1 at shaw.ca Fri Dec 1 14:23:06 2006 From: jlawrenc1 at shaw.ca (Jim Lawrence) Date: Fri, 01 Dec 2006 12:23:06 -0800 Subject: [dba-SQLServer] join pulls no records In-Reply-To: <007401c71583$53268180$657aa8c0@m6805> Message-ID: <0J9M00EZ337XY4U1@l-daemon> Hi John: Have you checked to see if some of the fields, in the index, that you are depending have 'nulls'. In some cases a single null will negate the entire select. Oracle has a NVL() function that resolve this but I am sure MS SQL does also. Try reversing the joins (outer - inner) and see if there are any results. HTH Jim -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of JWColby Sent: Friday, December 01, 2006 12:00 PM To: dba-sqlserver at databaseadvisors.com Subject: [dba-SQLServer] join pulls no records I have two tables. Each has an nvarchar 50 field which contains a string consisting of the first 5 characters of about 5 different fields, which is called in the client's industry a "match code" and is used to find the same name / address record in a different table. I have made the field the PK, so there is an index and it is unique. A join of the two tables pulls no records. I can manually look in the two tables and see visually identical data, i.e. it looks like the match code matches but an inner join does not pull records. Any clue why not? John W. Colby Colby Consulting www.ColbyConsulting.com _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From mikedorism at verizon.net Fri Dec 1 14:30:13 2006 From: mikedorism at verizon.net (Doris Manning) Date: Fri, 01 Dec 2006 15:30:13 -0500 Subject: [dba-SQLServer] join pulls no records In-Reply-To: <0J9M00EZ337XY4U1@l-daemon> Message-ID: <001c01c71587$83099500$2f01a8c0@Kermit> SQL has 2... ISNULL() and COALESCE() The first says what to do if the value is null... the second will look through a series of values and stop at the first non-null result. Doris Manning -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Jim Lawrence Sent: Friday, December 01, 2006 3:23 PM To: dba-sqlserver at databaseadvisors.com Subject: Re: [dba-SQLServer] join pulls no records Hi John: Have you checked to see if some of the fields, in the index, that you are depending have 'nulls'. In some cases a single null will negate the entire select. Oracle has a NVL() function that resolve this but I am sure MS SQL does also. Try reversing the joins (outer - inner) and see if there are any results. HTH Jim -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of JWColby Sent: Friday, December 01, 2006 12:00 PM To: dba-sqlserver at databaseadvisors.com Subject: [dba-SQLServer] join pulls no records I have two tables. Each has an nvarchar 50 field which contains a string consisting of the first 5 characters of about 5 different fields, which is called in the client's industry a "match code" and is used to find the same name / address record in a different table. I have made the field the PK, so there is an index and it is unique. A join of the two tables pulls no records. I can manually look in the two tables and see visually identical data, i.e. it looks like the match code matches but an inner join does not pull records. Any clue why not? John W. Colby Colby Consulting www.ColbyConsulting.com _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Fri Dec 1 14:39:42 2006 From: jwcolby at colbyconsulting.com (JWColby) Date: Fri, 1 Dec 2006 15:39:42 -0500 Subject: [dba-SQLServer] join pulls no records In-Reply-To: <0J9M00EZ337XY4U1@l-daemon> Message-ID: <008b01c71588$d5275a10$657aa8c0@m6805> What it turned out to be was the join type. I was using an inner join, which in Access will return whatever fields you pull out of whatever side you wish. In this case, I had to open the join properties and specify to return records from one or both sides, otherwise it just wouldn't return any records. Even then the results are strange. I want to be able to edit a field pulled from one of the tables. Essentially set a field true in one table if there is a matching record in the other table (thus the inner join). I can edit the field one time (saving the change), however if I try to immediately change the field to some other value, I get an error "Cannot edit rows with unknown keys". If I requery (pull the records again) I can now edit it one more time then the same error. So much to know, so little time. I do have an identically named field in both tables - the PK in both tables is called MCTie2. Perhaps it is getting confused? Perhaps I am getting confused? John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Jim Lawrence Sent: Friday, December 01, 2006 3:23 PM To: dba-sqlserver at databaseadvisors.com Subject: Re: [dba-SQLServer] join pulls no records Hi John: Have you checked to see if some of the fields, in the index, that you are depending have 'nulls'. In some cases a single null will negate the entire select. Oracle has a NVL() function that resolve this but I am sure MS SQL does also. Try reversing the joins (outer - inner) and see if there are any results. HTH Jim -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of JWColby Sent: Friday, December 01, 2006 12:00 PM To: dba-sqlserver at databaseadvisors.com Subject: [dba-SQLServer] join pulls no records I have two tables. Each has an nvarchar 50 field which contains a string consisting of the first 5 characters of about 5 different fields, which is called in the client's industry a "match code" and is used to find the same name / address record in a different table. I have made the field the PK, so there is an index and it is unique. A join of the two tables pulls no records. I can manually look in the two tables and see visually identical data, i.e. it looks like the match code matches but an inner join does not pull records. Any clue why not? John W. Colby Colby Consulting www.ColbyConsulting.com _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From mikedorism at verizon.net Fri Dec 1 14:46:58 2006 From: mikedorism at verizon.net (Doris Manning) Date: Fri, 01 Dec 2006 15:46:58 -0500 Subject: [dba-SQLServer] join pulls no records In-Reply-To: <008b01c71588$d5275a10$657aa8c0@m6805> Message-ID: <001d01c71589$d94a8170$2f01a8c0@Kermit> John, By any chance, are you using the asterisk (*) to return all the fields in the matching record? If so, I've had a lot of problems with that and have learned to always select the fields I need. Sounds like to you need to look up UPDATE FROM in the BOL. Doris Manning -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of JWColby Sent: Friday, December 01, 2006 3:40 PM To: dba-sqlserver at databaseadvisors.com Subject: Re: [dba-SQLServer] join pulls no records What it turned out to be was the join type. I was using an inner join, which in Access will return whatever fields you pull out of whatever side you wish. In this case, I had to open the join properties and specify to return records from one or both sides, otherwise it just wouldn't return any records. Even then the results are strange. I want to be able to edit a field pulled from one of the tables. Essentially set a field true in one table if there is a matching record in the other table (thus the inner join). I can edit the field one time (saving the change), however if I try to immediately change the field to some other value, I get an error "Cannot edit rows with unknown keys". If I requery (pull the records again) I can now edit it one more time then the same error. So much to know, so little time. I do have an identically named field in both tables - the PK in both tables is called MCTie2. Perhaps it is getting confused? Perhaps I am getting confused? John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Jim Lawrence Sent: Friday, December 01, 2006 3:23 PM To: dba-sqlserver at databaseadvisors.com Subject: Re: [dba-SQLServer] join pulls no records Hi John: Have you checked to see if some of the fields, in the index, that you are depending have 'nulls'. In some cases a single null will negate the entire select. Oracle has a NVL() function that resolve this but I am sure MS SQL does also. Try reversing the joins (outer - inner) and see if there are any results. HTH Jim -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of JWColby Sent: Friday, December 01, 2006 12:00 PM To: dba-sqlserver at databaseadvisors.com Subject: [dba-SQLServer] join pulls no records I have two tables. Each has an nvarchar 50 field which contains a string consisting of the first 5 characters of about 5 different fields, which is called in the client's industry a "match code" and is used to find the same name / address record in a different table. I have made the field the PK, so there is an index and it is unique. A join of the two tables pulls no records. I can manually look in the two tables and see visually identical data, i.e. it looks like the match code matches but an inner join does not pull records. Any clue why not? John W. Colby Colby Consulting www.ColbyConsulting.com _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Sat Dec 2 21:51:40 2006 From: jwcolby at colbyconsulting.com (JWColby) Date: Sat, 2 Dec 2006 22:51:40 -0500 Subject: [dba-SQLServer] Action pack and X64 Message-ID: <000001c7168e$58432130$e1265b05@m6805> Does anyone know if the action pack contains the X64 versions of 2003 and SQL Server? John W. Colby Colby Consulting www.ColbyConsulting.com From ridermark at gmail.com Mon Dec 4 15:38:52 2006 From: ridermark at gmail.com (Mark Rider) Date: Mon, 4 Dec 2006 15:38:52 -0600 Subject: [dba-SQLServer] Action pack and X64 In-Reply-To: <000001c7168e$58432130$e1265b05@m6805> References: <000001c7168e$58432130$e1265b05@m6805> Message-ID: Not at this time. Check out https://partner.microsoft.com/40013779 to see the current contents. Mark On 12/2/06, JWColby wrote: > Does anyone know if the action pack contains the X64 versions of 2003 and > SQL Server? > > John W. Colby > Colby Consulting > www.ColbyConsulting.com > > _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com > > -- Mark Rider http://dfwmdug.org Don't anthropomorphize computers. They don't like it. From jwcolby at colbyconsulting.com Wed Dec 6 15:35:10 2006 From: jwcolby at colbyconsulting.com (JWColby) Date: Wed, 6 Dec 2006 16:35:10 -0500 Subject: [dba-SQLServer] strip all leading / trailing spaces Message-ID: <002501c7197e$6878a820$657aa8c0@m6805> Folks, Does anyone have a "something" in SQL Server that will take the name of a table, figure out all of the field names in the table, and return a data set with all of the data stripped of leading and trailing spaces? I have tables where the data waqs brought in to SQL Server from a fixed width file, padded right (mostly) with spaces. Thus the data is represented inside the table as fixed width with spaces to the right of any real data. I need to get the data out, strip the spaces (both leading and trailing) and the write that data back into the same or another table, doesn't matter which to me. I know how to do this by creating a view and then use "ltrim(rtrim(data)) as SomeFieldName" kind of a thing but that means a custom view for each table, manually edited to create these "ltrim(rtrim(" constructs. I assume if I knew how to do udfs or stored procedures that you could go get the field names of the fields and dynamically build a sql string. Has anyone seen such a thing? John W. Colby Colby Consulting www.ColbyConsulting.com From dwaters at usinternet.com Wed Dec 6 16:55:09 2006 From: dwaters at usinternet.com (Dan Waters) Date: Wed, 6 Dec 2006 16:55:09 -0600 Subject: [dba-SQLServer] strip all leading / trailing spaces In-Reply-To: <21219084.1165441260584.JavaMail.root@sniper44> Message-ID: <004601c71989$950c8c70$0200a8c0@danwaters> Hi John, Are there more than 64,000 rows? ;-) Dan Waters -----Original Message----- Subject: [dba-SQLServer] strip all leading / trailing spaces Folks, Does anyone have a "something" in SQL Server that will take the name of a table, figure out all of the field names in the table, and return a data set with all of the data stripped of leading and trailing spaces? I have tables where the data waqs brought in to SQL Server from a fixed width file, padded right (mostly) with spaces. Thus the data is represented inside the table as fixed width with spaces to the right of any real data. I need to get the data out, strip the spaces (both leading and trailing) and the write that data back into the same or another table, doesn't matter which to me. I know how to do this by creating a view and then use "ltrim(rtrim(data)) as SomeFieldName" kind of a thing but that means a custom view for each table, manually edited to create these "ltrim(rtrim(" constructs. I assume if I knew how to do udfs or stored procedures that you could go get the field names of the fields and dynamically build a sql string. Has anyone seen such a thing? John W. Colby Colby Consulting www.ColbyConsulting.com _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Wed Dec 6 17:47:37 2006 From: jwcolby at colbyconsulting.com (JWColby) Date: Wed, 6 Dec 2006 18:47:37 -0500 Subject: [dba-SQLServer] strip all leading / trailing spaces In-Reply-To: <004601c71989$950c8c70$0200a8c0@danwaters> Message-ID: <005201c71990$e95f9950$657aa8c0@m6805> >Are there more than 64,000 rows? Oh yes. In the case where I started, I had 21 files with 3 million rows each, 700 fields. It is the sheer number of fields that prompts me to look for a generic solution for this. I am getting data from the same source, fixed width, trailing spaces. The fields match my original 700 fields (they are the same source tables), but the exact fields in any given file vary. The number of records varies based on what matches they are looking for. They may give me the name address stuff and fields 400-450 one time, another time it might be name / address / Fields 125-178. In every case, the data in all fields is padded. It is simply impossible to process the fields in a timely manner if I have to do ltrim(rtrim(FieldXXX)) crap on all the fields, every time I get these files. I wrote a program in Access (VBA) to take the data, which I exported out in CSV format, and strip the spaces in code, and write the results back out to a csv file. It wasn't hard in VBA but it does require the export / strip / import / merge sequence. It would be nice to just do an update query that was built up inside of a stored procedure or something that "discovered" the field names, built up an update query with the ltrim(rtrim()) stuff and then ran that query to just clean up the data 'in situ'. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Dan Waters Sent: Wednesday, December 06, 2006 5:55 PM To: dba-sqlserver at databaseadvisors.com Subject: Re: [dba-SQLServer] strip all leading / trailing spaces Hi John, Are there more than 64,000 rows? ;-) Dan Waters -----Original Message----- Subject: [dba-SQLServer] strip all leading / trailing spaces Folks, Does anyone have a "something" in SQL Server that will take the name of a table, figure out all of the field names in the table, and return a data set with all of the data stripped of leading and trailing spaces? I have tables where the data waqs brought in to SQL Server from a fixed width file, padded right (mostly) with spaces. Thus the data is represented inside the table as fixed width with spaces to the right of any real data. I need to get the data out, strip the spaces (both leading and trailing) and the write that data back into the same or another table, doesn't matter which to me. I know how to do this by creating a view and then use "ltrim(rtrim(data)) as SomeFieldName" kind of a thing but that means a custom view for each table, manually edited to create these "ltrim(rtrim(" constructs. I assume if I knew how to do udfs or stored procedures that you could go get the field names of the fields and dynamically build a sql string. Has anyone seen such a thing? John W. Colby Colby Consulting www.ColbyConsulting.com _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From michael at ddisolutions.com.au Wed Dec 6 18:03:24 2006 From: michael at ddisolutions.com.au (Michael Maddison) Date: Thu, 7 Dec 2006 11:03:24 +1100 Subject: [dba-SQLServer] strip all leading / trailing spaces Message-ID: <59A61174B1F5B54B97FD4ADDE71E7D0116ADD0@ddi-01.DDI.local> Hi John, It certainly is possible... I have seen scripts that do that sort of thing. Can't find anything at the moment but if you google/BOL INFORMATION_SCHEMA should get you started. Basically, the INFORMATION_SCHEMA views let you interogate the database schema, use a cursor to loop through the tables/fields build up your string, execute it. This would be done in a sproc. HTH Michael Maddison DDI Solutions Pty Ltd michael at ddisolutions.com.au Bus: 0260400620 Mob: 0412620497 www.ddisolutions.com.au -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of JWColby Sent: Thursday, 7 December 2006 8:35 AM To: dba-sqlserver at databaseadvisors.com Subject: [dba-SQLServer] strip all leading / trailing spaces Folks, Does anyone have a "something" in SQL Server that will take the name of a table, figure out all of the field names in the table, and return a data set with all of the data stripped of leading and trailing spaces? I have tables where the data waqs brought in to SQL Server from a fixed width file, padded right (mostly) with spaces. Thus the data is represented inside the table as fixed width with spaces to the right of any real data. I need to get the data out, strip the spaces (both leading and trailing) and the write that data back into the same or another table, doesn't matter which to me. I know how to do this by creating a view and then use "ltrim(rtrim(data)) as SomeFieldName" kind of a thing but that means a custom view for each table, manually edited to create these "ltrim(rtrim(" constructs. I assume if I knew how to do udfs or stored procedures that you could go get the field names of the fields and dynamically build a sql string. Has anyone seen such a thing? John W. Colby Colby Consulting www.ColbyConsulting.com _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From ssharkins at setel.com Wed Dec 6 18:09:23 2006 From: ssharkins at setel.com (Susan Harkins) Date: Wed, 6 Dec 2006 19:09:23 -0500 Subject: [dba-SQLServer] strip all leading / trailing spaces In-Reply-To: <59A61174B1F5B54B97FD4ADDE71E7D0116ADD0@ddi-01.DDI.local> Message-ID: <002101c71993$f4511570$fc34fad1@SUSANONE> JC, try the following, just to get a look: SELECT * FROM INFORMATION_SCHEMA.TABLES SELECT * FROM INFORMATION_SCHEMA.COLUMNS There are several views. Susan H. Hi John, It certainly is possible... I have seen scripts that do that sort of thing. Can't find anything at the moment but if you google/BOL INFORMATION_SCHEMA should get you started. Basically, the INFORMATION_SCHEMA views let you interogate the database schema, use a cursor to loop through the tables/fields build up your string, execute it. This would be done in a sproc. HTH Michael Maddison DDI Solutions Pty Ltd michael at ddisolutions.com.au Bus: 0260400620 Mob: 0412620497 www.ddisolutions.com.au -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of JWColby Sent: Thursday, 7 December 2006 8:35 AM To: dba-sqlserver at databaseadvisors.com Subject: [dba-SQLServer] strip all leading / trailing spaces Folks, Does anyone have a "something" in SQL Server that will take the name of a table, figure out all of the field names in the table, and return a data set with all of the data stripped of leading and trailing spaces? I have tables where the data waqs brought in to SQL Server from a fixed width file, padded right (mostly) with spaces. Thus the data is represented inside the table as fixed width with spaces to the right of any real data. I need to get the data out, strip the spaces (both leading and trailing) and the write that data back into the same or another table, doesn't matter which to me. I know how to do this by creating a view and then use "ltrim(rtrim(data)) as SomeFieldName" kind of a thing but that means a custom view for each table, manually edited to create these "ltrim(rtrim(" constructs. I assume if I knew how to do udfs or stored procedures that you could go get the field names of the fields and dynamically build a sql string. Has anyone seen such a thing? John W. Colby Colby Consulting www.ColbyConsulting.com _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com -- Internal Virus Database is out-of-date. Checked by AVG Free Edition. Version: 7.1.409 / Virus Database: 268.14.16/552 - Release Date: 11/26/2006 From dwaters at usinternet.com Wed Dec 6 18:42:26 2006 From: dwaters at usinternet.com (Dan Waters) Date: Wed, 6 Dec 2006 18:42:26 -0600 Subject: [dba-SQLServer] strip all leading / trailing spaces In-Reply-To: <274457.1165449100896.JavaMail.root@sniper63> Message-ID: <000101c71998$92006010$0200a8c0@danwaters> Well - I figured you had to be working with large datasets. It's just that Excel has a limit of 64,000 rows. If you imported the data into Excel I think the trailing spaces would be removed. I guess I was trying to give the $64,000 answer! Dan Waters -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of JWColby Sent: Wednesday, December 06, 2006 5:48 PM To: dba-sqlserver at databaseadvisors.com Subject: Re: [dba-SQLServer] strip all leading / trailing spaces >Are there more than 64,000 rows? Oh yes. In the case where I started, I had 21 files with 3 million rows each, 700 fields. It is the sheer number of fields that prompts me to look for a generic solution for this. I am getting data from the same source, fixed width, trailing spaces. The fields match my original 700 fields (they are the same source tables), but the exact fields in any given file vary. The number of records varies based on what matches they are looking for. They may give me the name address stuff and fields 400-450 one time, another time it might be name / address / Fields 125-178. In every case, the data in all fields is padded. It is simply impossible to process the fields in a timely manner if I have to do ltrim(rtrim(FieldXXX)) crap on all the fields, every time I get these files. I wrote a program in Access (VBA) to take the data, which I exported out in CSV format, and strip the spaces in code, and write the results back out to a csv file. It wasn't hard in VBA but it does require the export / strip / import / merge sequence. It would be nice to just do an update query that was built up inside of a stored procedure or something that "discovered" the field names, built up an update query with the ltrim(rtrim()) stuff and then ran that query to just clean up the data 'in situ'. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Dan Waters Sent: Wednesday, December 06, 2006 5:55 PM To: dba-sqlserver at databaseadvisors.com Subject: Re: [dba-SQLServer] strip all leading / trailing spaces Hi John, Are there more than 64,000 rows? ;-) Dan Waters -----Original Message----- Subject: [dba-SQLServer] strip all leading / trailing spaces Folks, Does anyone have a "something" in SQL Server that will take the name of a table, figure out all of the field names in the table, and return a data set with all of the data stripped of leading and trailing spaces? I have tables where the data waqs brought in to SQL Server from a fixed width file, padded right (mostly) with spaces. Thus the data is represented inside the table as fixed width with spaces to the right of any real data. I need to get the data out, strip the spaces (both leading and trailing) and the write that data back into the same or another table, doesn't matter which to me. I know how to do this by creating a view and then use "ltrim(rtrim(data)) as SomeFieldName" kind of a thing but that means a custom view for each table, manually edited to create these "ltrim(rtrim(" constructs. I assume if I knew how to do udfs or stored procedures that you could go get the field names of the fields and dynamically build a sql string. Has anyone seen such a thing? John W. Colby Colby Consulting www.ColbyConsulting.com _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From artful at rogers.com Thu Dec 7 07:24:29 2006 From: artful at rogers.com (artful at rogers.com) Date: Thu, 7 Dec 2006 05:24:29 -0800 (PST) Subject: [dba-SQLServer] strip all leading / trailing spaces Message-ID: <20061207132429.69614.qmail@web88204.mail.re2.yahoo.com> By coincidence, JC, I was writing about this subject for an upcoming article for my SQL Tips column at Tech Republic. It's not quite a stored procedure yet but it is kind of slick. I'm assuming that you are using SQL 2005. There is a system view called INFORMATION_SCHEMA.COLUMNS which (gasp) will return the names of the columns (plus some other stuff too). I then combined that output with a slick little trick that causes SQL to generate SQL. USE MyDatabase -- substitute the name of your own DB GO SELECT 'Update MyTable SET ' + Column_Name + ' = Ltrim(Trim( ' + Column_Name + '))' FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'ProductTypes' AND Data_Type IN( 'char', 'varchar' ) -- add to this for data types of interest This query returns a series of Update statements similar to this: Update MyTable SET ProductTypeID = Ltrim(Trim( ProductTypeID)) Update MyTable SET ProductTypeName = Ltrim(Trim( ProductTypeName)) You could then take this output and wrap it in a CREATE PROCEDURE statement that accepts a parameter for the table name of interest. hth, Arthur ----- Original Message ---- From: JWColby To: dba-sqlserver at databaseadvisors.com Sent: Wednesday, December 6, 2006 6:47:37 PM Subject: Re: [dba-SQLServer] strip all leading / trailing spaces >Are there more than 64,000 rows? Oh yes. In the case where I started, I had 21 files with 3 million rows each, 700 fields. It is the sheer number of fields that prompts me to look for a generic solution for this. I am getting data from the same source, fixed width, trailing spaces. The fields match my original 700 fields (they are the same source tables), but the exact fields in any given file vary. The number of records varies based on what matches they are looking for. They may give me the name address stuff and fields 400-450 one time, another time it might be name / address / Fields 125-178. In every case, the data in all fields is padded. It is simply impossible to process the fields in a timely manner if I have to do ltrim(rtrim(FieldXXX)) crap on all the fields, every time I get these files. I wrote a program in Access (VBA) to take the data, which I exported out in CSV format, and strip the spaces in code, and write the results back out to a csv file. It wasn't hard in VBA but it does require the export / strip / import / merge sequence. It would be nice to just do an update query that was built up inside of a stored procedure or something that "discovered" the field names, built up an update query with the ltrim(rtrim()) stuff and then ran that query to just clean up the data 'in situ'. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Dan Waters Sent: Wednesday, December 06, 2006 5:55 PM To: dba-sqlserver at databaseadvisors.com Subject: Re: [dba-SQLServer] strip all leading / trailing spaces Hi John, Are there more than 64,000 rows? ;-) Dan Waters -----Original Message----- Subject: [dba-SQLServer] strip all leading / trailing spaces Folks, Does anyone have a "something" in SQL Server that will take the name of a table, figure out all of the field names in the table, and return a data set with all of the data stripped of leading and trailing spaces? I have tables where the data waqs brought in to SQL Server from a fixed width file, padded right (mostly) with spaces. Thus the data is represented inside the table as fixed width with spaces to the right of any real data. I need to get the data out, strip the spaces (both leading and trailing) and the write that data back into the same or another table, doesn't matter which to me. I know how to do this by creating a view and then use "ltrim(rtrim(data)) as SomeFieldName" kind of a thing but that means a custom view for each table, manually edited to create these "ltrim(rtrim(" constructs. I assume if I knew how to do udfs or stored procedures that you could go get the field names of the fields and dynamically build a sql string. Has anyone seen such a thing? John W. Colby From jwcolby at colbyconsulting.com Thu Dec 7 07:43:00 2006 From: jwcolby at colbyconsulting.com (JWColby) Date: Thu, 7 Dec 2006 08:43:00 -0500 Subject: [dba-SQLServer] strip all leading / trailing spaces In-Reply-To: <20061207132429.69614.qmail@web88204.mail.re2.yahoo.com> Message-ID: <00ba01c71a05$9d1583a0$657aa8c0@m6805> >I'm assuming that you are using SQL 2005 That would be a bad assumption. Sounds like you are on the track I need. As I am about 3 steps below pond scum in the SQL abilities ranking, please keep me informed on this as it gets closer to "just usable by pond scum". John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of artful at rogers.com Sent: Thursday, December 07, 2006 8:24 AM To: dba-sqlserver at databaseadvisors.com Subject: Re: [dba-SQLServer] strip all leading / trailing spaces By coincidence, JC, I was writing about this subject for an upcoming article for my SQL Tips column at Tech Republic. It's not quite a stored procedure yet but it is kind of slick. I'm assuming that you are using SQL 2005. There is a system view called INFORMATION_SCHEMA.COLUMNS which (gasp) will return the names of the columns (plus some other stuff too). I then combined that output with a slick little trick that causes SQL to generate SQL. USE MyDatabase -- substitute the name of your own DB GO SELECT 'Update MyTable SET ' + Column_Name + ' = Ltrim(Trim( ' + Column_Name + '))' FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'ProductTypes' AND Data_Type IN( 'char', 'varchar' ) -- add to this for data types of interest This query returns a series of Update statements similar to this: Update MyTable SET ProductTypeID = Ltrim(Trim( ProductTypeID)) Update MyTable SET ProductTypeName = Ltrim(Trim( ProductTypeName)) You could then take this output and wrap it in a CREATE PROCEDURE statement that accepts a parameter for the table name of interest. hth, Arthur ----- Original Message ---- From: JWColby To: dba-sqlserver at databaseadvisors.com Sent: Wednesday, December 6, 2006 6:47:37 PM Subject: Re: [dba-SQLServer] strip all leading / trailing spaces >Are there more than 64,000 rows? Oh yes. In the case where I started, I had 21 files with 3 million rows each, 700 fields. It is the sheer number of fields that prompts me to look for a generic solution for this. I am getting data from the same source, fixed width, trailing spaces. The fields match my original 700 fields (they are the same source tables), but the exact fields in any given file vary. The number of records varies based on what matches they are looking for. They may give me the name address stuff and fields 400-450 one time, another time it might be name / address / Fields 125-178. In every case, the data in all fields is padded. It is simply impossible to process the fields in a timely manner if I have to do ltrim(rtrim(FieldXXX)) crap on all the fields, every time I get these files. I wrote a program in Access (VBA) to take the data, which I exported out in CSV format, and strip the spaces in code, and write the results back out to a csv file. It wasn't hard in VBA but it does require the export / strip / import / merge sequence. It would be nice to just do an update query that was built up inside of a stored procedure or something that "discovered" the field names, built up an update query with the ltrim(rtrim()) stuff and then ran that query to just clean up the data 'in situ'. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Dan Waters Sent: Wednesday, December 06, 2006 5:55 PM To: dba-sqlserver at databaseadvisors.com Subject: Re: [dba-SQLServer] strip all leading / trailing spaces Hi John, Are there more than 64,000 rows? ;-) Dan Waters -----Original Message----- Subject: [dba-SQLServer] strip all leading / trailing spaces Folks, Does anyone have a "something" in SQL Server that will take the name of a table, figure out all of the field names in the table, and return a data set with all of the data stripped of leading and trailing spaces? I have tables where the data waqs brought in to SQL Server from a fixed width file, padded right (mostly) with spaces. Thus the data is represented inside the table as fixed width with spaces to the right of any real data. I need to get the data out, strip the spaces (both leading and trailing) and the write that data back into the same or another table, doesn't matter which to me. I know how to do this by creating a view and then use "ltrim(rtrim(data)) as SomeFieldName" kind of a thing but that means a custom view for each table, manually edited to create these "ltrim(rtrim(" constructs. I assume if I knew how to do udfs or stored procedures that you could go get the field names of the fields and dynamically build a sql string. Has anyone seen such a thing? John W. Colby _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From ridermark at gmail.com Thu Dec 7 07:48:21 2006 From: ridermark at gmail.com (Mark Rider) Date: Thu, 7 Dec 2006 07:48:21 -0600 Subject: [dba-SQLServer] strip all leading / trailing spaces In-Reply-To: <00ba01c71a05$9d1583a0$657aa8c0@m6805> References: <20061207132429.69614.qmail@web88204.mail.re2.yahoo.com> <00ba01c71a05$9d1583a0$657aa8c0@m6805> Message-ID: This is from another thread on a similar subject - deleting spaces from a field. Basically the SPROC loops through the field and replaces it with fewer spaces than were there originally. Since I am not much more advanced that pond scum, I am not positive that it will work for you, but it may be a way to start! begin UPDATE Table SET FirstName = Replace(FirstName, ' ', ' ') where charindex(' ', FirstName) > 0 while @@Rowcount > 0 begin UPDATE Table SET FirstName = Replace(FirstName, ' ', ' ') where charindex(' ', FirstName) > 0 end end -- Mark Rider http://dfwmdug.org Don't anthropomorphize computers. They don't like it. From artful at rogers.com Thu Dec 7 08:08:41 2006 From: artful at rogers.com (artful at rogers.com) Date: Thu, 7 Dec 2006 06:08:41 -0800 (PST) Subject: [dba-SQLServer] strip all leading / trailing spaces Message-ID: <20061207140842.16182.qmail@web88214.mail.re2.yahoo.com> In my haste to ship the answer, I made a typo. The view is called INFORMATION_SCHEMA.COLUMNS. I'll give it a go in SQL 2000. Same principle, just a little messier since the information is not gathered into one convenient view. Arthur ----- Original Message ---- From: JWColby To: dba-sqlserver at databaseadvisors.com Sent: Thursday, December 7, 2006 8:43:00 AM Subject: Re: [dba-SQLServer] strip all leading / trailing spaces >I'm assuming that you are using SQL 2005 That would be a bad assumption. Sounds like you are on the track I need. As I am about 3 steps below pond scum in the SQL abilities ranking, please keep me informed on this as it gets closer to "just usable by pond scum". John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of artful at rogers.com Sent: Thursday, December 07, 2006 8:24 AM To: dba-sqlserver at databaseadvisors.com Subject: Re: [dba-SQLServer] strip all leading / trailing spaces By coincidence, JC, I was writing about this subject for an upcoming article for my SQL Tips column at Tech Republic. It's not quite a stored procedure yet but it is kind of slick. I'm assuming that you are using SQL 2005. There is a system view called INFORMATION_SCHEMA.COLUMNS which (gasp) will return the names of the columns (plus some other stuff too). I then combined that output with a slick little trick that causes SQL to generate SQL. USE MyDatabase -- substitute the name of your own DB GO SELECT 'Update MyTable SET ' + Column_Name + ' = Ltrim(Trim( ' + Column_Name + '))' FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'ProductTypes' AND Data_Type IN( 'char', 'varchar' ) -- add to this for data types of interest This query returns a series of Update statements similar to this: Update MyTable SET ProductTypeID = Ltrim(Trim( ProductTypeID)) Update MyTable SET ProductTypeName = Ltrim(Trim( ProductTypeName)) You could then take this output and wrap it in a CREATE PROCEDURE statement that accepts a parameter for the table name of interest. hth, Arthur ----- Original Message ---- From: JWColby To: dba-sqlserver at databaseadvisors.com Sent: Wednesday, December 6, 2006 6:47:37 PM Subject: Re: [dba-SQLServer] strip all leading / trailing spaces >Are there more than 64,000 rows? Oh yes. In the case where I started, I had 21 files with 3 million rows each, 700 fields. It is the sheer number of fields that prompts me to look for a generic solution for this. I am getting data from the same source, fixed width, trailing spaces. The fields match my original 700 fields (they are the same source tables), but the exact fields in any given file vary. The number of records varies based on what matches they are looking for. They may give me the name address stuff and fields 400-450 one time, another time it might be name / address / Fields 125-178. In every case, the data in all fields is padded. It is simply impossible to process the fields in a timely manner if I have to do ltrim(rtrim(FieldXXX)) crap on all the fields, every time I get these files. I wrote a program in Access (VBA) to take the data, which I exported out in CSV format, and strip the spaces in code, and write the results back out to a csv file. It wasn't hard in VBA but it does require the export / strip / import / merge sequence. It would be nice to just do an update query that was built up inside of a stored procedure or something that "discovered" the field names, built up an update query with the ltrim(rtrim()) stuff and then ran that query to just clean up the data 'in situ'. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Dan Waters Sent: Wednesday, December 06, 2006 5:55 PM To: dba-sqlserver at databaseadvisors.com Subject: Re: [dba-SQLServer] strip all leading / trailing spaces Hi John, Are there more than 64,000 rows? ;-) Dan Waters -----Original Message----- Subject: [dba-SQLServer] strip all leading / trailing spaces Folks, Does anyone have a "something" in SQL Server that will take the name of a table, figure out all of the field names in the table, and return a data set with all of the data stripped of leading and trailing spaces? I have tables where the data waqs brought in to SQL Server from a fixed width file, padded right (mostly) with spaces. Thus the data is represented inside the table as fixed width with spaces to the right of any real data. I need to get the data out, strip the spaces (both leading and trailing) and the write that data back into the same or another table, doesn't matter which to me. I know how to do this by creating a view and then use "ltrim(rtrim(data)) as SomeFieldName" kind of a thing but that means a custom view for each table, manually edited to create these "ltrim(rtrim(" constructs. I assume if I knew how to do udfs or stored procedures that you could go get the field names of the fields and dynamically build a sql string. Has anyone seen such a thing? John W. Colby _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From artful at rogers.com Thu Dec 7 08:44:46 2006 From: artful at rogers.com (artful at rogers.com) Date: Thu, 7 Dec 2006 06:44:46 -0800 (PST) Subject: [dba-SQLServer] strip all leading / trailing spaces Message-ID: <20061207144446.56975.qmail@web88206.mail.re2.yahoo.com> Do you not have SQL 2005 installed? Management Studio is light years past Enterprise Manager, and works just fine with SQL 2000 databases. ----- Original Message ---- From: JWColby To: dba-sqlserver at databaseadvisors.com Sent: Thursday, December 7, 2006 8:43:00 AM Subject: Re: [dba-SQLServer] strip all leading / trailing spaces >I'm assuming that you are using SQL 2005 That would be a bad assumption. Sounds like you are on the track I need. As I am about 3 steps below pond scum in the SQL abilities ranking, please keep me informed on this as it gets closer to "just usable by pond scum". John W. Colby Colby Consulting www.ColbyConsulting.com From jwcolby at colbyconsulting.com Thu Dec 7 09:22:19 2006 From: jwcolby at colbyconsulting.com (JWColby) Date: Thu, 7 Dec 2006 10:22:19 -0500 Subject: [dba-SQLServer] strip all leading / trailing spaces In-Reply-To: <20061207144446.56975.qmail@web88206.mail.re2.yahoo.com> Message-ID: <000c01c71a13$7d403850$657aa8c0@m6805> Arthur, I will take that under advisement. I am in fact doing a lot of SQL Server stuff at this point, feeling my way around like a blind man. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of artful at rogers.com Sent: Thursday, December 07, 2006 9:45 AM To: dba-sqlserver at databaseadvisors.com Subject: Re: [dba-SQLServer] strip all leading / trailing spaces Do you not have SQL 2005 installed? Management Studio is light years past Enterprise Manager, and works just fine with SQL 2000 databases. ----- Original Message ---- From: JWColby To: dba-sqlserver at databaseadvisors.com Sent: Thursday, December 7, 2006 8:43:00 AM Subject: Re: [dba-SQLServer] strip all leading / trailing spaces >I'm assuming that you are using SQL 2005 That would be a bad assumption. Sounds like you are on the track I need. As I am about 3 steps below pond scum in the SQL abilities ranking, please keep me informed on this as it gets closer to "just usable by pond scum". John W. Colby Colby Consulting www.ColbyConsulting.com _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Thu Dec 7 09:36:17 2006 From: jwcolby at colbyconsulting.com (JWColby) Date: Thu, 7 Dec 2006 10:36:17 -0500 Subject: [dba-SQLServer] strip all leading / trailing spaces In-Reply-To: <20061207144446.56975.qmail@web88206.mail.re2.yahoo.com> Message-ID: <001201c71a15$708617e0$657aa8c0@m6805> Arthur, What is your billing rate (what can I hire you for?) I need some work done is SQL Server. If I can afford you I will hire you do do some of this stuff and we can talk about what the work is. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of artful at rogers.com Sent: Thursday, December 07, 2006 9:45 AM To: dba-sqlserver at databaseadvisors.com Subject: Re: [dba-SQLServer] strip all leading / trailing spaces Do you not have SQL 2005 installed? Management Studio is light years past Enterprise Manager, and works just fine with SQL 2000 databases. ----- Original Message ---- From: JWColby To: dba-sqlserver at databaseadvisors.com Sent: Thursday, December 7, 2006 8:43:00 AM Subject: Re: [dba-SQLServer] strip all leading / trailing spaces >I'm assuming that you are using SQL 2005 That would be a bad assumption. Sounds like you are on the track I need. As I am about 3 steps below pond scum in the SQL abilities ranking, please keep me informed on this as it gets closer to "just usable by pond scum". John W. Colby Colby Consulting www.ColbyConsulting.com _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From ssharkins at setel.com Thu Dec 7 10:57:07 2006 From: ssharkins at setel.com (Susan Harkins) Date: Thu, 7 Dec 2006 11:57:07 -0500 Subject: [dba-SQLServer] Step aside! :) Message-ID: <002001c71a20$bb473470$ecb82ad1@SUSANONE> SAGITTARIUS The most powerful time in Sagittarian history (is coming up). What you are seeing is the start of something really big. A month from now will see so many significant changes, and opportunities take place that you will have trouble believing in all the good. I trust that this is not the case as you don't want to miss out on all the fun. The changes you have been experiencing are for real. You can have all the things you dream of and want in your life. It is a matter of belief, and confronting the doubts. Seek stability in taking responsibility for yourself and putting you first. =====It's that last two lines that always kicks me in the stomach. There's always a catch! :) Susan H. From ssharkins at setel.com Thu Dec 7 11:10:23 2006 From: ssharkins at setel.com (Susan Harkins) Date: Thu, 7 Dec 2006 12:10:23 -0500 Subject: [dba-SQLServer] Step aside! :) In-Reply-To: <002001c71a20$bb473470$ecb82ad1@SUSANONE> Message-ID: <002e01c71a22$95891df0$ecb82ad1@SUSANONE> Oh crap -- I meant that for OT -- I am SO sorry! ;) Well, now you all know my secret -- I'm a SAGITTARIAN -- explains a lot, right? I use to have super powers, but my therapist took them away... :) Susan H. -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Susan Harkins Sent: Thursday, December 07, 2006 11:57 AM To: dba-sqlserver at databaseadvisors.com Subject: [dba-SQLServer] Step aside! :) SAGITTARIUS The most powerful time in Sagittarian history (is coming up). What you are seeing is the start of something really big. A month from now will see so many significant changes, and opportunities take place that you will have trouble believing in all the good. I trust that this is not the case as you don't want to miss out on all the fun. The changes you have been experiencing are for real. You can have all the things you dream of and want in your life. It is a matter of belief, and confronting the doubts. Seek stability in taking responsibility for yourself and putting you first. =====It's that last two lines that always kicks me in the stomach. There's always a catch! :) Susan H. _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com -- Internal Virus Database is out-of-date. Checked by AVG Free Edition. Version: 7.1.409 / Virus Database: 268.14.16/552 - Release Date: 11/26/2006 From jwcolby at colbyconsulting.com Thu Dec 7 11:26:17 2006 From: jwcolby at colbyconsulting.com (JWColby) Date: Thu, 7 Dec 2006 12:26:17 -0500 Subject: [dba-SQLServer] Step aside! :) In-Reply-To: <002e01c71a22$95891df0$ecb82ad1@SUSANONE> Message-ID: <002801c71a24$ce5d6300$657aa8c0@m6805> ROTFLMAOBTC Those damned therapists! I think they STEAL your powers. You wouldn't believe the number of therapists I have seen, late at night, wearing tights and superhero outfits. I doubt that it is a coincidence... John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Susan Harkins Sent: Thursday, December 07, 2006 12:10 PM To: dba-sqlserver at databaseadvisors.com Subject: Re: [dba-SQLServer] Step aside! :) Oh crap -- I meant that for OT -- I am SO sorry! ;) Well, now you all know my secret -- I'm a SAGITTARIAN -- explains a lot, right? I use to have super powers, but my therapist took them away... :) Susan H. -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Susan Harkins Sent: Thursday, December 07, 2006 11:57 AM To: dba-sqlserver at databaseadvisors.com Subject: [dba-SQLServer] Step aside! :) SAGITTARIUS The most powerful time in Sagittarian history (is coming up). What you are seeing is the start of something really big. A month from now will see so many significant changes, and opportunities take place that you will have trouble believing in all the good. I trust that this is not the case as you don't want to miss out on all the fun. The changes you have been experiencing are for real. You can have all the things you dream of and want in your life. It is a matter of belief, and confronting the doubts. Seek stability in taking responsibility for yourself and putting you first. =====It's that last two lines that always kicks me in the stomach. There's always a catch! :) Susan H. _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com -- Internal Virus Database is out-of-date. Checked by AVG Free Edition. Version: 7.1.409 / Virus Database: 268.14.16/552 - Release Date: 11/26/2006 _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From DavidL at sierranevada.com Thu Dec 7 12:03:56 2006 From: DavidL at sierranevada.com (David Lewis) Date: Thu, 7 Dec 2006 10:03:56 -0800 Subject: [dba-SQLServer] strip all leading / trailing spaces In-Reply-To: Message-ID: <00101736F13D774F88C54058CB2663C8E37132@celebration.sierranevada.corp> For sql2K, your query might looks something like: SELECT o.name Table_Name , c.name Column_Name , t.name DataType , c.Length , CASE WHEN c.isnullable=1 THEN 'Yes' ELSE 'No' END AS 'Nullable' FROM sysobjects o INNER JOIN syscolumns c ON (o.id=c.id and o.type='U') INNER JOIN systypes t ON (c.xtype=t.xtype) ORDER BY o.name, c.name This will give a list of all user tables in the db, with all columns, datatypes, lengths, and if nullable. In the master database there are many stored procedures that can also help you. For this particular problem sp_MSHelpColumns is likely the place to start (and isn't much different from the query above). HTH. D. Lewis From markamatte at hotmail.com Thu Dec 7 12:23:55 2006 From: markamatte at hotmail.com (Mark A Matte) Date: Thu, 07 Dec 2006 18:23:55 +0000 Subject: [dba-SQLServer] Step aside! :) In-Reply-To: <002e01c71a22$95891df0$ecb82ad1@SUSANONE> Message-ID: Another SAGITTARIAN here. All I can say... It's good to be us! Happy Birthday(recent or soon)! Mark A. Matte >From: "Susan Harkins" >Reply-To: dba-sqlserver at databaseadvisors.com >To: >Subject: Re: [dba-SQLServer] Step aside! :) >Date: Thu, 7 Dec 2006 12:10:23 -0500 > >Oh crap -- I meant that for OT -- I am SO sorry! ;) > >Well, now you all know my secret -- I'm a SAGITTARIAN -- explains a lot, >right? I use to have super powers, but my therapist took them away... :) > >Susan H. > >-----Original Message----- >From: dba-sqlserver-bounces at databaseadvisors.com >[mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Susan >Harkins >Sent: Thursday, December 07, 2006 11:57 AM >To: dba-sqlserver at databaseadvisors.com >Subject: [dba-SQLServer] Step aside! :) > >SAGITTARIUS > > >The most powerful time in Sagittarian history (is coming up). What you are >seeing is the start of something really big. A month from now will see so >many significant changes, and opportunities take place that you will have >trouble believing in all the good. I trust that this is not the case as you >don't want to miss out on all the fun. The changes you have been >experiencing are for real. You can have all the things you dream of and >want >in your life. It is a matter of belief, and confronting the doubts. Seek >stability in taking responsibility for yourself and putting you first. > >=====It's that last two lines that always kicks me in the stomach. There's >always a catch! :) > >Susan H. > >_______________________________________________ >dba-SQLServer mailing list >dba-SQLServer at databaseadvisors.com >http://databaseadvisors.com/mailman/listinfo/dba-sqlserver >http://www.databaseadvisors.com > > >-- >Internal Virus Database is out-of-date. >Checked by AVG Free Edition. >Version: 7.1.409 / Virus Database: 268.14.16/552 - Release Date: 11/26/2006 > > >_______________________________________________ >dba-SQLServer mailing list >dba-SQLServer at databaseadvisors.com >http://databaseadvisors.com/mailman/listinfo/dba-sqlserver >http://www.databaseadvisors.com > _________________________________________________________________ All-in-one security and maintenance for your PC.? Get a free 90-day trial! http://clk.atdmt.com/MSN/go/msnnkwlo0050000002msn/direct/01/?href=http://clk.atdmt.com/MSN/go/msnnkwlo0050000001msn/direct/01/?href=http://www.windowsonecare.com/?sc_cid=msn_hotmail From artful at rogers.com Thu Dec 7 12:25:12 2006 From: artful at rogers.com (artful at rogers.com) Date: Thu, 7 Dec 2006 10:25:12 -0800 (PST) Subject: [dba-SQLServer] strip all leading / trailing spaces Message-ID: <20061207182512.43922.qmail@web88203.mail.re2.yahoo.com> JC, you should now be able to combine this with the other code I showed you, to generate the UPDATE statements you'll need. If you need any more assistance, shout. I was going to do this, but it appears that on my three boxes, I'm running only SQL 2005. I think I'll do something about that. I still have an ancient server -- oh wait, it IS running 2000. When I get a moment I'll combine the two snippets into something that does it all for 2000 as well as 2005. Arthur ----- Original Message ---- From: David Lewis To: dba-sqlserver at databaseadvisors.com Sent: Thursday, December 7, 2006 1:03:56 PM Subject: [dba-SQLServer] strip all leading / trailing spaces For sql2K, your query might looks something like: SELECT o.name Table_Name , c.name Column_Name , t.name DataType , c.Length , CASE WHEN c.isnullable=1 THEN 'Yes' ELSE 'No' END AS 'Nullable' FROM sysobjects o INNER JOIN syscolumns c ON (o.id=c.id and o.type='U') INNER JOIN systypes t ON (c.xtype=t.xtype) ORDER BY o.name, c.name This will give a list of all user tables in the db, with all columns, datatypes, lengths, and if nullable. In the master database there are many stored procedures that can also help you. For this particular problem sp_MSHelpColumns is likely the place to start (and isn't much different from the query above). HTH. D. Lewis _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From rl_stewart at highstream.net Thu Dec 7 13:16:26 2006 From: rl_stewart at highstream.net (Robert L. Stewart) Date: Thu, 07 Dec 2006 13:16:26 -0600 Subject: [dba-SQLServer] Step aside! In-Reply-To: References: Message-ID: <200612071917.kB7JHpq06721@databaseadvisors.com> I am one also. :-) At 11:12 AM 12/7/2006, you wrote: >Date: Thu, 7 Dec 2006 11:57:07 -0500 >From: "Susan Harkins" >Subject: [dba-SQLServer] Step aside! :) >To: >Message-ID: <002001c71a20$bb473470$ecb82ad1 at SUSANONE> >Content-Type: text/plain; charset="US-ASCII" > >SAGITTARIUS > > >The most powerful time in Sagittarian history (is coming up). What you are >seeing is the start of something really big. A month from now will see so >many significant changes, and opportunities take place that you will have >trouble believing in all the good. I trust that this is not the case as you >don't want to miss out on all the fun. The changes you have been >experiencing are for real. You can have all the things you dream of and want >in your life. It is a matter of belief, and confronting the doubts. Seek >stability in taking responsibility for yourself and putting you first. > >=====It's that last two lines that always kicks me in the stomach. There's >always a catch! :) > >Susan H. From newsgrps at dalyn.co.nz Thu Dec 14 11:23:00 2006 From: newsgrps at dalyn.co.nz (David Emerson) Date: Fri, 15 Dec 2006 06:23:00 +1300 Subject: [dba-SQLServer] Restoring Database from Another server Message-ID: <20061214172129.HBZD27893.fep06.xtra.co.nz@Dalyn.dalyn.co.nz> I sent this to the general list but it seems more appropriate for this one. I am looking at the probability of needing to restore a database from my development computer to a client site (overwriting the old possibly corrupt version). There are users and permisions set up on both computers (they should be identical) Are there any things I should be aware of that may cause problems (eg user and role settings not being compatible across the two computers?) Regards David Emerson Dalyn Software Ltd Wellington, New Zealand From newsgrps at dalyn.co.nz Thu Dec 14 11:23:00 2006 From: newsgrps at dalyn.co.nz (David Emerson) Date: Fri, 15 Dec 2006 06:23:00 +1300 Subject: [dba-SQLServer] Restoring Database from Another server Message-ID: <20061214172200.HOCD2805.fep03.xtra.co.nz@Dalyn.dalyn.co.nz> I sent this to the general list but it seems more appropriate for this one. I am looking at the probability of needing to restore a database from my development computer to a client site (overwriting the old possibly corrupt version). There are users and permisions set up on both computers (they should be identical) Are there any things I should be aware of that may cause problems (eg user and role settings not being compatible across the two computers?) Regards David Emerson Dalyn Software Ltd Wellington, New Zealand From fhtapia at gmail.com Thu Dec 14 11:51:38 2006 From: fhtapia at gmail.com (Francisco Tapia) Date: Thu, 14 Dec 2006 09:51:38 -0800 Subject: [dba-SQLServer] Restoring Database from Another server In-Reply-To: <20061214172129.HBZD27893.fep06.xtra.co.nz@Dalyn.dalyn.co.nz> References: <20061214172129.HBZD27893.fep06.xtra.co.nz@Dalyn.dalyn.co.nz> Message-ID: There are, if you re-created users on each server then the mappings for rights won't go over well, You can always run the ophaned user script to re-enable this easily or, alternatively migrate user information from the source server to the destination, if this was done initially then there won't be any problems. I'm curious tho, you say your db may be corrupt, I've seen very few "suspect" dbs on Sql Server 2000 what are the symptoms you are experianceing? ref: http://sqlthis.blogspot.com/2006/01/migrating-logins-from-one-sql-server.html On 12/14/06, David Emerson wrote: > I sent this to the general list but it seems more appropriate for this one. > > I am looking at the probability of needing to restore a database from > my development computer to a client site (overwriting the old > possibly corrupt version). > > There are users and permisions set up on both computers (they should > be identical) > > Are there any things I should be aware of that may cause problems (eg > user and role settings not being compatible across the two computers?) > > > Regards > > David Emerson > Dalyn Software Ltd > Wellington, New Zealand > -- -Francisco http://sqlthis.blogspot.com | Tsql and More... From newsgrps at dalyn.co.nz Thu Dec 14 12:29:28 2006 From: newsgrps at dalyn.co.nz (David Emerson) Date: Fri, 15 Dec 2006 07:29:28 +1300 Subject: [dba-SQLServer] Restoring Database from Another server In-Reply-To: References: <20061214172129.HBZD27893.fep06.xtra.co.nz@Dalyn.dalyn.co.nz> Message-ID: <20061214182801.HHC21914.fep06.xtra.co.nz@Dalyn.dalyn.co.nz> Thanks Francisco, The problem was discussed in the thread in the AccessD list called "Stored Procedure not producing results". In summary, I have three versions of a database which are virtually identical apart from the data. I have 1 stored procedure which on two databases runs within 10 seconds, but on the other takes over 5 minutes. When I copied the data from the slow database to one of the good ones the procedure runs within 10 seconds (this seemed to indicate that it was not the data that was the problem). I tried to compare the design and indexes of the relevant tables and views and they seemed identical. Without spending too much more time on it my solution is to replace the slow version with my master copy. David At 15/12/2006, you wrote: >There are, if you re-created users on each server then the mappings >for rights won't go over well, You can always run the ophaned user >script to re-enable this easily or, alternatively migrate user >information from the source server to the destination, if this was >done initially then there won't be any problems. I'm curious tho, you >say your db may be corrupt, I've seen very few "suspect" dbs on Sql >Server 2000 what are the symptoms you are experianceing? > >ref: >http://sqlthis.blogspot.com/2006/01/migrating-logins-from-one-sql-server.html > > >On 12/14/06, David Emerson wrote: > > I sent this to the general list but it seems more appropriate for this one. > > > > I am looking at the probability of needing to restore a database from > > my development computer to a client site (overwriting the old > > possibly corrupt version). > > > > There are users and permisions set up on both computers (they should > > be identical) > > > > Are there any things I should be aware of that may cause problems (eg > > user and role settings not being compatible across the two computers?) > > > > > > Regards > > > > David Emerson > > Dalyn Software Ltd > > Wellington, New Zealand > > > > > >-- >-Francisco >http://sqlthis.blogspot.com | Tsql and More... >_______________________________________________ >dba-SQLServer mailing list >dba-SQLServer at databaseadvisors.com >http://databaseadvisors.com/mailman/listinfo/dba-sqlserver >http://www.databaseadvisors.com From newsgrps at dalyn.co.nz Thu Dec 14 12:32:21 2006 From: newsgrps at dalyn.co.nz (David Emerson) Date: Fri, 15 Dec 2006 07:32:21 +1300 Subject: [dba-SQLServer] Restoring Database from Another server In-Reply-To: References: <20061214172129.HBZD27893.fep06.xtra.co.nz@Dalyn.dalyn.co.nz> Message-ID: <20061214183054.DZGY26962.fep01.xtra.co.nz@Dalyn.dalyn.co.nz> The users we want are the existing ones on the destination server, not the source server. They already exist for another database on the destination server. Will I need to save the current users on the destination server and reapply them once the database is restored? David At 15/12/2006, you wrote: >There are, if you re-created users on each server then the mappings >for rights won't go over well, You can always run the ophaned user >script to re-enable this easily or, alternatively migrate user >information from the source server to the destination, if this was >done initially then there won't be any problems. I'm curious tho, you >say your db may be corrupt, I've seen very few "suspect" dbs on Sql >Server 2000 what are the symptoms you are experianceing? > >ref: >http://sqlthis.blogspot.com/2006/01/migrating-logins-from-one-sql-server.html > > >On 12/14/06, David Emerson wrote: > > I sent this to the general list but it seems more appropriate for this one. > > > > I am looking at the probability of needing to restore a database from > > my development computer to a client site (overwriting the old > > possibly corrupt version). > > > > There are users and permisions set up on both computers (they should > > be identical) > > > > Are there any things I should be aware of that may cause problems (eg > > user and role settings not being compatible across the two computers?) > > > > > > Regards > > > > David Emerson > > Dalyn Software Ltd > > Wellington, New Zealand > > > > > >-- >-Francisco >http://sqlthis.blogspot.com | Tsql and More... >_______________________________________________ >dba-SQLServer mailing list >dba-SQLServer at databaseadvisors.com >http://databaseadvisors.com/mailman/listinfo/dba-sqlserver >http://www.databaseadvisors.com From newsgrps at dalyn.co.nz Thu Dec 14 11:23:00 2006 From: newsgrps at dalyn.co.nz (David Emerson) Date: Fri, 15 Dec 2006 06:23:00 +1300 Subject: [dba-SQLServer] Restoring Database from Another server Message-ID: <20061214172200.HOCD2805.fep03.xtra.co.nz@Dalyn.dalyn.co.nz> I sent this to the general list but it seems more appropriate for this one. I am looking at the probability of needing to restore a database from my development computer to a client site (overwriting the old possibly corrupt version). There are users and permisions set up on both computers (they should be identical) Are there any things I should be aware of that may cause problems (eg user and role settings not being compatible across the two computers?) Regards David Emerson Dalyn Software Ltd Wellington, New Zealand From artful at rogers.com Thu Dec 14 23:19:42 2006 From: artful at rogers.com (artful at rogers.com) Date: Thu, 14 Dec 2006 21:19:42 -0800 (PST) Subject: [dba-SQLServer] Indexing on a small number of values in a column Message-ID: <20061215051942.89514.qmail@web88208.mail.re2.yahoo.com> I have heard or read that creating an index on a column containing a small number of values is pointless. a) Given a column Sex with a constraint "M/F", is there any point indexing this column? b) Given the same column defined as a bit, you can't index it (afaik). c) Assuming that it is pointless to index a column containng < n distinct values, what is the value of n? Assume 100M rows in the table of interest? TIA, Arthur From stuart at lexacorp.com.pg Thu Dec 14 23:47:19 2006 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Fri, 15 Dec 2006 15:47:19 +1000 Subject: [dba-SQLServer] Indexing on a small number of values in a column In-Reply-To: <20061215051942.89514.qmail@web88208.mail.re2.yahoo.com> References: <20061215051942.89514.qmail@web88208.mail.re2.yahoo.com> Message-ID: <458236E7.27912.1462D59B@stuart.lexacorp.com.pg> On 14 Dec 2006 at 21:19, artful at rogers.com wrote: > I have heard or read that creating an index on a column containing a small > number of values is pointless. > > a) Given a column Sex with a constraint "M/F", is there any point indexing > this column? b) Given the same column defined as a bit, you can't index it > (afaik). c) Assuming that it is pointless to index a column containng < n > distinct values, what is the value of n? Assume 100M rows in the table of > interest? See: http://msdn2.microsoft.com/en-us/library/aa224773(sql.80).aspx "My tests show that a table scan often starts to perform better than a nonclustered index access when at least 10 percent of the rows are selected. I also found that the optimizer switches from nonclustered index access to table scan prematurely (i.e., when nonclustered index access still shows better response time than the corresponding table scan). In many cases, the optimizer forces a table scan for queries with result sets of approximately 5 percent, although the table scan becomes more efficient than index access at selectivities of 8 to 10 percent." also http://www.sql-server-performance.com/am_indexing_low_sel_cols.asp for some real life tests and ideas on how to measure the effectiveness of an index. -- Stuart From artful at rogers.com Sun Dec 17 05:36:14 2006 From: artful at rogers.com (artful at rogers.com) Date: Sun, 17 Dec 2006 03:36:14 -0800 (PST) Subject: [dba-SQLServer] SQL and Vista Message-ID: <20061217113614.30910.qmail@web88211.mail.re2.yahoo.com> According to this story (http://money.cnn.com/2006/12/14/magazines/business2/microsoft_vista.biz2/index.htm), SQL Server won't run on Vista at least until MS serves up a patch. Has anyone independently verified that the content of this story is true? Unfortunately I cannot verify it since I don't yet have a copy of Vista other than the beta. Arthur From mwp.reid at qub.ac.uk Sun Dec 17 06:03:51 2006 From: mwp.reid at qub.ac.uk (Martin Reid) Date: Sun, 17 Dec 2006 12:03:51 -0000 Subject: [dba-SQLServer] SQL and Vista References: <20061217113614.30910.qmail@web88211.mail.re2.yahoo.com> Message-ID: Think its only the Express version. Martin Martin WP Reid Training and Assessment Unit Riddle Hall Belfast tel: 02890 974477 ________________________________ From: dba-sqlserver-bounces at databaseadvisors.com on behalf of artful at rogers.com Sent: Sun 17/12/2006 11:36 To: AccessD at databaseadvisors. com; dba-SQLServer Cc: Pete Simpson; tsql at yahoogroups.com; Peter Brawley Subject: [dba-SQLServer] SQL and Vista According to this story (http://money.cnn.com/2006/12/14/magazines/business2/microsoft_vista.biz2/index.htm), SQL Server won't run on Vista at least until MS serves up a patch. Has anyone independently verified that the content of this story is true? Unfortunately I cannot verify it since I don't yet have a copy of Vista other than the beta. Arthur _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From john at winhaven.net Mon Dec 18 11:10:21 2006 From: john at winhaven.net (John Bartow) Date: Mon, 18 Dec 2006 11:10:21 -0600 Subject: [dba-SQLServer] Database Advisors lists Message-ID: <003a01c722c7$66c0b4d0$1402a8c0@ScuzzPaq> Dear dba-sqlserver at databaseadvisors.com, Isn?t access-d a great list? We?re the kind of community that actually works?we get the technical help we need free, and without the ego trappings that you?ll suffer from on other lists. I know that I find the list invaluable, and there are several others?industry leaders?that agree with me. Two of our members, Susan Harkins and Martin Reid, published a Jet SQL book together in 2002, and this is what appears in the book?s Acknowledgements section: ?Thanks? to the AccessD folks for all their great advice and help over the years. If someone on that list can?t solve your problem, it can?t be solved.? And she?s right. That has been my experience with the list for the last seven years. The list isn?t a miracle of internet magic though. It costs money to run the site and lists. So, I?ll be blunt, I?m asking for donations, both large and small so we can keep this great resource going. (Membership isn?t tied to donations. The AccessD community is free.) It?s a small sacrifice considering what you get! Where else can you find people, from all over the globe, prepared to help you solve your technical problems? Have you ever had a thread save you time? If you?re like me, that saves me money. And, just importantly, think of the times you?ve helped someone else. If you?d like to donate using a credit card or PayPal, visit HYPERLINK "http://www.databaseadvisors.com/donations.asp"http://www.databaseadvisors.c om/donations.aspHYPERLINK "http://www.databaseadvisors.com/" and click [Make a Donation]. If you?d rather send a check through regular mail, please contact HYPERLINK "mailto:treasurer at databaseadvisors.com%20"treasurer at databaseadvisors.com for mailing instructions. (Please include "donation" in the subject line.) Donations will be listed on the web site as follows: -Major/Corporate Sponsors: $120 or more Major/Corporate Sponsors may* appear on our DBA Major/Corporate Sponsors Support page in large type face for one month for each $10 donated PLUS Major/Corporate Sponsors may* place their logo with a link to their web site on the DBA page of their choice for the same period of time. -Friends of DBA: $120 to $60 Friends may* appear on our DBA Friends Support page in large type face for one month for each $10 donated. -DBA Donors: $60 or less Donors may* appear on our DBA Donors Support page in normal type face for one month for each $10 donated. *If you?d rather not be listed on the website, let us know and we'll keep your donation anonymous. Thank you for considering a donation to DBA, John Bartow, President Database Advisors, Inc. Email: HYPERLINK "mailto:president at databaseadvisors.com"mailto:president at databaseadvisors.com Website: HYPERLINK "http://www.databaseadvisors.com/" \nhttp://www.databaseadvisors.com -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.409 / Virus Database: 268.15.24/592 - Release Date: 12/18/2006 From artful at rogers.com Tue Dec 19 20:27:52 2006 From: artful at rogers.com (artful at rogers.com) Date: Tue, 19 Dec 2006 18:27:52 -0800 (PST) Subject: [dba-SQLServer] Find the second occurrence of a character in a string Message-ID: <20061220022752.37887.qmail@web88206.mail.re2.yahoo.com> Assume these two values in two rows in the table of interest: Andrei Pascal Arthur B. Fuller I need to parse out the surname. I can't just grab the characters following the first space, unless there is only one space. But if there are two spaces, then I need the trailing string following the second space. CHARINDEX( 'f', 'abcdefgh' ) returns 6 so that part is easy. How to find the second occurrence, if any? In fact, assuming really bizarre data, what I want is the string following the last space in the value. Even that may not work, given Portuguese and Spanish and French surnames, but for now I will live with that. Suppose an entry such as: Juan Carlos de la Vega I need to grab the string following the last space, in T-SQL syntax. Any ideas? TIA, Arthur From stuart at lexacorp.com.pg Tue Dec 19 21:06:16 2006 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Wed, 20 Dec 2006 13:06:16 +1000 Subject: [dba-SQLServer] Find the second occurrence of a character in a string In-Reply-To: <20061220022752.37887.qmail@web88206.mail.re2.yahoo.com> References: <20061220022752.37887.qmail@web88206.mail.re2.yahoo.com> Message-ID: <4588A8A8.18226.2C5A4F@stuart.lexacorp.com.pg> How about (aircode): RIGHT(FullName,CHARINDEX(' ',REVERSE(FullName))-1) On 19 Dec 2006 at 18:27, artful at rogers.com wrote: > Assume these two values in two rows in the table of interest: > > Andrei Pascal > Arthur B. Fuller > > I need to parse out the surname. I can't just grab the characters following > the first space, unless there is only one space. But if there are two > spaces, then I need the trailing string following the second space. > > CHARINDEX( 'f', 'abcdefgh' ) returns 6 so that part is easy. How to find > the second occurrence, if any? In fact, assuming really bizarre data, what I > want is the string following the last space in the value. > > Even that may not work, given Portuguese and Spanish and French surnames, > but for now I will live with that. > > Suppose an entry such as: > > Juan Carlos de la Vega > > I need to grab the string following the last space, in T-SQL syntax. > > Any ideas? > TIA, > Arthur > > > _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com > -- Stuart From michael at ddisolutions.com.au Tue Dec 19 21:14:07 2006 From: michael at ddisolutions.com.au (Michael Maddison) Date: Wed, 20 Dec 2006 14:14:07 +1100 Subject: [dba-SQLServer] Find the second occurrence of a character in astring Message-ID: <59A61174B1F5B54B97FD4ADDE71E7D0116AE83@ddi-01.DDI.local> Hi Arthur, REVERSE is what you need. Something like... SELECT RTRIM(REVERSE(SUBSTRING(REVERSE(pub_name), CHARINDEX(' ', REVERSE(pub_name)), 100))) AS Expr1 FROM publishers cheers Michael M To: dba-sqlserver at databaseadvisors.com Cc: Peter Brawley Subject: [dba-SQLServer] Find the second occurrence of a character in astring Assume these two values in two rows in the table of interest: Andrei Pascal Arthur B. Fuller I need to parse out the surname. I can't just grab the characters following the first space, unless there is only one space. But if there are two spaces, then I need the trailing string following the second space. CHARINDEX( 'f', 'abcdefgh' ) returns 6 so that part is easy. How to find the second occurrence, if any? In fact, assuming really bizarre data, what I want is the string following the last space in the value. Even that may not work, given Portuguese and Spanish and French surnames, but for now I will live with that. Suppose an entry such as: Juan Carlos de la Vega I need to grab the string following the last space, in T-SQL syntax. Any ideas? TIA, Arthur _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From michael at ddisolutions.com.au Tue Dec 19 21:19:21 2006 From: michael at ddisolutions.com.au (Michael Maddison) Date: Wed, 20 Dec 2006 14:19:21 +1100 Subject: [dba-SQLServer] Find the second occurrence of a character in astring Message-ID: <59A61174B1F5B54B97FD4ADDE71E7D0116AE84@ddi-01.DDI.local> Stuart, SELECT LTRIM(RIGHT(pub_name, CHARINDEX(' ', REVERSE(pub_name)))) AS Expr1 FROM publishers The -1 throws an error if there are no spaces. This works fine and is better then mine. cheers Michael M -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Stuart McLachlan Sent: Wednesday, 20 December 2006 2:06 PM To: dba-sqlserver at databaseadvisors.com Subject: Re: [dba-SQLServer] Find the second occurrence of a character in astring How about (aircode): RIGHT(FullName,CHARINDEX(' ',REVERSE(FullName))-1) On 19 Dec 2006 at 18:27, artful at rogers.com wrote: > Assume these two values in two rows in the table of interest: > > Andrei Pascal > Arthur B. Fuller > > I need to parse out the surname. I can't just grab the characters > following the first space, unless there is only one space. But if > there are two spaces, then I need the trailing string following the second space. > > CHARINDEX( 'f', 'abcdefgh' ) returns 6 so that part is easy. How to > find the second occurrence, if any? In fact, assuming really bizarre > data, what I want is the string following the last space in the value. > > Even that may not work, given Portuguese and Spanish and French > surnames, but for now I will live with that. > > Suppose an entry such as: > > Juan Carlos de la Vega > > I need to grab the string following the last space, in T-SQL syntax. > > Any ideas? > TIA, > Arthur > > > _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com > -- Stuart _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From michael at ddisolutions.com.au Tue Dec 19 21:21:13 2006 From: michael at ddisolutions.com.au (Michael Maddison) Date: Wed, 20 Dec 2006 14:21:13 +1100 Subject: [dba-SQLServer] Linked Oracle Server Message-ID: <59A61174B1F5B54B97FD4ADDE71E7D0116AE85@ddi-01.DDI.local> While I'm thinking of it, anyone set up a linked Oracle server in 2K? What should the provider string look like? None of the examples I've found seem to work for me. cheers Michael Maddison DDI Solutions Pty Ltd michael at ddisolutions.com.au Bus: 0260400620 Mob: 0412620497 www.ddisolutions.com.au From stuart at lexacorp.com.pg Tue Dec 19 23:55:27 2006 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Wed, 20 Dec 2006 15:55:27 +1000 Subject: [dba-SQLServer] Find the second occurrence of a character in astring In-Reply-To: <59A61174B1F5B54B97FD4ADDE71E7D0116AE84@ddi-01.DDI.local> References: <59A61174B1F5B54B97FD4ADDE71E7D0116AE84@ddi-01.DDI.local> Message-ID: <4588D04F.26129.C73E1A@stuart.lexacorp.com.pg> Good point. I did call it as "aircode" and didn't think about exceptions to the examples. On 20 Dec 2006 at 14:19, Michael Maddison wrote: > Stuart, > > SELECT LTRIM(RIGHT(pub_name, CHARINDEX(' ', REVERSE(pub_name)))) AS > Expr1 FROM publishers > > The -1 throws an error if there are no spaces. > This works fine and is better then mine. > > cheers > > Michael M > > -----Original Message----- > From: dba-sqlserver-bounces at databaseadvisors.com > [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Stuart > McLachlan Sent: Wednesday, 20 December 2006 2:06 PM To: > dba-sqlserver at databaseadvisors.com Subject: Re: [dba-SQLServer] Find the > second occurrence of a character in astring > > How about (aircode): > RIGHT(FullName,CHARINDEX(' ',REVERSE(FullName))-1) > > > On 19 Dec 2006 at 18:27, artful at rogers.com wrote: > > > Assume these two values in two rows in the table of interest: > > > > Andrei Pascal > > Arthur B. Fuller > > > > I need to parse out the surname. I can't just grab the characters > > following the first space, unless there is only one space. But if > > there are two spaces, then I need the trailing string following the > second space. > > > > CHARINDEX( 'f', 'abcdefgh' ) returns 6 so that part is easy. How to find > > the second occurrence, if any? In fact, assuming really bizarre data, what > > I want is the string following the last space in the value. > > > > Even that may not work, given Portuguese and Spanish and French > > surnames, but for now I will live with that. > > > > Suppose an entry such as: > > > > Juan Carlos de la Vega > > > > I need to grab the string following the last space, in T-SQL syntax. > > > > Any ideas? > > TIA, > > Arthur > > > > > > _______________________________________________ > > dba-SQLServer mailing list > > dba-SQLServer at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > > http://www.databaseadvisors.com > > > > -- > Stuart > > > _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com > > _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com > -- Stuart From jwcolby at colbyconsulting.com Wed Dec 20 03:05:08 2006 From: jwcolby at colbyconsulting.com (JWColby) Date: Wed, 20 Dec 2006 04:05:08 -0500 Subject: [dba-SQLServer] Find the second occurrence of a character in astring In-Reply-To: <20061220022752.37887.qmail@web88206.mail.re2.yahoo.com> Message-ID: <002401c72415$f2f4ef80$657aa8c0@m6805> For Spanish names even that does not work, although I think the difference is not worth fighting for (but I'm not Spanish). Vega is not the last name. De La Vega is the last name. De la means "of the" as in Of The Vega. Mi amigo in Mexico es Juan De Uriarte, Juan being the first name, De Uriarte being the Paternal family name. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of artful at rogers.com Sent: Tuesday, December 19, 2006 9:28 PM To: dba-sqlserver at databaseadvisors.com Cc: Peter Brawley Subject: [dba-SQLServer] Find the second occurrence of a character in astring Assume these two values in two rows in the table of interest: Andrei Pascal Arthur B. Fuller I need to parse out the surname. I can't just grab the characters following the first space, unless there is only one space. But if there are two spaces, then I need the trailing string following the second space. CHARINDEX( 'f', 'abcdefgh' ) returns 6 so that part is easy. How to find the second occurrence, if any? In fact, assuming really bizarre data, what I want is the string following the last space in the value. Even that may not work, given Portuguese and Spanish and French surnames, but for now I will live with that. Suppose an entry such as: Juan Carlos de la Vega I need to grab the string following the last space, in T-SQL syntax. Any ideas? TIA, Arthur _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From martyconnelly at shaw.ca Wed Dec 20 16:58:04 2006 From: martyconnelly at shaw.ca (MartyConnelly) Date: Wed, 20 Dec 2006 14:58:04 -0800 Subject: [dba-SQLServer] SQL and Vista In-Reply-To: References: <20061217113614.30910.qmail@web88211.mail.re2.yahoo.com> Message-ID: <4589BFFC.4020800@shaw.ca> Got this from SSWUG.org tip by Alexander Chigrik Holy Compatibility Batman - SQL Server Express on Vista? SQL Server 2005 Incompatibility Buzz Wow. The 'net is alive with a feeding frenzy about SQL Server 2005 Express not working on Vista. You would have thought it was found that hard disk drives didn't work with Vista. I haven't seen so much FUD in a looooooong time. First off, Vista isn't GA (General Availability - retail) and is only starting to be considered for deployment in the new year. Second, there is already a service pack out for SQL Server Express that lets it work on Vista. I know. I've used it. (You can get it here) Running SQL Server on "Microsoft Windows Server Longhorn" or Microsoft Windows Vista In an effort to provide customers with more secure products, Microsoft Windows Server "Longhorn" and Microsoft Windows Vista will only support SQL Server 2005 Service Pack 2 (SP2) or later when it becomes available. http://www.microsoft.com/sql/howtobuy/sqlonvista.mspx click on SQL Server 2005 Service Pack 2 (SP2) to http://www.microsoft.com/sql/ctp.mspx SQL Server 2005 Service Pack 2 CTP (December 2006) SQL Server 2005 Express Edition and Tools Service Pack 2 CTP (December 2006) "If you're looking to run SQL Server Express on Windows Vista, you'll need to have the service pack installed. The service pack to enable the balance of SQL Server 2005 will be released Q1 of 2007. It's unfortunate to have to wait, but if you need to run it on your early installations of Vista, make sure you get the service packs." Martin Reid wrote: >Think its only the Express version. > >Martin > >Martin WP Reid >Training and Assessment Unit >Riddle Hall >Belfast > >tel: 02890 974477 > > >________________________________ > >From: dba-sqlserver-bounces at databaseadvisors.com on behalf of artful at rogers.com >Sent: Sun 17/12/2006 11:36 >To: AccessD at databaseadvisors. com; dba-SQLServer >Cc: Pete Simpson; tsql at yahoogroups.com; Peter Brawley >Subject: [dba-SQLServer] SQL and Vista > > > >According to this story (http://money.cnn.com/2006/12/14/magazines/business2/microsoft_vista.biz2/index.htm), SQL Server won't run on Vista at least until MS serves up a patch. > >Has anyone independently verified that the content of this story is true? Unfortunately I cannot verify it since I don't yet have a copy of Vista other than the beta. > > >Arthur >_________ > > > >------------------------------------------------------------------------ > >No virus found in this incoming message. >Checked by AVG Free Edition. >Version: 7.5.432 / Virus Database: 268.15.21/589 - Release Date: 15/12/2006 5:10 PM > > -- Marty Connelly Victoria, B.C. Canada From artful at rogers.com Wed Dec 20 18:52:14 2006 From: artful at rogers.com (artful at rogers.com) Date: Wed, 20 Dec 2006 16:52:14 -0800 (PST) Subject: [dba-SQLServer] Find the second occurrence of a character in astring Message-ID: <20061221005214.16706.qmail@web88205.mail.re2.yahoo.com> You sidestepped the important issue, JC (well important in some contexts), which is how does one sort this? A. ----- Original Message ---- From: JWColby To: dba-sqlserver at databaseadvisors.com Sent: Wednesday, December 20, 2006 4:05:08 AM Subject: Re: [dba-SQLServer] Find the second occurrence of a character in astring For Spanish names even that does not work, although I think the difference is not worth fighting for (but I'm not Spanish). Vega is not the last name. De La Vega is the last name. De la means "of the" as in Of The Vega. Mi amigo in Mexico es Juan De Uriarte, Juan being the first name, De Uriarte being the Paternal family name. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of artful at rogers.com Sent: Tuesday, December 19, 2006 9:28 PM To: dba-sqlserver at databaseadvisors.com Cc: Peter Brawley Subject: [dba-SQLServer] Find the second occurrence of a character in astring Assume these two values in two rows in the table of interest: Andrei Pascal Arthur B. Fuller I need to parse out the surname. I can't just grab the characters following the first space, unless there is only one space. But if there are two spaces, then I need the trailing string following the second space. CHARINDEX( 'f', 'abcdefgh' ) returns 6 so that part is easy. How to find the second occurrence, if any? In fact, assuming really bizarre data, what I want is the string following the last space in the value. Even that may not work, given Portuguese and Spanish and French surnames, but for now I will live with that. Suppose an entry such as: Juan Carlos de la Vega I need to grab the string following the last space, in T-SQL syntax. Any ideas? TIA, Arthur _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Wed Dec 20 19:54:28 2006 From: jwcolby at colbyconsulting.com (JWColby) Date: Wed, 20 Dec 2006 20:54:28 -0500 Subject: [dba-SQLServer] Find the second occurrence of a character inastring In-Reply-To: <20061221005214.16706.qmail@web88205.mail.re2.yahoo.com> Message-ID: <008e01c724a2$f3a335d0$657aa8c0@m6805> I sidestepped it because it is not trivial. I did a system in Access and ended up using a name lookup. There are all kinds of issues, just in European names. Take the Micks and Macks, O'donnely etc. Sometimes they are right next to each other, sometimes space separated. Spanish and french have their own issues. Spanish is a true mess due to the fact that the women often take the husband's name as their MIDDLE name keeping their MATERNAL family name (IIRC) as their last name. I mean you have to KNOW THE RULES to sort that kind of stuff out, and then you have to know the language that the name is. AFAICT, the professional systems also resort to name lookups in at least some cases. I ended up finding a large list of (correctly spelled) names, then running all of the names in a huge database of mine through that list, then taking the ones that fell out, visually checking them, and placing valid ones in the lookup table. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of artful at rogers.com Sent: Wednesday, December 20, 2006 7:52 PM To: dba-sqlserver at databaseadvisors.com Subject: Re: [dba-SQLServer] Find the second occurrence of a character inastring You sidestepped the important issue, JC (well important in some contexts), which is how does one sort this? A. ----- Original Message ---- From: JWColby To: dba-sqlserver at databaseadvisors.com Sent: Wednesday, December 20, 2006 4:05:08 AM Subject: Re: [dba-SQLServer] Find the second occurrence of a character in astring For Spanish names even that does not work, although I think the difference is not worth fighting for (but I'm not Spanish). Vega is not the last name. De La Vega is the last name. De la means "of the" as in Of The Vega. Mi amigo in Mexico es Juan De Uriarte, Juan being the first name, De Uriarte being the Paternal family name. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of artful at rogers.com Sent: Tuesday, December 19, 2006 9:28 PM To: dba-sqlserver at databaseadvisors.com Cc: Peter Brawley Subject: [dba-SQLServer] Find the second occurrence of a character in astring Assume these two values in two rows in the table of interest: Andrei Pascal Arthur B. Fuller I need to parse out the surname. I can't just grab the characters following the first space, unless there is only one space. But if there are two spaces, then I need the trailing string following the second space. CHARINDEX( 'f', 'abcdefgh' ) returns 6 so that part is easy. How to find the second occurrence, if any? In fact, assuming really bizarre data, what I want is the string following the last space in the value. Even that may not work, given Portuguese and Spanish and French surnames, but for now I will live with that. Suppose an entry such as: Juan Carlos de la Vega I need to grab the string following the last space, in T-SQL syntax. Any ideas? TIA, Arthur _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From rl_stewart at highstream.net Thu Dec 21 12:41:04 2006 From: rl_stewart at highstream.net (Robert L. Stewart) Date: Thu, 21 Dec 2006 12:41:04 -0600 Subject: [dba-SQLServer] Find the second occurrence of a character in a string In-Reply-To: References: Message-ID: <200612211844.kBLIipq22530@databaseadvisors.com> You put it in the right columns to begin with and don't try to parse it out of a single one. :-) At 12:00 PM 12/21/2006, you wrote: >Date: Wed, 20 Dec 2006 16:52:14 -0800 (PST) >From: artful at rogers.com >Subject: Re: [dba-SQLServer] Find the second occurrence of a character > in astring >To: dba-sqlserver at databaseadvisors.com >Message-ID: <20061221005214.16706.qmail at web88205.mail.re2.yahoo.com> >Content-Type: text/plain; charset=ascii > >You sidestepped the important issue, JC (well important in some >contexts), which is how does one sort this? > >A. > >----- Original Message ---- >From: JWColby >To: dba-sqlserver at databaseadvisors.com >Sent: Wednesday, December 20, 2006 4:05:08 AM >Subject: Re: [dba-SQLServer] Find the second occurrence of a >character in astring > >For Spanish names even that does not work, although I think the difference >is not worth fighting for (but I'm not Spanish). Vega is not the last name. >De La Vega is the last name. De la means "of the" as in Of The Vega. Mi >amigo in Mexico es Juan De Uriarte, Juan being the first name, De Uriarte >being the Paternal family name. > > >John W. Colby >Colby Consulting >www.ColbyConsulting.com From artful at rogers.com Thu Dec 21 14:00:05 2006 From: artful at rogers.com (artful at rogers.com) Date: Thu, 21 Dec 2006 12:00:05 -0800 (PST) Subject: [dba-SQLServer] Find the second occurrence of a character in a string Message-ID: <20061221200005.15499.qmail@web88207.mail.re2.yahoo.com> I appreciate your point, but I'm still not certain of the best way to go with my question, which concerns the way to handle some unusual surnames. van den Berq la Flame de la Vega Ben Gurion and any number of names that begin with "al". Or "da" as in Leonardo. My very limited Italian suggests that Leonardo was born in a town called Vinci. So how does one sort such a list? On the capitalized word? On the first letter of the two or three words considered the surname? Advice from Europeans, Asians, Africans, or even North Americans familiar with this problem, would be appreciated. I have no immediate problem that requires this solution. This is purely theoretical at the moment, but who knows, someday I may need the answer. TIA, Arthur ----- Original Message ---- From: Robert L. Stewart To: dba-sqlserver at databaseadvisors.com Sent: Thursday, December 21, 2006 1:41:04 PM Subject: Re: [dba-SQLServer] Find the second occurrence of a character in a string You put it in the right columns to begin with and don't try to parse it out of a single one. :-) From martyconnelly at shaw.ca Thu Dec 21 14:25:19 2006 From: martyconnelly at shaw.ca (MartyConnelly) Date: Thu, 21 Dec 2006 12:25:19 -0800 Subject: [dba-SQLServer] Find the second occurrence of a character in a string In-Reply-To: <20061221200005.15499.qmail@web88207.mail.re2.yahoo.com> References: <20061221200005.15499.qmail@web88207.mail.re2.yahoo.com> Message-ID: <458AEDAF.7050901@shaw.ca> I would look up the difference between Phone Book and Dictionary collations artful at rogers.com wrote: >I appreciate your point, but I'm still not certain of the best way to go with my question, which concerns the way to handle some unusual surnames. > >van den Berq >la Flame >de la Vega >Ben Gurion > >and any number of names that begin with "al". Or "da" as in Leonardo. My very limited Italian suggests that Leonardo was born in a town called Vinci. > >So how does one sort such a list? On the capitalized word? On the first letter of the two or three words considered the surname? > >Advice from Europeans, Asians, Africans, or even North Americans familiar with this problem, would be appreciated. I have no immediate problem that requires this solution. This is purely theoretical at the moment, but who knows, someday I may need the answer. > >TIA, >Arthur > >----- Original Message ---- >From: Robert L. Stewart >To: dba-sqlserver at databaseadvisors.com >Sent: Thursday, December 21, 2006 1:41:04 PM >Subject: Re: [dba-SQLServer] Find the second occurrence of a character in a string > >You put it in the right columns to begin with and don't try to >parse it out of a single one. :-) > > > > > -- Marty Connelly Victoria, B.C. Canada From szayko at secor.com Thu Dec 21 14:45:36 2006 From: szayko at secor.com (Steve Zayko) Date: Thu, 21 Dec 2006 12:45:36 -0800 Subject: [dba-SQLServer] Upload documents with MSAccess FE Message-ID: <10B9AE4E39C0DD4BB317CC8A0F0AA4010108F565@exch100a.secor.com> I am trying to develop a system where Adobe pdf documents are stored in a SQL server database. The method I am using to "store" the files is an MSAccess front end. I have an unbound form with an Object Frame and a few other text boxes for extraneous information. I try to place the pdf document in the object frame with the menu command Insert/Object and then run an SQL script to append the object (and other data fields) to the destination table in the SQL database. The trouble I am having is that the field in the destination table is "Image(16)". Every object I append to the table in the method described above fills the entire memory space allotted for that field. Thus a 20Kb pdf file will become a 5+ Mb object once in the field. I don't need to know the mechanics of why this is happening. I just was wondering if there were others who have experienced this (or similar) issue and what can I do to fix it. Thanks in advance for you assistance. Should I cross post this to AccessD list? Stephen R. Zayko PE SECOR International Inc 2321 Club Meridian Drive Ste E Okemos, MI 48864 (517) 349-9499 ext 224 (517) 204-5136 (c) From fkkendrick at cox.net Thu Dec 21 15:22:46 2006 From: fkkendrick at cox.net (F Kay Kendrick) Date: Thu, 21 Dec 2006 15:22:46 -0600 Subject: [dba-SQLServer] Find the second occurrence of a character in astring In-Reply-To: <20061220022752.37887.qmail@web88206.mail.re2.yahoo.com> Message-ID: <000001c72546$29350ef0$040aa8c0@dragon> I found a response to a discussion "Parse Full name into first and last name" that seems to work (bottom of the page). http://www.sqlservercentral.com/forums/shwmessage.aspx?forumid=8&messageid=1 16943 HTH F K Kendrick -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of artful at rogers.com Sent: Tuesday, December 19, 2006 8:28 PM To: dba-sqlserver at databaseadvisors.com Cc: Peter Brawley Subject: [dba-SQLServer] Find the second occurrence of a character in astring Assume these two values in two rows in the table of interest: Andrei Pascal Arthur B. Fuller I need to parse out the surname. I can't just grab the characters following the first space, unless there is only one space. But if there are two spaces, then I need the trailing string following the second space. CHARINDEX( 'f', 'abcdefgh' ) returns 6 so that part is easy. How to find the second occurrence, if any? In fact, assuming really bizarre data, what I want is the string following the last space in the value. Even that may not work, given Portuguese and Spanish and French surnames, but for now I will live with that. Suppose an entry such as: Juan Carlos de la Vega I need to grab the string following the last space, in T-SQL syntax. Any ideas? TIA, Arthur _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From artful at rogers.com Thu Dec 21 15:30:46 2006 From: artful at rogers.com (artful at rogers.com) Date: Thu, 21 Dec 2006 13:30:46 -0800 (PST) Subject: [dba-SQLServer] Upload documents with MSAccess FE Message-ID: <20061221213046.33056.qmail@web88201.mail.re2.yahoo.com> I am not sure of the mechanics, but I feel obligated to question the approach. To what advantage is it to store the images as binary objects in a column? If you have a large number of images, you may have a point (given the built-in restrictions on number of files in a directory), but that aside, why bother? Why not store the path to the images instead? Then all you are dealing with is a varchar(100) or so string and you don't encumber the database at all. You can hand off the path string to whatever front end is of interest and the front end can accept the path and load the image. IMO, the same thing applies to Word documents or any other sort of binary storage. I just don't see the value of storing a file as a binary object in a row-column. Arthur ----- Original Message ---- From: Steve Zayko To: dba-sqlserver at databaseadvisors.com Sent: Thursday, December 21, 2006 3:45:36 PM Subject: [dba-SQLServer] Upload documents with MSAccess FE I am trying to develop a system where Adobe pdf documents are stored in a SQL server database. The method I am using to "store" the files is an MSAccess front end. I have an unbound form with an Object Frame and a few other text boxes for extraneous information. I try to place the pdf document in the object frame with the menu command Insert/Object and then run an SQL script to append the object (and other data fields) to the destination table in the SQL database. The trouble I am having is that the field in the destination table is "Image(16)". Every object I append to the table in the method described above fills the entire memory space allotted for that field. Thus a 20Kb pdf file will become a 5+ Mb object once in the field. I don't need to know the mechanics of why this is happening. I just was wondering if there were others who have experienced this (or similar) issue and what can I do to fix it. Thanks in advance for you assistance. Should I cross post this to AccessD list? Stephen R. Zayko PE SECOR International Inc 2321 Club Meridian Drive Ste E Okemos, MI 48864 (517) 349-9499 ext 224 (517) 204-5136 (c) _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From martyconnelly at shaw.ca Thu Dec 21 15:48:33 2006 From: martyconnelly at shaw.ca (MartyConnelly) Date: Thu, 21 Dec 2006 13:48:33 -0800 Subject: [dba-SQLServer] Upload documents with MSAccess FE In-Reply-To: <10B9AE4E39C0DD4BB317CC8A0F0AA4010108F565@exch100a.secor.com> References: <10B9AE4E39C0DD4BB317CC8A0F0AA4010108F565@exch100a.secor.com> Message-ID: <458B0131.1090808@shaw.ca> If you do it this way the file is saved as a BMP file surrounded with a OLE wrapper hence the large size in the OLE field. The way to do it is write the file into an OLE field with AppendChunk and read with GetChunk, I use this to store large XML files. Then maybe move to Vchar field in SQL. Cross post might get you more answers Steve Zayko wrote: >I am trying to develop a system where Adobe pdf documents are stored in >a SQL server database. The method I am using to "store" the files is an >MSAccess front end. I have an unbound form with an Object Frame and a >few other text boxes for extraneous information. I try to place the pdf >document in the object frame with the menu command Insert/Object and >then run an SQL script to append the object (and other data fields) to >the destination table in the SQL database. > >The trouble I am having is that the field in the destination table is >"Image(16)". Every object I append to the table in the method described >above fills the entire memory space allotted for that field. Thus a >20Kb pdf file will become a 5+ Mb object once in the field. > >I don't need to know the mechanics of why this is happening. I just was >wondering if there were others who have experienced this (or similar) >issue and what can I do to fix it. > >Thanks in advance for you assistance. > >Should I cross post this to AccessD list? > >Stephen R. Zayko PE >SECOR International Inc >2321 Club Meridian Drive Ste E >Okemos, MI 48864 > >(517) 349-9499 ext 224 >(517) 204-5136 (c) > > > -- Marty Connelly Victoria, B.C. Canada From jlawrenc1 at shaw.ca Thu Dec 21 15:55:13 2006 From: jlawrenc1 at shaw.ca (Jim Lawrence) Date: Thu, 21 Dec 2006 13:55:13 -0800 Subject: [dba-SQLServer] Upload documents with MSAccess FE In-Reply-To: <10B9AE4E39C0DD4BB317CC8A0F0AA4010108F565@exch100a.secor.com> Message-ID: <0JAN00BF08SXYBX1@l-daemon> Hi Stephen: My recommendation is to just store a pointer to the PDF files and store these objects in their own separate directory somewhere on the server. This is much safer, less complex and faster. Just a recommendation. Jim -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Steve Zayko Sent: Thursday, December 21, 2006 12:46 PM To: dba-sqlserver at databaseadvisors.com Subject: [dba-SQLServer] Upload documents with MSAccess FE I am trying to develop a system where Adobe pdf documents are stored in a SQL server database. The method I am using to "store" the files is an MSAccess front end. I have an unbound form with an Object Frame and a few other text boxes for extraneous information. I try to place the pdf document in the object frame with the menu command Insert/Object and then run an SQL script to append the object (and other data fields) to the destination table in the SQL database. The trouble I am having is that the field in the destination table is "Image(16)". Every object I append to the table in the method described above fills the entire memory space allotted for that field. Thus a 20Kb pdf file will become a 5+ Mb object once in the field. I don't need to know the mechanics of why this is happening. I just was wondering if there were others who have experienced this (or similar) issue and what can I do to fix it. Thanks in advance for you assistance. Should I cross post this to AccessD list? Stephen R. Zayko PE SECOR International Inc 2321 Club Meridian Drive Ste E Okemos, MI 48864 (517) 349-9499 ext 224 (517) 204-5136 (c) _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From stuart at lexacorp.com.pg Thu Dec 21 16:22:46 2006 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Fri, 22 Dec 2006 08:22:46 +1000 Subject: [dba-SQLServer] Find the second occurrence of a character in a string In-Reply-To: <20061221200005.15499.qmail@web88207.mail.re2.yahoo.com> References: <20061221200005.15499.qmail@web88207.mail.re2.yahoo.com> Message-ID: <458B0936.9614.4EAD848@stuart.lexacorp.com.pg> Some genealogy software gives you options when sorting names, basically it's up to you. Common options include: "Don't sort on prefix words with less than X letters" (usually 4) and/or "ignore lower case words" On 21 Dec 2006 at 12:00, artful at rogers.com wrote: > I appreciate your point, but I'm still not certain of the best way to go > with my question, which concerns the way to handle some unusual surnames. > > van den Berq > la Flame > de la Vega > Ben Gurion > > and any number of names that begin with "al". Or "da" as in Leonardo. My > very limited Italian suggests that Leonardo was born in a town called Vinci. > > So how does one sort such a list? On the capitalized word? On the first > letter of the two or three words considered the surname? > > Advice from Europeans, Asians, Africans, or even North Americans familiar > with this problem, would be appreciated. I have no immediate problem that > requires this solution. This is purely theoretical at the moment, but who > knows, someday I may need the answer. > > TIA, > Arthur > > ----- Original Message ---- > From: Robert L. Stewart > To: dba-sqlserver at databaseadvisors.com > Sent: Thursday, December 21, 2006 1:41:04 PM > Subject: Re: [dba-SQLServer] Find the second occurrence of a character in a > string > > You put it in the right columns to begin with and don't try to > parse it out of a single one. :-) > > > > > _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com > -- Stuart From artful at rogers.com Fri Dec 22 06:27:31 2006 From: artful at rogers.com (artful at rogers.com) Date: Fri, 22 Dec 2006 04:27:31 -0800 (PST) Subject: [dba-SQLServer] This just in Message-ID: <20061222122731.71362.qmail@web88202.mail.re2.yahoo.com> Oracle Database 10g and Microsoft SQL: Which is Better? by Oracle Anyone care to bet which product is declared better? From jwcolby at colbyconsulting.com Fri Dec 22 08:24:10 2006 From: jwcolby at colbyconsulting.com (JWColby) Date: Fri, 22 Dec 2006 09:24:10 -0500 Subject: [dba-SQLServer] Find the second occurrence of a character in astring In-Reply-To: <200612211844.kBLIipq22530@databaseadvisors.com> Message-ID: <003a01c725d4$d9f3b370$1501a8c0@m6805> LOL. You apparently don't deal with the real world. I get lists of names, the entire name in one field. Now.... How helpful was your answer? John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Robert L. Stewart Sent: Thursday, December 21, 2006 1:41 PM To: dba-sqlserver at databaseadvisors.com Subject: Re: [dba-SQLServer] Find the second occurrence of a character in astring You put it in the right columns to begin with and don't try to parse it out of a single one. :-) At 12:00 PM 12/21/2006, you wrote: >Date: Wed, 20 Dec 2006 16:52:14 -0800 (PST) >From: artful at rogers.com >Subject: Re: [dba-SQLServer] Find the second occurrence of a character > in astring >To: dba-sqlserver at databaseadvisors.com >Message-ID: <20061221005214.16706.qmail at web88205.mail.re2.yahoo.com> >Content-Type: text/plain; charset=ascii > >You sidestepped the important issue, JC (well important in some >contexts), which is how does one sort this? > >A. > >----- Original Message ---- >From: JWColby >To: dba-sqlserver at databaseadvisors.com >Sent: Wednesday, December 20, 2006 4:05:08 AM >Subject: Re: [dba-SQLServer] Find the second occurrence of a character >in astring > >For Spanish names even that does not work, although I think the >difference is not worth fighting for (but I'm not Spanish). Vega is not the last name. >De La Vega is the last name. De la means "of the" as in Of The Vega. >Mi amigo in Mexico es Juan De Uriarte, Juan being the first name, De >Uriarte being the Paternal family name. > > >John W. Colby >Colby Consulting >www.ColbyConsulting.com _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Fri Dec 22 08:32:17 2006 From: jwcolby at colbyconsulting.com (JWColby) Date: Fri, 22 Dec 2006 09:32:17 -0500 Subject: [dba-SQLServer] Find the second occurrence of a character in astring In-Reply-To: <20061221200005.15499.qmail@web88207.mail.re2.yahoo.com> Message-ID: <003b01c725d5$fb9a3e80$1501a8c0@m6805> I think the "best way" to handle this if you are going to truly try to handle this problem is to: Develop a list of those "prefixes" to last names - Van, La, De etc. Take the first word as the first name Get a count of remaining words. If count > 0 then ProcessRest Else Rest is last name Endif ProcessRest Look up the second word in the prefix list. If InList then Treat everything left as the last name else Treat next word as middle name remove middle name from string Process rest as last name endif End ProcessRest Let's just say this is not s simple sql statement John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of artful at rogers.com Sent: Thursday, December 21, 2006 3:00 PM To: dba-sqlserver at databaseadvisors.com Subject: Re: [dba-SQLServer] Find the second occurrence of a character in astring I appreciate your point, but I'm still not certain of the best way to go with my question, which concerns the way to handle some unusual surnames. van den Berq la Flame de la Vega Ben Gurion and any number of names that begin with "al". Or "da" as in Leonardo. My very limited Italian suggests that Leonardo was born in a town called Vinci. So how does one sort such a list? On the capitalized word? On the first letter of the two or three words considered the surname? Advice from Europeans, Asians, Africans, or even North Americans familiar with this problem, would be appreciated. I have no immediate problem that requires this solution. This is purely theoretical at the moment, but who knows, someday I may need the answer. TIA, Arthur ----- Original Message ---- From: Robert L. Stewart To: dba-sqlserver at databaseadvisors.com Sent: Thursday, December 21, 2006 1:41:04 PM Subject: Re: [dba-SQLServer] Find the second occurrence of a character in a string You put it in the right columns to begin with and don't try to parse it out of a single one. :-) _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Fri Dec 22 09:25:42 2006 From: jwcolby at colbyconsulting.com (JWColby) Date: Fri, 22 Dec 2006 10:25:42 -0500 Subject: [dba-SQLServer] Indexing on a small number of values in a column In-Reply-To: <458236E7.27912.1462D59B@stuart.lexacorp.com.pg> Message-ID: <004601c725dd$7222ec80$1501a8c0@m6805> Arthur, This would tend to suggest that in the system you and I were discussing, placing all of the data values in one big table would be inefficient until you got the number of "From Table" data up above 20. You would have to do a full table scan on hundreds of millions of values. Using the alternate method of breaking HSID down into individual tables representing the data "groups" and only filling the tables with records where that data was present would mean you would have many different source tables, but each would have smallish numbers of records, anywhere from hundreds of thousands to low millions (5 million). Remember that many fields have essentially "binary" values such as 'True' / 'False'. Even these small tables a table scan will be required on fields like these (if they are even used in a filter) but at least you are scanning a table with a small number of records. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Stuart McLachlan Sent: Friday, December 15, 2006 12:47 AM To: dba-sqlserver at databaseadvisors.com Subject: Re: [dba-SQLServer] Indexing on a small number of values in a column On 14 Dec 2006 at 21:19, artful at rogers.com wrote: > I have heard or read that creating an index on a column containing a > small number of values is pointless. > > a) Given a column Sex with a constraint "M/F", is there any point > indexing this column? b) Given the same column defined as a bit, you > can't index it (afaik). c) Assuming that it is pointless to index a > column containng < n distinct values, what is the value of n? Assume > 100M rows in the table of interest? See: http://msdn2.microsoft.com/en-us/library/aa224773(sql.80).aspx "My tests show that a table scan often starts to perform better than a nonclustered index access when at least 10 percent of the rows are selected. I also found that the optimizer switches from nonclustered index access to table scan prematurely (i.e., when nonclustered index access still shows better response time than the corresponding table scan). In many cases, the optimizer forces a table scan for queries with result sets of approximately 5 percent, although the table scan becomes more efficient than index access at selectivities of 8 to 10 percent." also http://www.sql-server-performance.com/am_indexing_low_sel_cols.asp for some real life tests and ideas on how to measure the effectiveness of an index. -- Stuart _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From dwaters at usinternet.com Fri Dec 22 10:21:54 2006 From: dwaters at usinternet.com (Dan Waters) Date: Fri, 22 Dec 2006 10:21:54 -0600 Subject: [dba-SQLServer] This just in In-Reply-To: <12573394.1166790618640.JavaMail.root@sniper80> Message-ID: <003901c725e5$4bcdde70$0200a8c0@danwaters> I bet it's MS SQL Server. But I buy lottery tickets too! Dan Waters -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of artful at rogers.com Sent: Friday, December 22, 2006 6:28 AM To: dba-SQLServer Subject: [dba-SQLServer] This just in Oracle Database 10g and Microsoft SQL: Which is Better? by Oracle Anyone care to bet which product is declared better? _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From artful at rogers.com Fri Dec 22 11:15:05 2006 From: artful at rogers.com (artful at rogers.com) Date: Fri, 22 Dec 2006 09:15:05 -0800 (PST) Subject: [dba-SQLServer] Find the second occurrence of a character in astring Message-ID: <20061222171505.89883.qmail@web88203.mail.re2.yahoo.com> Quite right. This is not a simple SQL statement. ----- Original Message ---- From: JWColby To: dba-sqlserver at databaseadvisors.com Sent: Friday, December 22, 2006 9:32:17 AM Subject: Re: [dba-SQLServer] Find the second occurrence of a character in astring I think the "best way" to handle this if you are going to truly try to handle this problem is to: Develop a list of those "prefixes" to last names - Van, La, De etc. Take the first word as the first name Get a count of remaining words. If count > 0 then ProcessRest Else Rest is last name Endif ProcessRest Look up the second word in the prefix list. If InList then Treat everything left as the last name else Treat next word as middle name remove middle name from string Process rest as last name endif End ProcessRest Let's just say this is not s simple sql statement John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of artful at rogers.com Sent: Thursday, December 21, 2006 3:00 PM To: dba-sqlserver at databaseadvisors.com Subject: Re: [dba-SQLServer] Find the second occurrence of a character in astring I appreciate your point, but I'm still not certain of the best way to go with my question, which concerns the way to handle some unusual surnames. van den Berq la Flame de la Vega Ben Gurion and any number of names that begin with "al". Or "da" as in Leonardo. My very limited Italian suggests that Leonardo was born in a town called Vinci. So how does one sort such a list? On the capitalized word? On the first letter of the two or three words considered the surname? Advice from Europeans, Asians, Africans, or even North Americans familiar with this problem, would be appreciated. I have no immediate problem that requires this solution. This is purely theoretical at the moment, but who knows, someday I may need the answer. TIA, Arthur ----- Original Message ---- From: Robert L. Stewart To: dba-sqlserver at databaseadvisors.com Sent: Thursday, December 21, 2006 1:41:04 PM Subject: Re: [dba-SQLServer] Find the second occurrence of a character in a string You put it in the right columns to begin with and don't try to parse it out of a single one. :-) _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From szayko at secor.com Fri Dec 22 12:24:25 2006 From: szayko at secor.com (Steve Zayko) Date: Fri, 22 Dec 2006 10:24:25 -0800 Subject: [dba-SQLServer] Upload documents with MSAccess FE References: <0JAN00BF08SXYBX1@l-daemon> Message-ID: <10B9AE4E39C0DD4BB317CC8A0F0AA4010AF63E@exch100a.secor.com> That was the first option that I explored. However, there is not a common area that all users of the system have write access to. The system acts like a web-based deployment over a large "closed pipe" network. Thus storing the files in the database is used. I know it sounds inefficient. But this is how the decision makers want it to work. -Z ________________________________ From: dba-sqlserver-bounces at databaseadvisors.com on behalf of Jim Lawrence Sent: Thu 12/21/2006 01:55 PM To: dba-sqlserver at databaseadvisors.com Subject: Re: [dba-SQLServer] Upload documents with MSAccess FE Hi Stephen: My recommendation is to just store a pointer to the PDF files and store these objects in their own separate directory somewhere on the server. This is much safer, less complex and faster. Just a recommendation. Jim -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Steve Zayko Sent: Thursday, December 21, 2006 12:46 PM To: dba-sqlserver at databaseadvisors.com Subject: [dba-SQLServer] Upload documents with MSAccess FE I am trying to develop a system where Adobe pdf documents are stored in a SQL server database. The method I am using to "store" the files is an MSAccess front end. I have an unbound form with an Object Frame and a few other text boxes for extraneous information. I try to place the pdf document in the object frame with the menu command Insert/Object and then run an SQL script to append the object (and other data fields) to the destination table in the SQL database. The trouble I am having is that the field in the destination table is "Image(16)". Every object I append to the table in the method described above fills the entire memory space allotted for that field. Thus a 20Kb pdf file will become a 5+ Mb object once in the field. I don't need to know the mechanics of why this is happening. I just was wondering if there were others who have experienced this (or similar) issue and what can I do to fix it. Thanks in advance for you assistance. Should I cross post this to AccessD list? Stephen R. Zayko PE SECOR International Inc 2321 Club Meridian Drive Ste E Okemos, MI 48864 (517) 349-9499 ext 224 (517) 204-5136 (c) _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From markamatte at hotmail.com Fri Dec 22 12:55:38 2006 From: markamatte at hotmail.com (Mark A Matte) Date: Fri, 22 Dec 2006 18:55:38 +0000 Subject: [dba-SQLServer] Find the second occurrence of a character inastring Message-ID: John, I've mentioned before a friend of mine does the same thing with his software and then matches it against equifax data. Accuracy is everything in his business. I talked with him about his approach...he said it boils down to defining your rules...and then a crap load of IF statements to find which rule/rules to apply. He has been doing this(and refining the code) for more than 10 years. His advice to someone building a similar tool to the one he developed would be: "Start with as many messed up records as you can...and keep adding IF statements until you can run it once against the data and all records come out correct. About 60 million should be a good start. Then get another 60 million messed up records...run it and see what you missed the first time. ...Or hire me to clean your data.." Just thought I'd share. You seem to have quite the battle ahead of you. Best of luck...and Happy Holidays. Mark A. Matte >From: artful at rogers.com >Reply-To: dba-sqlserver at databaseadvisors.com >To: dba-sqlserver at databaseadvisors.com >Subject: Re: [dba-SQLServer] Find the second occurrence of a character >inastring >Date: Fri, 22 Dec 2006 09:15:05 -0800 (PST) > >Quite right. This is not a simple SQL statement. > >----- Original Message ---- >From: JWColby >To: dba-sqlserver at databaseadvisors.com >Sent: Friday, December 22, 2006 9:32:17 AM >Subject: Re: [dba-SQLServer] Find the second occurrence of a character in >astring > >I think the "best way" to handle this if you are going to truly try to >handle this problem is to: > >Develop a list of those "prefixes" to last names - Van, La, De etc. >Take the first word as the first name >Get a count of remaining words. >If count > 0 then > ProcessRest >Else > Rest is last name >Endif > >ProcessRest > Look up the second word in the prefix list. > If InList then > Treat everything left as the last name > else > Treat next word as middle name > remove middle name from string > Process rest as last name > endif >End ProcessRest > >Let's just say this is not s simple sql statement > >John W. Colby >Colby Consulting >www.ColbyConsulting.com > >-----Original Message----- >From: dba-sqlserver-bounces at databaseadvisors.com >[mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of >artful at rogers.com >Sent: Thursday, December 21, 2006 3:00 PM >To: dba-sqlserver at databaseadvisors.com >Subject: Re: [dba-SQLServer] Find the second occurrence of a character in >astring > >I appreciate your point, but I'm still not certain of the best way to go >with my question, which concerns the way to handle some unusual surnames. > >van den Berq >la Flame >de la Vega >Ben Gurion > >and any number of names that begin with "al". Or "da" as in Leonardo. My >very limited Italian suggests that Leonardo was born in a town called >Vinci. > >So how does one sort such a list? On the capitalized word? On the first >letter of the two or three words considered the surname? > >Advice from Europeans, Asians, Africans, or even North Americans familiar >with this problem, would be appreciated. I have no immediate problem that >requires this solution. This is purely theoretical at the moment, but who >knows, someday I may need the answer. > >TIA, >Arthur > >----- Original Message ---- >From: Robert L. Stewart >To: dba-sqlserver at databaseadvisors.com >Sent: Thursday, December 21, 2006 1:41:04 PM >Subject: Re: [dba-SQLServer] Find the second occurrence of a character in a >string > >You put it in the right columns to begin with and don't try to parse it out >of a single one. :-) > > > > >_______________________________________________ >dba-SQLServer mailing list >dba-SQLServer at databaseadvisors.com >http://databaseadvisors.com/mailman/listinfo/dba-sqlserver >http://www.databaseadvisors.com > >_______________________________________________ >dba-SQLServer mailing list >dba-SQLServer at databaseadvisors.com >http://databaseadvisors.com/mailman/listinfo/dba-sqlserver >http://www.databaseadvisors.com > > > > > >_______________________________________________ >dba-SQLServer mailing list >dba-SQLServer at databaseadvisors.com >http://databaseadvisors.com/mailman/listinfo/dba-sqlserver >http://www.databaseadvisors.com > _________________________________________________________________ Fixing up the home? Live Search can help http://imagine-windowslive.com/search/kits/default.aspx?kit=improve&locale=en-US&source=hmemailtaglinenov06&FORM=WLMTAG From martyconnelly at shaw.ca Fri Dec 22 13:04:34 2006 From: martyconnelly at shaw.ca (MartyConnelly) Date: Fri, 22 Dec 2006 11:04:34 -0800 Subject: [dba-SQLServer] Upload documents with MSAccess FE In-Reply-To: <10B9AE4E39C0DD4BB317CC8A0F0AA4010AF63E@exch100a.secor.com> References: <0JAN00BF08SXYBX1@l-daemon> <10B9AE4E39C0DD4BB317CC8A0F0AA4010AF63E@exch100a.secor.com> Message-ID: <458C2C42.4080107@shaw.ca> Would they not have write access to the same directory as the backend mdb It is required to write and create the accompanying .ldb file Steve Zayko wrote: >That was the first option that I explored. However, there is not a common area that all users of the system have write access to. The system acts like a web-based deployment over a large "closed pipe" network. Thus storing the files in the database is used. I know it sounds inefficient. But this is how the decision makers want it to work. > >-Z > >________________________________ > >From: dba-sqlserver-bounces at databaseadvisors.com on behalf of Jim Lawrence >Sent: Thu 12/21/2006 01:55 PM >To: dba-sqlserver at databaseadvisors.com >Subject: Re: [dba-SQLServer] Upload documents with MSAccess FE > > > >Hi Stephen: > >My recommendation is to just store a pointer to the PDF files and store >these objects in their own separate directory somewhere on the server. This >is much safer, less complex and faster. > >Just a recommendation. >Jim > >-----Original Message----- >From: dba-sqlserver-bounces at databaseadvisors.com >[mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Steve Zayko >Sent: Thursday, December 21, 2006 12:46 PM >To: dba-sqlserver at databaseadvisors.com >Subject: [dba-SQLServer] Upload documents with MSAccess FE > >I am trying to develop a system where Adobe pdf documents are stored in >a SQL server database. The method I am using to "store" the files is an >MSAccess front end. I have an unbound form with an Object Frame and a >few other text boxes for extraneous information. I try to place the pdf >document in the object frame with the menu command Insert/Object and >then run an SQL script to append the object (and other data fields) to >the destination table in the SQL database. > >The trouble I am having is that the field in the destination table is >"Image(16)". Every object I append to the table in the method described >above fills the entire memory space allotted for that field. Thus a >20Kb pdf file will become a 5+ Mb object once in the field. > >I don't need to know the mechanics of why this is happening. I just was >wondering if there were others who have experienced this (or similar) >issue and what can I do to fix it. > >Thanks in advance for you assistance. > >Should I cross post this to AccessD list? > >Stephen R. Zayko PE >SECOR International Inc >2321 Club Meridian Drive Ste E >Okemos, MI 48864 > >(517) 349-9499 ext 224 >(517) 204-5136 (c) > > > > -- Marty Connelly Victoria, B.C. Canada From jwcolby at colbyconsulting.com Fri Dec 22 13:24:09 2006 From: jwcolby at colbyconsulting.com (JWColby) Date: Fri, 22 Dec 2006 14:24:09 -0500 Subject: [dba-SQLServer] Find the second occurrence of a characterinastring In-Reply-To: Message-ID: <008301c725fe$c18f1890$1501a8c0@m6805> LOL, no I am not attempting to do this, I hire Accuzip to do this. I am in the process of running 60 million records through them to see how they fare. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Mark A Matte Sent: Friday, December 22, 2006 1:56 PM To: dba-sqlserver at databaseadvisors.com Subject: Re: [dba-SQLServer] Find the second occurrence of a characterinastring John, I've mentioned before a friend of mine does the same thing with his software and then matches it against equifax data. Accuracy is everything in his business. I talked with him about his approach...he said it boils down to defining your rules...and then a crap load of IF statements to find which rule/rules to apply. He has been doing this(and refining the code) for more than 10 years. His advice to someone building a similar tool to the one he developed would be: "Start with as many messed up records as you can...and keep adding IF statements until you can run it once against the data and all records come out correct. About 60 million should be a good start. Then get another 60 million messed up records...run it and see what you missed the first time. ...Or hire me to clean your data.." Just thought I'd share. You seem to have quite the battle ahead of you. Best of luck...and Happy Holidays. Mark A. Matte >From: artful at rogers.com >Reply-To: dba-sqlserver at databaseadvisors.com >To: dba-sqlserver at databaseadvisors.com >Subject: Re: [dba-SQLServer] Find the second occurrence of a character >inastring >Date: Fri, 22 Dec 2006 09:15:05 -0800 (PST) > >Quite right. This is not a simple SQL statement. > >----- Original Message ---- >From: JWColby >To: dba-sqlserver at databaseadvisors.com >Sent: Friday, December 22, 2006 9:32:17 AM >Subject: Re: [dba-SQLServer] Find the second occurrence of a character >in astring > >I think the "best way" to handle this if you are going to truly try to >handle this problem is to: > >Develop a list of those "prefixes" to last names - Van, La, De etc. >Take the first word as the first name >Get a count of remaining words. >If count > 0 then > ProcessRest >Else > Rest is last name >Endif > >ProcessRest > Look up the second word in the prefix list. > If InList then > Treat everything left as the last name > else > Treat next word as middle name > remove middle name from string > Process rest as last name > endif >End ProcessRest > >Let's just say this is not s simple sql statement > >John W. Colby >Colby Consulting >www.ColbyConsulting.com > >-----Original Message----- >From: dba-sqlserver-bounces at databaseadvisors.com >[mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of >artful at rogers.com >Sent: Thursday, December 21, 2006 3:00 PM >To: dba-sqlserver at databaseadvisors.com >Subject: Re: [dba-SQLServer] Find the second occurrence of a character >in astring > >I appreciate your point, but I'm still not certain of the best way to >go with my question, which concerns the way to handle some unusual surnames. > >van den Berq >la Flame >de la Vega >Ben Gurion > >and any number of names that begin with "al". Or "da" as in Leonardo. >My very limited Italian suggests that Leonardo was born in a town >called Vinci. > >So how does one sort such a list? On the capitalized word? On the first >letter of the two or three words considered the surname? > >Advice from Europeans, Asians, Africans, or even North Americans >familiar with this problem, would be appreciated. I have no immediate >problem that requires this solution. This is purely theoretical at the >moment, but who knows, someday I may need the answer. > >TIA, >Arthur > >----- Original Message ---- >From: Robert L. Stewart >To: dba-sqlserver at databaseadvisors.com >Sent: Thursday, December 21, 2006 1:41:04 PM >Subject: Re: [dba-SQLServer] Find the second occurrence of a character >in a string > >You put it in the right columns to begin with and don't try to parse it >out of a single one. :-) > > > > >_______________________________________________ >dba-SQLServer mailing list >dba-SQLServer at databaseadvisors.com >http://databaseadvisors.com/mailman/listinfo/dba-sqlserver >http://www.databaseadvisors.com > >_______________________________________________ >dba-SQLServer mailing list >dba-SQLServer at databaseadvisors.com >http://databaseadvisors.com/mailman/listinfo/dba-sqlserver >http://www.databaseadvisors.com > > > > > >_______________________________________________ >dba-SQLServer mailing list >dba-SQLServer at databaseadvisors.com >http://databaseadvisors.com/mailman/listinfo/dba-sqlserver >http://www.databaseadvisors.com > _________________________________________________________________ Fixing up the home? Live Search can help http://imagine-windowslive.com/search/kits/default.aspx?kit=improve&locale=e n-US&source=hmemailtaglinenov06&FORM=WLMTAG _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From mikedorism at verizon.net Fri Dec 22 13:50:45 2006 From: mikedorism at verizon.net (Doris Manning) Date: Fri, 22 Dec 2006 14:50:45 -0500 Subject: [dba-SQLServer] Import Excel file content to SQL Server using ASP.Net Message-ID: <002e01c72602$79556c60$2f01a8c0@Kermit> Help! The "powers that be" want to upload an Excel file (that could be named anything) via a webpage, open it, retrieve the information (that could be on one or more sheets), and transfer it to SQL Server. I know how to do this in a Windows Form but have no clue how to do it in a Web Form. Any ideas? Doris Manning Database Administrator Hargrove Inc. From rlavsa at tigg.com Fri Dec 22 14:21:51 2006 From: rlavsa at tigg.com (Richard Lavsa) Date: Fri, 22 Dec 2006 15:21:51 -0500 Subject: [dba-SQLServer] Linked Oracle Server In-Reply-To: <59A61174B1F5B54B97FD4ADDE71E7D0116AE85@ddi-01.DDI.local> Message-ID: I did set this up, but cannot refer to how I did it as it was at my previous place of employment. However the problem I had was with using the Oracle provider vs the MS provider. Grant it you need to have both, but the MS Oracle provider is a wrapper for the Oracle provider is how I understand it. I can't remember the error I received when trying to use the Native Oracle client but it simply wouldn't work. Please try to use the MS Oracle provider. It should work just fine.. Rich -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Michael Maddison Sent: Tuesday, December 19, 2006 10:21 PM To: dba-sqlserver at databaseadvisors.com Subject: [dba-SQLServer] Linked Oracle Server While I'm thinking of it, anyone set up a linked Oracle server in 2K? What should the provider string look like? None of the examples I've found seem to work for me. cheers Michael Maddison DDI Solutions Pty Ltd michael at ddisolutions.com.au Bus: 0260400620 Mob: 0412620497 www.ddisolutions.com.au _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com CONFIDENTIALITY NOTICE: The information contained in this transmission may be confidential or privileged, and is intended solely for the entity or individual to whom it is addressed. If you are not the intended recipient, please be advised that any use, copying, disclosure, dissemination or distribution is strictly prohibited. If you received this transmission in error, please contact the sender at TIGG Corporation immediately by replying to this email and deleting it from your computer. From jlawrenc1 at shaw.ca Fri Dec 22 16:12:12 2006 From: jlawrenc1 at shaw.ca (Jim Lawrence) Date: Fri, 22 Dec 2006 14:12:12 -0800 Subject: [dba-SQLServer] Find the second occurrence of a character inastring In-Reply-To: Message-ID: <0JAP00GAF4946Z22@l-daemon> Just a note... it seems to always take 50% of a contract's time to clean up the data, it is the most difficult assignment to get the client to fund and yet it the most crucial task to perform. Just a comment Jim -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Mark A Matte Sent: Friday, December 22, 2006 10:56 AM To: dba-sqlserver at databaseadvisors.com Subject: Re: [dba-SQLServer] Find the second occurrence of a character inastring John, I've mentioned before a friend of mine does the same thing with his software and then matches it against equifax data. Accuracy is everything in his business. I talked with him about his approach...he said it boils down to defining your rules...and then a crap load of IF statements to find which rule/rules to apply. He has been doing this(and refining the code) for more than 10 years. His advice to someone building a similar tool to the one he developed would be: "Start with as many messed up records as you can...and keep adding IF statements until you can run it once against the data and all records come out correct. About 60 million should be a good start. Then get another 60 million messed up records...run it and see what you missed the first time. ...Or hire me to clean your data.." Just thought I'd share. You seem to have quite the battle ahead of you. Best of luck...and Happy Holidays. Mark A. Matte >From: artful at rogers.com >Reply-To: dba-sqlserver at databaseadvisors.com >To: dba-sqlserver at databaseadvisors.com >Subject: Re: [dba-SQLServer] Find the second occurrence of a character >inastring >Date: Fri, 22 Dec 2006 09:15:05 -0800 (PST) > >Quite right. This is not a simple SQL statement. > >----- Original Message ---- >From: JWColby >To: dba-sqlserver at databaseadvisors.com >Sent: Friday, December 22, 2006 9:32:17 AM >Subject: Re: [dba-SQLServer] Find the second occurrence of a character in >astring > >I think the "best way" to handle this if you are going to truly try to >handle this problem is to: > >Develop a list of those "prefixes" to last names - Van, La, De etc. >Take the first word as the first name >Get a count of remaining words. >If count > 0 then > ProcessRest >Else > Rest is last name >Endif > >ProcessRest > Look up the second word in the prefix list. > If InList then > Treat everything left as the last name > else > Treat next word as middle name > remove middle name from string > Process rest as last name > endif >End ProcessRest > >Let's just say this is not s simple sql statement > >John W. Colby >Colby Consulting >www.ColbyConsulting.com > >-----Original Message----- >From: dba-sqlserver-bounces at databaseadvisors.com >[mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of >artful at rogers.com >Sent: Thursday, December 21, 2006 3:00 PM >To: dba-sqlserver at databaseadvisors.com >Subject: Re: [dba-SQLServer] Find the second occurrence of a character in >astring > >I appreciate your point, but I'm still not certain of the best way to go >with my question, which concerns the way to handle some unusual surnames. > >van den Berq >la Flame >de la Vega >Ben Gurion > >and any number of names that begin with "al". Or "da" as in Leonardo. My >very limited Italian suggests that Leonardo was born in a town called >Vinci. > >So how does one sort such a list? On the capitalized word? On the first >letter of the two or three words considered the surname? > >Advice from Europeans, Asians, Africans, or even North Americans familiar >with this problem, would be appreciated. I have no immediate problem that >requires this solution. This is purely theoretical at the moment, but who >knows, someday I may need the answer. > >TIA, >Arthur > >----- Original Message ---- >From: Robert L. Stewart >To: dba-sqlserver at databaseadvisors.com >Sent: Thursday, December 21, 2006 1:41:04 PM >Subject: Re: [dba-SQLServer] Find the second occurrence of a character in a >string > >You put it in the right columns to begin with and don't try to parse it out >of a single one. :-) > > > > >_______________________________________________ >dba-SQLServer mailing list >dba-SQLServer at databaseadvisors.com >http://databaseadvisors.com/mailman/listinfo/dba-sqlserver >http://www.databaseadvisors.com > >_______________________________________________ >dba-SQLServer mailing list >dba-SQLServer at databaseadvisors.com >http://databaseadvisors.com/mailman/listinfo/dba-sqlserver >http://www.databaseadvisors.com > > > > > >_______________________________________________ >dba-SQLServer mailing list >dba-SQLServer at databaseadvisors.com >http://databaseadvisors.com/mailman/listinfo/dba-sqlserver >http://www.databaseadvisors.com > _________________________________________________________________ Fixing up the home? Live Search can help http://imagine-windowslive.com/search/kits/default.aspx?kit=improve&locale=e n-US&source=hmemailtaglinenov06&FORM=WLMTAG _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From artful at rogers.com Sun Dec 24 18:19:12 2006 From: artful at rogers.com (artful at rogers.com) Date: Sun, 24 Dec 2006 16:19:12 -0800 (PST) Subject: [dba-SQLServer] Find the second occurrence of a character in astring Message-ID: <20061225001912.71788.qmail@web88213.mail.re2.yahoo.com> LOL. Reality does have a way of intruding! But sometimes I invite it, and am declined. Allegedly there is a list of first and last names that can be downloaded from the US Census Bureau, but I can't find it. Can anyone with site-navigation skills better than mine locate said list? I need it for an experiment (benchmarking). TIA and Merry Christmas, Arthur ----- Original Message ---- From: JWColby To: dba-sqlserver at databaseadvisors.com Sent: Friday, December 22, 2006 9:24:10 AM Subject: Re: [dba-SQLServer] Find the second occurrence of a character in astring LOL. You apparently don't deal with the real world. I get lists of names, the entire name in one field. Now.... How helpful was your answer? From fkkendrick at cox.net Sun Dec 24 23:41:08 2006 From: fkkendrick at cox.net (F Kay Kendrick) Date: Sun, 24 Dec 2006 23:41:08 -0600 Subject: [dba-SQLServer] Find the second occurrence of a character inastring In-Reply-To: <20061225001912.71788.qmail@web88213.mail.re2.yahoo.com> Message-ID: <000001c727e7$47498e40$040aa8c0@dragon> >From the 1990 census: http://www.census.gov/genealogy/www/freqnames.html F Kay Kendrick -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of artful at rogers.com Sent: Sunday, December 24, 2006 6:19 PM To: dba-sqlserver at databaseadvisors.com Subject: Re: [dba-SQLServer] Find the second occurrence of a character inastring LOL. Reality does have a way of intruding! But sometimes I invite it, and am declined. Allegedly there is a list of first and last names that can be downloaded from the US Census Bureau, but I can't find it. Can anyone with site-navigation skills better than mine locate said list? I need it for an experiment (benchmarking). TIA and Merry Christmas, Arthur ----- Original Message ---- From: JWColby To: dba-sqlserver at databaseadvisors.com Sent: Friday, December 22, 2006 9:24:10 AM Subject: Re: [dba-SQLServer] Find the second occurrence of a character in astring LOL. You apparently don't deal with the real world. I get lists of names, the entire name in one field. Now.... How helpful was your answer? _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From rl_stewart at highstream.net Tue Dec 26 08:47:16 2006 From: rl_stewart at highstream.net (Robert L. Stewart) Date: Tue, 26 Dec 2006 08:47:16 -0600 Subject: [dba-SQLServer] Find the second occurrence of a character In-Reply-To: References: Message-ID: <200612261447.kBQElvq12462@databaseadvisors.com> You are just going to have to build a reference table as you go and validate that the name does or does not exist in the surname reference table. If it does, parse it out to the surname column. Then parse the balance of the name. You will still have to deal with oddities like my oldest son. Robert Christopher Lawrence Stewart. But, at least only the single surname. There are probably genealogy databases that have been built that can get you most of the way on the surname database. Most likely the Mormons have the largest. John, I know it was not very helpful, hence the smile. But, I doubt very much that the source database that supplies your data is a single field. So, getting the data in the proper format is not impossible. Difficult, maybe. Robert At 12:00 PM 12/22/2006, you wrote: >Date: Fri, 22 Dec 2006 09:32:17 -0500 >From: "JWColby" >Subject: Re: [dba-SQLServer] Find the second occurrence of a character > in astring >To: >Message-ID: <003b01c725d5$fb9a3e80$1501a8c0 at m6805> >Content-Type: text/plain; charset="us-ascii" > >I think the "best way" to handle this if you are going to truly try to >handle this problem is to: > >Develop a list of those "prefixes" to last names - Van, La, De etc. >Take the first word as the first name >Get a count of remaining words. >If count > 0 then > ProcessRest >Else > Rest is last name >Endif > >ProcessRest > Look up the second word in the prefix list. > If InList then > Treat everything left as the last name > else > Treat next word as middle name > remove middle name from string > Process rest as last name > endif >End ProcessRest > >Let's just say this is not s simple sql statement > >John W. Colby >Colby Consulting >www.ColbyConsulting.com > >-----Original Message----- >From: dba-sqlserver-bounces at databaseadvisors.com >[mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of >artful at rogers.com >Sent: Thursday, December 21, 2006 3:00 PM >To: dba-sqlserver at databaseadvisors.com >Subject: Re: [dba-SQLServer] Find the second occurrence of a character in >astring > >I appreciate your point, but I'm still not certain of the best way to go >with my question, which concerns the way to handle some unusual surnames. > >van den Berq >la Flame >de la Vega >Ben Gurion > >and any number of names that begin with "al". Or "da" as in Leonardo. My >very limited Italian suggests that Leonardo was born in a town called Vinci. > >So how does one sort such a list? On the capitalized word? On the first >letter of the two or three words considered the surname? > >Advice from Europeans, Asians, Africans, or even North Americans familiar >with this problem, would be appreciated. I have no immediate problem that >requires this solution. This is purely theoretical at the moment, but who >knows, someday I may need the answer. > >TIA, >Arthur > >----- Original Message ---- >From: Robert L. Stewart >To: dba-sqlserver at databaseadvisors.com >Sent: Thursday, December 21, 2006 1:41:04 PM >Subject: Re: [dba-SQLServer] Find the second occurrence of a character in a >string > >You put it in the right columns to begin with and don't try to parse it out >of a single one. :-) > From michael at ddisolutions.com.au Tue Dec 26 21:19:05 2006 From: michael at ddisolutions.com.au (Michael Maddison) Date: Wed, 27 Dec 2006 14:19:05 +1100 Subject: [dba-SQLServer] Linked Oracle Server Message-ID: <59A61174B1F5B54B97FD4ADDE71E7D0116AE93@ddi-01.DDI.local> Thanks for the reply, After screwing around for a day I handballed it to the clients IT dept, after 2 days they got it working... cheers Michael M I did set this up, but cannot refer to how I did it as it was at my previous place of employment. However the problem I had was with using the Oracle provider vs the MS provider. Grant it you need to have both, but the MS Oracle provider is a wrapper for the Oracle provider is how I understand it. I can't remember the error I received when trying to use the Native Oracle client but it simply wouldn't work. Please try to use the MS Oracle provider. It should work just fine.. Rich -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Michael Maddison Sent: Tuesday, December 19, 2006 10:21 PM To: dba-sqlserver at databaseadvisors.com Subject: [dba-SQLServer] Linked Oracle Server While I'm thinking of it, anyone set up a linked Oracle server in 2K? What should the provider string look like? None of the examples I've found seem to work for me. cheers Michael Maddison DDI Solutions Pty Ltd michael at ddisolutions.com.au Bus: 0260400620 Mob: 0412620497 www.ddisolutions.com.au _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com CONFIDENTIALITY NOTICE: The information contained in this transmission may be confidential or privileged, and is intended solely for the entity or individual to whom it is addressed. If you are not the intended recipient, please be advised that any use, copying, disclosure, dissemination or distribution is strictly prohibited. If you received this transmission in error, please contact the sender at TIGG Corporation immediately by replying to this email and deleting it from your computer. _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From rl_stewart at highstream.net Wed Dec 27 09:17:10 2006 From: rl_stewart at highstream.net (Robert L. Stewart) Date: Wed, 27 Dec 2006 09:17:10 -0600 Subject: [dba-SQLServer] Upload documents with MSAccess FE In-Reply-To: References: Message-ID: <200612271521.kBRFLeR11398@databaseadvisors.com> The reason this is occurring is that Access also stores the program that opens the file. You need to use a VB/c# program to store the file instead of Access. then you will get only the file stored as a binary. The overhead with Access is why everyone says not to store the file inside of the database. But, it is limited to an Access thing. Using a different program to load the file will keep the bloat from happening. Robert At 04:11 PM 12/22/2006, you wrote: >Date: Fri, 22 Dec 2006 10:24:25 -0800 >From: "Steve Zayko" >Subject: Re: [dba-SQLServer] Upload documents with MSAccess FE >To: >Message-ID: > <10B9AE4E39C0DD4BB317CC8A0F0AA4010AF63E at exch100a.secor.com> >Content-Type: text/plain; charset="iso-8859-1" > >That was the first option that I explored. However, there is not a >common area that all users of the system have write access to. The >system acts like a web-based deployment over a large "closed pipe" >network. Thus storing the files in the database is used. I know it >sounds inefficient. But this is how the decision makers want it to work. > >-Z From martyconnelly at shaw.ca Fri Dec 29 13:34:40 2006 From: martyconnelly at shaw.ca (MartyConnelly) Date: Fri, 29 Dec 2006 11:34:40 -0800 Subject: [dba-SQLServer] Find the second occurrence of a character In-Reply-To: <200612261447.kBQElvq12462@databaseadvisors.com> References: <200612261447.kBQElvq12462@databaseadvisors.com> Message-ID: <45956DD0.5030105@shaw.ca> Just came across this in an IBM software review released in July 2006 used by security global watch lists. Global Name Recognition http://www-306.ibm.com/software/data/globalname/ IBM Global Name Recognition Technologies IBM's patented name recognition technology is exactly type of problem. Some of the highlights include the ability . Identify name by culture and relative frequency . Search for multi-cultural names in a database . Parse a name into Surname and Given Name . Generate frequency statistics for name tokens . Generate all variants of a name . Generate additional attributes such as gender . Quickly train field personnel in advanced multicultural searching techniques . Utilize rich name data gained from the comprehensive over 1 billion names from around the world Platforms Supported IBM Global Name Recognition technologies are available across Win32, Unix, and Linux platforms. Interfaces are available in C++, JNI, SOAP, and XML-over-IP for most products. (Please check specific availability) Ahhh here is the cough IBM Global Name Analytics Server License + SW Maintenance 12 Months (D58MBLL) $645,885.00 CAD Robert L. Stewart wrote: >You are just going to have to build a reference table as you go and >validate that the name does or does not exist in the surname >reference table. If it does, parse it out to the surname >column. Then parse the balance of the name. You will still have to >deal with oddities like my oldest son. Robert Christopher Lawrence >Stewart. But, at least only the single surname. > >There are probably genealogy databases that have been built that can >get you most of the way on the surname database. Most likely the >Mormons have the largest. > >John, I know it was not very helpful, hence the smile. But, I doubt >very much that the source database that supplies your data is a >single field. So, getting the data in the proper format is not >impossible. Difficult, maybe. > > >Robert > >At 12:00 PM 12/22/2006, you wrote: > > >>Date: Fri, 22 Dec 2006 09:32:17 -0500 >>From: "JWColby" >>Subject: Re: [dba-SQLServer] Find the second occurrence of a character >> in astring >>To: >>Message-ID: <003b01c725d5$fb9a3e80$1501a8c0 at m6805> >>Content-Type: text/plain; charset="us-ascii" >> >>I think the "best way" to handle this if you are going to truly try to >>handle this problem is to: >> >>Develop a list of those "prefixes" to last names - Van, La, De etc. >>Take the first word as the first name >>Get a count of remaining words. >>If count > 0 then >> ProcessRest >>Else >> Rest is last name >>Endif >> >>ProcessRest >> Look up the second word in the prefix list. >> If InList then >> Treat everything left as the last name >> else >> Treat next word as middle name >> remove middle name from string >> Process rest as last name >> endif >>End ProcessRest >> >>Let's just say this is not s simple sql statement >> >>John W. Colby >>Colby Consulting >>www.ColbyConsulting.com >> >>-----Original Message----- >>From: dba-sqlserver-bounces at databaseadvisors.com >>[mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of >>artful at rogers.com >>Sent: Thursday, December 21, 2006 3:00 PM >>To: dba-sqlserver at databaseadvisors.com >>Subject: Re: [dba-SQLServer] Find the second occurrence of a character in >>astring >> >>I appreciate your point, but I'm still not certain of the best way to go >>with my question, which concerns the way to handle some unusual surnames. >> >>van den Berq >>la Flame >>de la Vega >>Ben Gurion >> >>and any number of names that begin with "al". Or "da" as in Leonardo. My >>very limited Italian suggests that Leonardo was born in a town called Vinci. >> >>So how does one sort such a list? On the capitalized word? On the first >>letter of the two or three words considered the surname? >> >>Advice from Europeans, Asians, Africans, or even North Americans familiar >>with this problem, would be appreciated. I have no immediate problem that >>requires this solution. This is purely theoretical at the moment, but who >>knows, someday I may need the answer. >> >>TIA, >>Arthur >> >>----- Original Message ---- >>From: Robert L. Stewart >>To: dba-sqlserver at databaseadvisors.com >>Sent: Thursday, December 21, 2006 1:41:04 PM >>Subject: Re: [dba-SQLServer] Find the second occurrence of a character in a >>string >> >>You put it in the right columns to begin with and don't try to parse it out >>of a single one. :-) >> >> >> > > > -- Marty Connelly Victoria, B.C. Canada From jwcolby at colbyconsulting.com Fri Dec 29 14:25:46 2006 From: jwcolby at colbyconsulting.com (JWColby) Date: Fri, 29 Dec 2006 15:25:46 -0500 Subject: [dba-SQLServer] Find the second occurrence of a character In-Reply-To: <45956DD0.5030105@shaw.ca> Message-ID: <00a601c72b87$8678ee00$ccfbc34b@m6805> >IBM Global Name Analytics Server License + SW Maintenance 12 Months (D58MBLL) $645,885.00 CAD LOL. I'll take two, with large fries and a milkshake. Just put that on William's account. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of MartyConnelly Sent: Friday, December 29, 2006 2:35 PM To: dba-sqlserver at databaseadvisors.com Subject: Re: [dba-SQLServer] Find the second occurrence of a character Just came across this in an IBM software review released in July 2006 used by security global watch lists. Global Name Recognition http://www-306.ibm.com/software/data/globalname/ IBM Global Name Recognition Technologies IBM's patented name recognition technology is exactly type of problem. Some of the highlights include the ability . Identify name by culture and relative frequency . Search for multi-cultural names in a database . Parse a name into Surname and Given Name . Generate frequency statistics for name tokens . Generate all variants of a name . Generate additional attributes such as gender . Quickly train field personnel in advanced multicultural searching techniques . Utilize rich name data gained from the comprehensive over 1 billion names from around the world Platforms Supported IBM Global Name Recognition technologies are available across Win32, Unix, and Linux platforms. Interfaces are available in C++, JNI, SOAP, and XML-over-IP for most products. (Please check specific availability) Ahhh here is the cough IBM Global Name Analytics Server License + SW Maintenance 12 Months (D58MBLL) $645,885.00 CAD Robert L. Stewart wrote: >You are just going to have to build a reference table as you go and >validate that the name does or does not exist in the surname reference >table. If it does, parse it out to the surname column. Then parse the >balance of the name. You will still have to deal with oddities like my >oldest son. Robert Christopher Lawrence Stewart. But, at least only >the single surname. > >There are probably genealogy databases that have been built that can >get you most of the way on the surname database. Most likely the >Mormons have the largest. > >John, I know it was not very helpful, hence the smile. But, I doubt >very much that the source database that supplies your data is a single >field. So, getting the data in the proper format is not impossible. >Difficult, maybe. > > >Robert > >At 12:00 PM 12/22/2006, you wrote: > > >>Date: Fri, 22 Dec 2006 09:32:17 -0500 >>From: "JWColby" >>Subject: Re: [dba-SQLServer] Find the second occurrence of a character >> in astring >>To: >>Message-ID: <003b01c725d5$fb9a3e80$1501a8c0 at m6805> >>Content-Type: text/plain; charset="us-ascii" >> >>I think the "best way" to handle this if you are going to truly try to >>handle this problem is to: >> >>Develop a list of those "prefixes" to last names - Van, La, De etc. >>Take the first word as the first name >>Get a count of remaining words. >>If count > 0 then >> ProcessRest >>Else >> Rest is last name >>Endif >> >>ProcessRest >> Look up the second word in the prefix list. >> If InList then >> Treat everything left as the last name >> else >> Treat next word as middle name >> remove middle name from string >> Process rest as last name >> endif >>End ProcessRest >> >>Let's just say this is not s simple sql statement >> >>John W. Colby >>Colby Consulting >>www.ColbyConsulting.com >> >>-----Original Message----- >>From: dba-sqlserver-bounces at databaseadvisors.com >>[mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of >>artful at rogers.com >>Sent: Thursday, December 21, 2006 3:00 PM >>To: dba-sqlserver at databaseadvisors.com >>Subject: Re: [dba-SQLServer] Find the second occurrence of a character >>in astring >> >>I appreciate your point, but I'm still not certain of the best way to >>go with my question, which concerns the way to handle some unusual surnames. >> >>van den Berq >>la Flame >>de la Vega >>Ben Gurion >> >>and any number of names that begin with "al". Or "da" as in Leonardo. >>My very limited Italian suggests that Leonardo was born in a town called Vinci. >> >>So how does one sort such a list? On the capitalized word? On the >>first letter of the two or three words considered the surname? >> >>Advice from Europeans, Asians, Africans, or even North Americans >>familiar with this problem, would be appreciated. I have no immediate >>problem that requires this solution. This is purely theoretical at the >>moment, but who knows, someday I may need the answer. >> >>TIA, >>Arthur >> >>----- Original Message ---- >>From: Robert L. Stewart >>To: dba-sqlserver at databaseadvisors.com >>Sent: Thursday, December 21, 2006 1:41:04 PM >>Subject: Re: [dba-SQLServer] Find the second occurrence of a character >>in a string >> >>You put it in the right columns to begin with and don't try to parse >>it out of a single one. :-) >> >> >> > > > -- Marty Connelly Victoria, B.C. Canada _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From artful at rogers.com Fri Dec 29 15:37:06 2006 From: artful at rogers.com (artful at rogers.com) Date: Fri, 29 Dec 2006 13:37:06 -0800 (PST) Subject: [dba-SQLServer] Find the second occurrence of a character Message-ID: <20061229213706.94865.qmail@web88212.mail.re2.yahoo.com> Only $645K? I'll take two, oh and one for my wife. ----- Original Message ---- From: MartyConnelly To: dba-sqlserver at databaseadvisors.com Sent: Friday, December 29, 2006 2:34:40 PM Subject: Re: [dba-SQLServer] Find the second occurrence of a character Just came across this in an IBM software review released in July 2006 used by security global watch lists. Global Name Recognition http://www-306.ibm.com/software/data/globalname/ IBM Global Name Recognition Technologies IBM's patented name recognition technology is exactly type of problem. Some of the highlights include the ability . Identify name by culture and relative frequency . Search for multi-cultural names in a database . Parse a name into Surname and Given Name . Generate frequency statistics for name tokens . Generate all variants of a name . Generate additional attributes such as gender . Quickly train field personnel in advanced multicultural searching techniques . Utilize rich name data gained from the comprehensive over 1 billion names from around the world Platforms Supported IBM Global Name Recognition technologies are available across Win32, Unix, and Linux platforms. Interfaces are available in C++, JNI, SOAP, and XML-over-IP for most products. (Please check specific availability) Ahhh here is the cough IBM Global Name Analytics Server License + SW Maintenance 12 Months (D58MBLL) $645,885.00 CAD Robert L. Stewart wrote: >You are just going to have to build a reference table as you go and >validate that the name does or does not exist in the surname >reference table. If it does, parse it out to the surname >column. Then parse the balance of the name. You will still have to >deal with oddities like my oldest son. Robert Christopher Lawrence >Stewart. But, at least only the single surname. > >There are probably genealogy databases that have been built that can >get you most of the way on the surname database. Most likely the >Mormons have the largest. > >John, I know it was not very helpful, hence the smile. But, I doubt >very much that the source database that supplies your data is a >single field. So, getting the data in the proper format is not >impossible. Difficult, maybe. > > >Robert > >At 12:00 PM 12/22/2006, you wrote: > > >>Date: Fri, 22 Dec 2006 09:32:17 -0500 >>From: "JWColby" >>Subject: Re: [dba-SQLServer] Find the second occurrence of a character >> in astring >>To: >>Message-ID: <003b01c725d5$fb9a3e80$1501a8c0 at m6805> >>Content-Type: text/plain; charset="us-ascii" >> >>I think the "best way" to handle this if you are going to truly try to >>handle this problem is to: >> >>Develop a list of those "prefixes" to last names - Van, La, De etc. >>Take the first word as the first name >>Get a count of remaining words. >>If count > 0 then >> ProcessRest >>Else >> Rest is last name >>Endif >> >>ProcessRest >> Look up the second word in the prefix list. >> If InList then >> Treat everything left as the last name >> else >> Treat next word as middle name >> remove middle name from string >> Process rest as last name >> endif >>End ProcessRest >> >>Let's just say this is not s simple sql statement >> >>John W. Colby >>Colby Consulting >>www.ColbyConsulting.com >> >>-----Original Message----- >>From: dba-sqlserver-bounces at databaseadvisors.com >>[mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of >>artful at rogers.com >>Sent: Thursday, December 21, 2006 3:00 PM >>To: dba-sqlserver at databaseadvisors.com >>Subject: Re: [dba-SQLServer] Find the second occurrence of a character in >>astring >> >>I appreciate your point, but I'm still not certain of the best way to go >>with my question, which concerns the way to handle some unusual surnames. >> >>van den Berq >>la Flame >>de la Vega >>Ben Gurion >> >>and any number of names that begin with "al". Or "da" as in Leonardo. My >>very limited Italian suggests that Leonardo was born in a town called Vinci. >> >>So how does one sort such a list? On the capitalized word? On the first >>letter of the two or three words considered the surname? >> >>Advice from Europeans, Asians, Africans, or even North Americans familiar >>with this problem, would be appreciated. I have no immediate problem that >>requires this solution. This is purely theoretical at the moment, but who >>knows, someday I may need the answer. >> >>TIA, >>Arthur >> >>----- Original Message ---- >>From: Robert L. Stewart >>To: dba-sqlserver at databaseadvisors.com >>Sent: Thursday, December 21, 2006 1:41:04 PM >>Subject: Re: [dba-SQLServer] Find the second occurrence of a character in a >>string >> >>You put it in the right columns to begin with and don't try to parse it out >>of a single one. :-) >> >> >> > > > -- Marty Connelly Victoria, B.C. Canada _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com