From jnatola at hotmail.com Fri Apr 8 20:26:49 2016 From: jnatola at hotmail.com (J- P) Date: Fri, 8 Apr 2016 21:26:49 -0400 Subject: [dba-SQLServer] DB growth spurt/Comparison tool Message-ID: Hi all, Warning , this is a longer than usual , bit elaborate thread. Environment; sql express 2005 database (2000 compatibility mode) on 2003 server; Access front end; ~40 users; DB size 1.6 GB Scenario; Front end starts hanging on certain menus (spinning wheel of death the users call it) Sometimes it comes back on its own , sometimes they restart the sql service (with my limited knowledge i ran profiler and have found every time it freezes/crashes the trace shows "sort warnings with event subclass 1 pass) I know add more memory is the band-aid , however , express is limited to 1GB and I believe it's a problem pertaining to queries ) Now I have been telling the owner for years he needs to to get current, get a real DBA and clean things up (another story completely ) Today the "DBM (database maintainer I call him, because he is by NO MEANS a DBA) did something trying to "fix the issue" and the database became pretty much unusable- sort warning up the wazoo. I looked at the backups and the database went from 1.6GB to 1.8GB from one hour to the next today. I have taken the DB and restored it to to a 2008r2 Standard DB w 8GB ram , just so they can work come Monday. What I would really like to know is what changed from one hour to the next inside the database to make it grow by 200 MB in an hour, and if there is a tool /utility that can compare the before and after DB files. thanks From fhtapia at gmail.com Mon Apr 11 15:30:27 2016 From: fhtapia at gmail.com (fhtapia at gmail.com) Date: Mon, 11 Apr 2016 20:30:27 +0000 Subject: [dba-SQLServer] DB growth spurt/Comparison tool In-Reply-To: References: Message-ID: so if you are backing up with a transaction log, you can save the backup and the log, then recover to a new database, and compare the old an new database using either RedGate's Schema's compare or their DataCompare tool, they give you a 14 day trial so you can look around and validate what changed. read the section under: Errors and Warnings for this article: https://www.simple-talk.com/sql/performance/the-default-trace-in-sql-server---the-power-of-performance-and-security-auditing/ i get that you are running out of memory, but you may want to review your execution plans and validate that the data you are selecting is appropriate for the end user. you might need to add additional criteria to select less content when appropriate. Regards, Francisco On Fri, Apr 8, 2016 at 6:28 PM J- P wrote: > Hi all, > Warning , this is a longer than usual , bit elaborate thread. > > Environment; > > sql express 2005 database (2000 compatibility mode) on 2003 server; > Access front end; > ~40 users; > DB size 1.6 GB > > Scenario; > Front end starts hanging on certain menus (spinning wheel of death the > users call it) > Sometimes it comes back on its own , sometimes they restart the sql service > (with my limited knowledge i ran profiler and have found every time it > freezes/crashes the trace shows "sort warnings with event subclass 1 pass) > I know add more memory is the band-aid , however , express is limited to > 1GB and I believe it's a problem pertaining to queries ) > > Now I have been telling the owner for years he needs to to get current, > get a real DBA and clean things up (another story completely ) > > Today the "DBM (database maintainer I call him, because he is by NO MEANS > a DBA) did something trying to "fix the issue" > and the database became pretty much unusable- sort warning up the wazoo. > > I looked at the backups and the database went from 1.6GB to 1.8GB from one > hour to the next today. > > I have taken the DB and restored it to to a 2008r2 Standard DB w 8GB ram , > just so they can work come Monday. > > What I would really like to know is what changed from one hour to the next > inside the database to make it grow by 200 MB in an hour, and if there is a > tool /utility that can compare the before and after DB files. > > thanks > > > _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com > > From jnatola at hotmail.com Tue Apr 12 12:20:10 2016 From: jnatola at hotmail.com (J- P) Date: Tue, 12 Apr 2016 13:20:10 -0400 Subject: [dba-SQLServer] DB growth spurt/Comparison tool In-Reply-To: References: , Message-ID: I agree with the execution plan and queries, however, I'm running into a brick wall because I am NOT qualified to look at these queries, hash joins, or execution plans and see where they are flawed, and the "DBM" refuses to acknowledge it and says "it's lack of resources we need full SQL" I told them sure you can throw money at the problem , but that's addressing the symptoms not addressing the cause. > From: fhtapia at gmail.com > Date: Mon, 11 Apr 2016 20:30:27 +0000 > To: dba-sqlserver at databaseadvisors.com > Subject: Re: [dba-SQLServer] DB growth spurt/Comparison tool > > so if you are backing up with a transaction log, you can save the backup > and the log, then recover to a new database, and compare the old an new > database using either RedGate's Schema's compare or their DataCompare tool, > they give you a 14 day trial so you can look around and validate what > changed. > > read the section under: Errors and Warnings for this article: > https://www.simple-talk.com/sql/performance/the-default-trace-in-sql-server---the-power-of-performance-and-security-auditing/ > i get that you are running out of memory, but you may want to review your > execution plans and validate that the data you are selecting is appropriate > for the end user. you might need to add additional criteria to select less > content when appropriate. > > Regards, > Francisco > > On Fri, Apr 8, 2016 at 6:28 PM J- P wrote: > > > Hi all, > > Warning , this is a longer than usual , bit elaborate thread. > > > > Environment; > > > > sql express 2005 database (2000 compatibility mode) on 2003 server; > > Access front end; > > ~40 users; > > DB size 1.6 GB > > > > Scenario; > > Front end starts hanging on certain menus (spinning wheel of death the > > users call it) > > Sometimes it comes back on its own , sometimes they restart the sql service > > (with my limited knowledge i ran profiler and have found every time it > > freezes/crashes the trace shows "sort warnings with event subclass 1 pass) > > I know add more memory is the band-aid , however , express is limited to > > 1GB and I believe it's a problem pertaining to queries ) > > > > Now I have been telling the owner for years he needs to to get current, > > get a real DBA and clean things up (another story completely ) > > > > Today the "DBM (database maintainer I call him, because he is by NO MEANS > > a DBA) did something trying to "fix the issue" > > and the database became pretty much unusable- sort warning up the wazoo. > > > > I looked at the backups and the database went from 1.6GB to 1.8GB from one > > hour to the next today. > > > > I have taken the DB and restored it to to a 2008r2 Standard DB w 8GB ram , > > just so they can work come Monday. > > > > What I would really like to know is what changed from one hour to the next > > inside the database to make it grow by 200 MB in an hour, and if there is a > > tool /utility that can compare the before and after DB files. > > > > thanks > > > > > > _______________________________________________ > > 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 gustav at cactus.dk Thu Apr 14 10:41:34 2016 From: gustav at cactus.dk (Gustav Brock) Date: Thu, 14 Apr 2016 15:41:34 +0000 Subject: [dba-SQLServer] Trusted_Connection Message-ID: Hi all I was about adjusting some code for setting the connection string for SQL Server. The code replaces all the {n} strings: Const cstrConnect As String = _ "ODBC;" & _ "DRIVER=SQL Server;" & _ "Description=Brand name;" & _ "APP=Microsoft(r) Access;" & _ "SERVER={0};" & _ "DATABASE={1};" & _ "UID={2};" & _ "PWD={3};" & _ "Trusted_Connection=False;" Did you notice the error here? I didn't, and it took me quite a while with popping messageboxes about "Trusted connection failed" including wasted searching time with faulty answers to find out why. Because it must read: "Trusted_Connection=No;" Oh well. Details are important. /gustav From gustav at cactus.dk Sun Apr 24 02:43:53 2016 From: gustav at cactus.dk (Gustav Brock) Date: Sun, 24 Apr 2016 07:43:53 +0000 Subject: [dba-SQLServer] Database servers and timezones Message-ID: Hi all When I think about it, I have seen close to nothing on how to handle timezones in database servers when users are spread across several timezones. Given that alone the US spans a handful of timezones and Russia elleven(!), this must be a common task to address. I just ran a test from one of our Azure SQL databases: select getdate() from sometable and it returned 2016-04-24 07:03:02.187 which equaled the current UTC time. This server is located in "Northern Europe", actually Ireland I think, so that is not a big surprise, but which timezone do you in the US set on a server located, say, in Chicago, that also will service users in Alaska or Hawaii? And how do you convert to and from the timezones, not to say deal with DST? Perhaps one should store both the UTC time, the local (or "source") time, and the timezone difference (including DST offset) as - in queries - it will be very slow always to have to convert time either to or from UTC. I have never dealt with applications expected to operate across timezones, and servers have been local only, so I have safely could use Date() (and GetDate() in PT queries) but this picture changes if I move data to the cloud. /gustav From stuart at lexacorp.com.pg Sun Apr 24 04:42:29 2016 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Sun, 24 Apr 2016 19:42:29 +1000 Subject: [dba-SQLServer] [AccessD] Database servers and timezones In-Reply-To: References: Message-ID: <571C9505.18880.AF27A66@stuart.lexacorp.com.pg> If you are storing current times, then use getutcdate() instead of getdate(). When you are working in locations with DST with historical or future dates, it gets much more difficult. Also take a look at datetimeoffset. -- Stuart On 24 Apr 2016 at 7:43, Gustav Brock wrote: > Hi all > > When I think about it, I have seen close to nothing on how to handle > timezones in database servers when users are spread across several > timezones. Given that alone the US spans a handful of timezones and > Russia elleven(!), this must be a common task to address. > > I just ran a test from one of our Azure SQL databases: > > select getdate() from sometable > > and it returned > > 2016-04-24 07:03:02.187 > > which equaled the current UTC time. > > This server is located in "Northern Europe", actually Ireland I think, > so that is not a big surprise, but which timezone do you in the US set > on a server located, say, in Chicago, that also will service users in > Alaska or Hawaii? And how do you convert to and from the timezones, > not to say deal with DST? > > Perhaps one should store both the UTC time, the local (or "source") > time, and the timezone difference (including DST offset) as - in > queries - it will be very slow always to have to convert time either > to or from UTC. > > I have never dealt with applications expected to operate across > timezones, and servers have been local only, so I have safely could > use Date() (and GetDate() in PT queries) but this picture changes if I > move data to the cloud. > > /gustav > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From gustav at cactus.dk Sun Apr 24 05:48:06 2016 From: gustav at cactus.dk (Gustav Brock) Date: Sun, 24 Apr 2016 10:48:06 +0000 Subject: [dba-SQLServer] [AccessD] Database servers and timezones In-Reply-To: <571C9505.18880.AF27A66@stuart.lexacorp.com.pg> References: , <571C9505.18880.AF27A66@stuart.lexacorp.com.pg> Message-ID: Hi Stuart I had forgot about GetUtcDate() so I added this to the query and it returned the same value as GetDate(). So Azure SQL runs at UTC. Of course, you can say - what other option could be universally useful. I tried this: CAST(GetDate() AS datetimeoffset(3)) AS 'datetimeoffset test' It returns a string: 2016-04-24 10:42:02.467 +00:00 so it just shows the offset on the server. What I am thinking of, is how to handle the offset between users and/or the server in different timezones. /gustav ________________________________________ Fra: dba-SQLServer p? vegne af Stuart McLachlan Sendt: 24. april 2016 11:42 Til: Access Developers discussion and problem solving; Discussion concerning MS SQL Server ddba-sqlserver at databaseadvisors.com"; Access Developers discussion andpproblem solving Emne: Re: [dba-SQLServer] [AccessD] Database servers and timezones If you are storing current times, then use getutcdate() instead of getdate(). When you are working in locations with DST with historical or future dates, it gets much more difficult. Also take a look at datetimeoffset. -- Stuart On 24 Apr 2016 at 7:43, Gustav Brock wrote: > Hi all > > When I think about it, I have seen close to nothing on how to handle > timezones in database servers when users are spread across several > timezones. Given that alone the US spans a handful of timezones and > Russia elleven(!), this must be a common task to address. > > I just ran a test from one of our Azure SQL databases: > > select getdate() from sometable > > and it returned > > 2016-04-24 07:03:02.187 > > which equaled the current UTC time. > > This server is located in "Northern Europe", actually Ireland I think, > so that is not a big surprise, but which timezone do you in the US set > on a server located, say, in Chicago, that also will service users in > Alaska or Hawaii? And how do you convert to and from the timezones, > not to say deal with DST? > > Perhaps one should store both the UTC time, the local (or "source") > time, and the timezone difference (including DST offset) as - in > queries - it will be very slow always to have to convert time either > to or from UTC. > > I have never dealt with applications expected to operate across > timezones, and servers have been local only, so I have safely could > use Date() (and GetDate() in PT queries) but this picture changes if I > move data to the cloud. > > /gustav From David at sierranevada.com Sun Apr 24 11:00:48 2016 From: David at sierranevada.com (David Lewis) Date: Sun, 24 Apr 2016 16:00:48 +0000 Subject: [dba-SQLServer] dba-SQLServer Digest, Vol 147, Issue 1 In-Reply-To: References: Message-ID: <1461513648048.50391@sierranevada.com> There is little information to go on without any monitoring tools. That it seems to coincide with users making menu selections, suggests that there MAY be very ill-advised queries used to deliver a convenient human-consumable list. The number of things to look out for are too many to list (query operators, that is). Another item to consider is deadlocks -- if the same resources are being used (tables, etc.), and the queries are not well constructed, there is a good chance that there are page or row locks occurring, which will bring a db to its knees without intervention. No simple answer to this. Using access as a front end with sql express implies that the company is too cheap/ignorant to buy a monitoring tool. As you say there is nobody inhouse with the skills to do it the hard way (using the wait stats etc. admin tools in sql server). ------------------------------ Message: 3 Date: Tue, 12 Apr 2016 13:20:10 -0400 From: J- P To: sql list Subject: Re: [dba-SQLServer] DB growth spurt/Comparison tool Message-ID: Content-Type: text/plain; charset="iso-8859-1" I agree with the execution plan and queries, however, I'm running into a brick wall because I am NOT qualified to look at these queries, hash joins, or execution plans and see where they are flawed, and the "DBM" refuses to acknowledge it and says "it's lack of resources we need full SQL" I told them sure you can throw money at the problem , but that's addressing the symptoms not addressing the cause. ________________________________ The contents of this e-mail message and its attachments are covered by the Electronic Communications Privacy Act (18 U.S.C. 2510-2521) and are intended solely for the addressee(s) hereof. If you are not the named recipient, or the employee or agent responsible for delivering the message to the intended recipient, or if this message has been addressed to you in error, you are directed not to read, disclose, reproduce, distribute, disseminate or otherwise use this transmission. If you have received this communication in error, please notify us immediately by return e-mail or by telephone, 530-893-3520, and delete and/or destroy all copies of the message immediately. From gustav at cactus.dk Sun Apr 24 12:44:22 2016 From: gustav at cactus.dk (Gustav Brock) Date: Sun, 24 Apr 2016 17:44:22 +0000 Subject: [dba-SQLServer] ODBC connection string for Azure SQL Message-ID: Hi all Note please, that the ODBC strings published even at the Azure console are buggy, as Access doesn't like the curly brackets. Thus, a string must look like (one line, of course): ODBC;DRIVER=SQL Server Native Client 11.0; SERVER=servername.database.windows.net,1433;DATABASE=databasename; UID=username at servername;PWD=YourPassword;Trusted_Connection=No; From accessd at shaw.ca Sun Apr 24 12:59:21 2016 From: accessd at shaw.ca (Jim Lawrence) Date: Sun, 24 Apr 2016 11:59:21 -0600 (MDT) Subject: [dba-SQLServer] ODBC connection string for Azure SQL In-Reply-To: Message-ID: <1522012252.9687287.1461520761494.JavaMail.root@shaw.ca> Hi Gustav: Excellent post. Jim ----- Original Message ----- From: "Gustav Brock" To: "Discussion concerning MS SQL Server (dba-sqlserver at databaseadvisors.com)" , "Access Developers discussion and problem solving" Sent: Sunday, April 24, 2016 10:44:22 AM Subject: [dba-SQLServer] ODBC connection string for Azure SQL Hi all Note please, that the ODBC strings published even at the Azure console are buggy, as Access doesn't like the curly brackets. Thus, a string must look like (one line, of course): ODBC;DRIVER=SQL Server Native Client 11.0; SERVER=servername.database.windows.net,1433;DATABASE=databasename; UID=username at servername;PWD=YourPassword;Trusted_Connection=No; _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From Michael.Zimmer at federalmogul.com Fri Apr 29 11:33:23 2016 From: Michael.Zimmer at federalmogul.com (Zimmer, Michael) Date: Fri, 29 Apr 2016 16:33:23 +0000 Subject: [dba-SQLServer] SQL error in Excel query to IBM DB2 data source Message-ID: <6763936ED419A949BE5DEAA5A345C7224CF6EB3A@sfldmiex022> Hi all, We have an odd situation: A query using data from an ODBC connection runs fine on our Win 7 PCs with Excel '07. However, the query can only be edited on one machine, on all others editing the query returns this error: "SQL0104 - Token 'ArrivalDate' was not valid. Valid tokens: ." In the query we have a data field called "MRLDT" and we renamed it to "ArrivalDate" so that it is meaningful to the end users. Here is the SQL statement for the query: SELECT KMRL01.MPROD, KMRL01.MRLDT AS 'ArrivalDate', KMRL01.MRDTE AS 'ShipDate', right(MPRNT,6) AS 'Location', KMRL01.MQTY FROM MAN400.BPCSF9.KMRL01 KMRL01 WHERE (KMRL01.MPROD='750197') AND (KMRL01.MRDTE<=20160615) No matter what I've tried, I cannot find a way to amend the SQL statement so that I can edit the arrival date ranges. However, the spreadsheet as a whole runs fine on all of our PCs. Just no editing of queries where we rename the column headings to a meaningful title. Thanks Mike From gustav at cactus.dk Fri Apr 29 11:40:13 2016 From: gustav at cactus.dk (Gustav Brock) Date: Fri, 29 Apr 2016 16:40:13 +0000 Subject: [dba-SQLServer] SQL error in Excel query to IBM DB2 data source Message-ID: Hi Mike I guess the alias should be non-quoted: KMRL01.MRLDT AS ArrivalDate /guess -----Oprindelig meddelelse----- Fra: dba-SQLServer [mailto:dba-sqlserver-bounces at databaseadvisors.com] P? vegne af Zimmer, Michael Sendt: 29. april 2016 18:33 Til: dba-sqlserver at databaseadvisors.com Emne: [dba-SQLServer] SQL error in Excel query to IBM DB2 data source Hi all, We have an odd situation: A query using data from an ODBC connection runs fine on our Win 7 PCs with Excel '07. However, the query can only be edited on one machine, on all others editing the query returns this error: "SQL0104 - Token 'ArrivalDate' was not valid. Valid tokens: ." In the query we have a data field called "MRLDT" and we renamed it to "ArrivalDate" so that it is meaningful to the end users. Here is the SQL statement for the query: SELECT KMRL01.MPROD, KMRL01.MRLDT AS 'ArrivalDate', KMRL01.MRDTE AS 'ShipDate', right(MPRNT,6) AS 'Location', KMRL01.MQTY FROM MAN400.BPCSF9.KMRL01 KMRL01 WHERE (KMRL01.MPROD='750197') AND (KMRL01.MRDTE<=20160615) No matter what I've tried, I cannot find a way to amend the SQL statement so that I can edit the arrival date ranges. However, the spreadsheet as a whole runs fine on all of our PCs. Just no editing of queries where we rename the column headings to a meaningful title. Thanks Mike From Michael.Zimmer at federalmogul.com Fri Apr 29 11:47:21 2016 From: Michael.Zimmer at federalmogul.com (Zimmer, Michael) Date: Fri, 29 Apr 2016 16:47:21 +0000 Subject: [dba-SQLServer] SQL error in Excel query to IBM DB2 data source In-Reply-To: References: Message-ID: <6763936ED419A949BE5DEAA5A345C7224CF6EB5D@sfldmiex022> Hi Gustav, I've tried to remove the quotes with no results. I don't know if putting in the quotes is hard coded into the query wizard or not, but removing them returns the exact same error. I cannot find a place in the ODBC administration to specifiy the SET QUOTED_IDENTIFIER which is an answer I say on the web somewhere. IBM has a page about this problem with no resolution unfortunately. http://www-01.ibm.com/support/docview.wss?uid=nas8N1017228 The other thing I tried is to change the encoding of the CCSID string from ASCII to Unicode, then Unicode2. Again with no results. This is a head scratcher. -----Original Message----- From: dba-SQLServer [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Friday, April 29, 2016 11:40 AM To: Discussion concerning MS SQL Server Subject: Re: [dba-SQLServer] SQL error in Excel query to IBM DB2 data source Hi Mike I guess the alias should be non-quoted: KMRL01.MRLDT AS ArrivalDate /guess -----Oprindelig meddelelse----- Fra: dba-SQLServer [mailto:dba-sqlserver-bounces at databaseadvisors.com] P? vegne af Zimmer, Michael Sendt: 29. april 2016 18:33 Til: dba-sqlserver at databaseadvisors.com Emne: [dba-SQLServer] SQL error in Excel query to IBM DB2 data source Hi all, We have an odd situation: A query using data from an ODBC connection runs fine on our Win 7 PCs with Excel '07. However, the query can only be edited on one machine, on all others editing the query returns this error: "SQL0104 - Token 'ArrivalDate' was not valid. Valid tokens: ." In the query we have a data field called "MRLDT" and we renamed it to "ArrivalDate" so that it is meaningful to the end users. Here is the SQL statement for the query: SELECT KMRL01.MPROD, KMRL01.MRLDT AS 'ArrivalDate', KMRL01.MRDTE AS 'ShipDate', right(MPRNT,6) AS 'Location', KMRL01.MQTY FROM MAN400.BPCSF9.KMRL01 KMRL01 WHERE (KMRL01.MPROD='750197') AND (KMRL01.MRDTE<=20160615) No matter what I've tried, I cannot find a way to amend the SQL statement so that I can edit the arrival date ranges. However, the spreadsheet as a whole runs fine on all of our PCs. Just no editing of queries where we rename the column headings to a meaningful title. Thanks Mike _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From scott.marcus at tsstech.com Fri Apr 29 11:58:21 2016 From: scott.marcus at tsstech.com (Scott Marcus) Date: Fri, 29 Apr 2016 12:58:21 -0400 Subject: [dba-SQLServer] SQL error in Excel query to IBM DB2 data source In-Reply-To: <6763936ED419A949BE5DEAA5A345C7224CF6EB5D@sfldmiex022> References: <6763936ED419A949BE5DEAA5A345C7224CF6EB5D@sfldmiex022> Message-ID: Are you able to edit the string on the other computers if you do not "rename the columns"? -----Original Message----- From: dba-SQLServer [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Zimmer, Michael Sent: Friday, April 29, 2016 12:47 PM To: Discussion concerning MS SQL Server Subject: Re: [dba-SQLServer] SQL error in Excel query to IBM DB2 data source Hi Gustav, I've tried to remove the quotes with no results. I don't know if putting in the quotes is hard coded into the query wizard or not, but removing them returns the exact same error. I cannot find a place in the ODBC administration to specifiy the SET QUOTED_IDENTIFIER which is an answer I say on the web somewhere. IBM has a page about this problem with no resolution unfortunately. http://www-01.ibm.com/support/docview.wss?uid=nas8N1017228 The other thing I tried is to change the encoding of the CCSID string from ASCII to Unicode, then Unicode2. Again with no results. This is a head scratcher. -----Original Message----- From: dba-SQLServer [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Friday, April 29, 2016 11:40 AM To: Discussion concerning MS SQL Server Subject: Re: [dba-SQLServer] SQL error in Excel query to IBM DB2 data source Hi Mike I guess the alias should be non-quoted: KMRL01.MRLDT AS ArrivalDate /guess -----Oprindelig meddelelse----- Fra: dba-SQLServer [mailto:dba-sqlserver-bounces at databaseadvisors.com] P? vegne af Zimmer, Michael Sendt: 29. april 2016 18:33 Til: dba-sqlserver at databaseadvisors.com Emne: [dba-SQLServer] SQL error in Excel query to IBM DB2 data source Hi all, We have an odd situation: A query using data from an ODBC connection runs fine on our Win 7 PCs with Excel '07. However, the query can only be edited on one machine, on all others editing the query returns this error: "SQL0104 - Token 'ArrivalDate' was not valid. Valid tokens: ." In the query we have a data field called "MRLDT" and we renamed it to "ArrivalDate" so that it is meaningful to the end users. Here is the SQL statement for the query: SELECT KMRL01.MPROD, KMRL01.MRLDT AS 'ArrivalDate', KMRL01.MRDTE AS 'ShipDate', right(MPRNT,6) AS 'Location', KMRL01.MQTY FROM MAN400.BPCSF9.KMRL01 KMRL01 WHERE (KMRL01.MPROD='750197') AND (KMRL01.MRDTE<=20160615) No matter what I've tried, I cannot find a way to amend the SQL statement so that I can edit the arrival date ranges. However, the spreadsheet as a whole runs fine on all of our PCs. Just no editing of queries where we rename the column headings to a meaningful title. Thanks Mike _______________________________________________ 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 NOTICE: This electronic mail transmission is for the use of the named individual or entity to which it is directed and may contain information that is privileged or confidential. If you are not the intended recipient, any disclosure, copying, distribution or use of the contents of any information contained herein is prohibited. If you have received this electronic mail transmission in error, delete it from your system without copying or forwarding it, and notify the sender of the error by replying via email or calling TSS Technologies at (513) 772-7000, so that our address record can be corrected. Any information included in this email is provided on an ?as is? and ?where as? basis, and TSS Technologies makes no representations or warranties of any kind with respect to the completeness or accuracy of the information contained in this email. From scott.marcus at tsstech.com Fri Apr 29 12:17:53 2016 From: scott.marcus at tsstech.com (Scott Marcus) Date: Fri, 29 Apr 2016 13:17:53 -0400 Subject: [dba-SQLServer] SQL error in Excel query to IBM DB2 data source In-Reply-To: <6763936ED419A949BE5DEAA5A345C7224CF6EB5D@sfldmiex022> References: <6763936ED419A949BE5DEAA5A345C7224CF6EB5D@sfldmiex022> Message-ID: You have quote marks around ShipDate and Location. Remove those also. If the above does not work then... Try modifying the string without renaming any columns. If that works, then modify the name on just one column to see if that works (don't use quote marks). Add another column name change after each successful attempt. You may find that a column name is causing the issue. -----Original Message----- From: dba-SQLServer [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Zimmer, Michael Sent: Friday, April 29, 2016 12:47 PM To: Discussion concerning MS SQL Server Subject: Re: [dba-SQLServer] SQL error in Excel query to IBM DB2 data source Hi Gustav, I've tried to remove the quotes with no results. I don't know if putting in the quotes is hard coded into the query wizard or not, but removing them returns the exact same error. I cannot find a place in the ODBC administration to specifiy the SET QUOTED_IDENTIFIER which is an answer I say on the web somewhere. IBM has a page about this problem with no resolution unfortunately. http://www-01.ibm.com/support/docview.wss?uid=nas8N1017228 The other thing I tried is to change the encoding of the CCSID string from ASCII to Unicode, then Unicode2. Again with no results. This is a head scratcher. -----Original Message----- From: dba-SQLServer [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Friday, April 29, 2016 11:40 AM To: Discussion concerning MS SQL Server Subject: Re: [dba-SQLServer] SQL error in Excel query to IBM DB2 data source Hi Mike I guess the alias should be non-quoted: KMRL01.MRLDT AS ArrivalDate /guess -----Oprindelig meddelelse----- Fra: dba-SQLServer [mailto:dba-sqlserver-bounces at databaseadvisors.com] P? vegne af Zimmer, Michael Sendt: 29. april 2016 18:33 Til: dba-sqlserver at databaseadvisors.com Emne: [dba-SQLServer] SQL error in Excel query to IBM DB2 data source Hi all, We have an odd situation: A query using data from an ODBC connection runs fine on our Win 7 PCs with Excel '07. However, the query can only be edited on one machine, on all others editing the query returns this error: "SQL0104 - Token 'ArrivalDate' was not valid. Valid tokens: ." In the query we have a data field called "MRLDT" and we renamed it to "ArrivalDate" so that it is meaningful to the end users. Here is the SQL statement for the query: SELECT KMRL01.MPROD, KMRL01.MRLDT AS 'ArrivalDate', KMRL01.MRDTE AS 'ShipDate', right(MPRNT,6) AS 'Location', KMRL01.MQTY FROM MAN400.BPCSF9.KMRL01 KMRL01 WHERE (KMRL01.MPROD='750197') AND (KMRL01.MRDTE<=20160615) No matter what I've tried, I cannot find a way to amend the SQL statement so that I can edit the arrival date ranges. However, the spreadsheet as a whole runs fine on all of our PCs. Just no editing of queries where we rename the column headings to a meaningful title. Thanks Mike _______________________________________________ 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 NOTICE: This electronic mail transmission is for the use of the named individual or entity to which it is directed and may contain information that is privileged or confidential. If you are not the intended recipient, any disclosure, copying, distribution or use of the contents of any information contained herein is prohibited. If you have received this electronic mail transmission in error, delete it from your system without copying or forwarding it, and notify the sender of the error by replying via email or calling TSS Technologies at (513) 772-7000, so that our address record can be corrected. Any information included in this email is provided on an ?as is? and ?where as? basis, and TSS Technologies makes no representations or warranties of any kind with respect to the completeness or accuracy of the information contained in this email. From Michael.Zimmer at federalmogul.com Fri Apr 29 13:33:47 2016 From: Michael.Zimmer at federalmogul.com (Zimmer, Michael) Date: Fri, 29 Apr 2016 18:33:47 +0000 Subject: [dba-SQLServer] SQL error in Excel query to IBM DB2 data source In-Reply-To: References: <6763936ED419A949BE5DEAA5A345C7224CF6EB5D@sfldmiex022> Message-ID: <6763936ED419A949BE5DEAA5A345C7224CF6EB93@sfldmiex022> Thanks Scott, All good ideas. If I run the query without renaming the columns all is well. It seems that MS Query does not like the original data source field names to be changed to something else. The only reason we found this out is because we tried to go back into a query and edit a date range. So. 1.the query runs fine on all four of our PCs. 2. the error only occurs when one right clicks on the table in Excel and chooses Table, then Edit Query. This launches the Microsoft Query window and displays the actual query. 3. In the actual query in the Criteria field we try to adjust the value for the date. 4. then when we click Query Now the error message pops up. 5. By clicking the SQL button we can see the SQL statement and edit as you suggested but running the query still returns the same error. NOW here's what's really weird: On the four, identically set-up PCs we run this Excel sheet on -- only one can successfully change criteria and have the query work, the other three all can successfully use the spreadsheet, but cannot adjust any criteria in the query. So the error message says that SQL doesn't like the single '' marks for the alias we want to use. But I'm thinking that it might be some setting I'm missing in the ODBC administration, maybe something in the Conversions or CCSID? Mike -----Original Message----- From: dba-SQLServer [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Scott Marcus Sent: Friday, April 29, 2016 12:18 PM To: Discussion concerning MS SQL Server Subject: Re: [dba-SQLServer] SQL error in Excel query to IBM DB2 data source You have quote marks around ShipDate and Location. Remove those also. If the above does not work then... Try modifying the string without renaming any columns. If that works, then modify the name on just one column to see if that works (don't use quote marks). Add another column name change after each successful attempt. You may find that a column name is causing the issue. -----Original Message----- From: dba-SQLServer [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Zimmer, Michael Sent: Friday, April 29, 2016 12:47 PM To: Discussion concerning MS SQL Server Subject: Re: [dba-SQLServer] SQL error in Excel query to IBM DB2 data source Hi Gustav, I've tried to remove the quotes with no results. I don't know if putting in the quotes is hard coded into the query wizard or not, but removing them returns the exact same error. I cannot find a place in the ODBC administration to specifiy the SET QUOTED_IDENTIFIER which is an answer I say on the web somewhere. IBM has a page about this problem with no resolution unfortunately. http://www-01.ibm.com/support/docview.wss?uid=nas8N1017228 The other thing I tried is to change the encoding of the CCSID string from ASCII to Unicode, then Unicode2. Again with no results. This is a head scratcher. -----Original Message----- From: dba-SQLServer [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Friday, April 29, 2016 11:40 AM To: Discussion concerning MS SQL Server Subject: Re: [dba-SQLServer] SQL error in Excel query to IBM DB2 data source Hi Mike I guess the alias should be non-quoted: KMRL01.MRLDT AS ArrivalDate /guess -----Oprindelig meddelelse----- Fra: dba-SQLServer [mailto:dba-sqlserver-bounces at databaseadvisors.com] P? vegne af Zimmer, Michael Sendt: 29. april 2016 18:33 Til: dba-sqlserver at databaseadvisors.com Emne: [dba-SQLServer] SQL error in Excel query to IBM DB2 data source Hi all, We have an odd situation: A query using data from an ODBC connection runs fine on our Win 7 PCs with Excel '07. However, the query can only be edited on one machine, on all others editing the query returns this error: "SQL0104 - Token 'ArrivalDate' was not valid. Valid tokens: ." In the query we have a data field called "MRLDT" and we renamed it to "ArrivalDate" so that it is meaningful to the end users. Here is the SQL statement for the query: SELECT KMRL01.MPROD, KMRL01.MRLDT AS 'ArrivalDate', KMRL01.MRDTE AS 'ShipDate', right(MPRNT,6) AS 'Location', KMRL01.MQTY FROM MAN400.BPCSF9.KMRL01 KMRL01 WHERE (KMRL01.MPROD='750197') AND (KMRL01.MRDTE<=20160615) No matter what I've tried, I cannot find a way to amend the SQL statement so that I can edit the arrival date ranges. However, the spreadsheet as a whole runs fine on all of our PCs. Just no editing of queries where we rename the column headings to a meaningful title. Thanks Mike _______________________________________________ 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 NOTICE: This electronic mail transmission is for the use of the named individual or entity to which it is directed and may contain information that is privileged or confidential. If you are not the intended recipient, any disclosure, copying, distribution or use of the contents of any information contained herein is prohibited. If you have received this electronic mail transmission in error, delete it from your system without copying or forwarding it, and notify the sender of the error by replying via email or calling TSS Technologies at (513) 772-7000, so that our address record can be corrected. Any information included in this email is provided on an ?as is? and ?where as? basis, and TSS Technologies makes no representations or warranties of any kind with respect to the completeness or accuracy of the information contained in this email. _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From scott.marcus at tsstech.com Fri Apr 29 14:05:17 2016 From: scott.marcus at tsstech.com (Scott Marcus) Date: Fri, 29 Apr 2016 15:05:17 -0400 Subject: [dba-SQLServer] SQL error in Excel query to IBM DB2 data source In-Reply-To: <6763936ED419A949BE5DEAA5A345C7224CF6EB93@sfldmiex022> References: <6763936ED419A949BE5DEAA5A345C7224CF6EB5D@sfldmiex022> <6763936ED419A949BE5DEAA5A345C7224CF6EB93@sfldmiex022> Message-ID: <54BD631C-A5C2-4CD7-AF88-2F2E70CA6CAD@tsstech.com> To which database brand and version are you connecting? Scott Marcus > On Apr 29, 2016, at 2:35 PM, Zimmer, Michael wrote: > > Thanks Scott, > > All good ideas. If I run the query without renaming the columns all is well. It seems that MS Query does not like the original data source field names to be changed to something else. > > The only reason we found this out is because we tried to go back into a query and edit a date range. > > So. 1.the query runs fine on all four of our PCs. > 2. the error only occurs when one right clicks on the table in Excel and chooses Table, then Edit Query. This launches the Microsoft Query window and displays the actual query. > 3. In the actual query in the Criteria field we try to adjust the value for the date. > 4. then when we click Query Now the error message pops up. > 5. By clicking the SQL button we can see the SQL statement and edit as you suggested but running the query still returns the same error. > > NOW here's what's really weird: On the four, identically set-up PCs we run this Excel sheet on -- only one can successfully change criteria and have the query work, the other three all can successfully use the spreadsheet, but cannot adjust any criteria in the query. > > So the error message says that SQL doesn't like the single '' marks for the alias we want to use. But I'm thinking that it might be some setting I'm missing in the ODBC administration, maybe something in the Conversions or CCSID? > > Mike > > -----Original Message----- > From: dba-SQLServer [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Scott Marcus > Sent: Friday, April 29, 2016 12:18 PM > To: Discussion concerning MS SQL Server > Subject: Re: [dba-SQLServer] SQL error in Excel query to IBM DB2 data source > > You have quote marks around ShipDate and Location. Remove those also. > > If the above does not work then... > > Try modifying the string without renaming any columns. If that works, then modify the name on just one column to see if that works (don't use quote marks). Add another column name change after each successful attempt. You may find that a column name is causing the issue. > > -----Original Message----- > From: dba-SQLServer [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Zimmer, Michael > Sent: Friday, April 29, 2016 12:47 PM > To: Discussion concerning MS SQL Server > Subject: Re: [dba-SQLServer] SQL error in Excel query to IBM DB2 data source > > Hi Gustav, > > I've tried to remove the quotes with no results. I don't know if putting in the quotes is hard coded into the query wizard or not, but removing them returns the exact same error. > > I cannot find a place in the ODBC administration to specifiy the SET QUOTED_IDENTIFIER which is an answer I say on the web somewhere. > > IBM has a page about this problem with no resolution unfortunately. http://www-01.ibm.com/support/docview.wss?uid=nas8N1017228 > > The other thing I tried is to change the encoding of the CCSID string from ASCII to Unicode, then Unicode2. Again with no results. > > This is a head scratcher. > > > -----Original Message----- > From: dba-SQLServer [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Gustav Brock > Sent: Friday, April 29, 2016 11:40 AM > To: Discussion concerning MS SQL Server > Subject: Re: [dba-SQLServer] SQL error in Excel query to IBM DB2 data source > > Hi Mike > > I guess the alias should be non-quoted: > > KMRL01.MRLDT AS ArrivalDate > > /guess > > -----Oprindelig meddelelse----- > Fra: dba-SQLServer [mailto:dba-sqlserver-bounces at databaseadvisors.com] P? vegne af Zimmer, Michael > Sendt: 29. april 2016 18:33 > Til: dba-sqlserver at databaseadvisors.com > Emne: [dba-SQLServer] SQL error in Excel query to IBM DB2 data source > > Hi all, > > We have an odd situation: A query using data from an ODBC connection runs fine on our Win 7 PCs with Excel '07. However, the query can only be edited on one machine, on all others editing the query returns this error: > > "SQL0104 - Token 'ArrivalDate' was not valid. Valid tokens: ." > > In the query we have a data field called "MRLDT" and we renamed it to "ArrivalDate" so that it is meaningful to the end users. > > Here is the SQL statement for the query: > SELECT KMRL01.MPROD, KMRL01.MRLDT AS 'ArrivalDate', KMRL01.MRDTE AS 'ShipDate', right(MPRNT,6) AS 'Location', KMRL01.MQTY FROM MAN400.BPCSF9.KMRL01 KMRL01 WHERE (KMRL01.MPROD='750197') AND (KMRL01.MRDTE<=20160615) > > No matter what I've tried, I cannot find a way to amend the SQL statement so that I can edit the arrival date ranges. > > However, the spreadsheet as a whole runs fine on all of our PCs. Just no editing of queries where we rename the column headings to a meaningful title. > > Thanks > > Mike > > > _______________________________________________ > 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 > > > NOTICE: This electronic mail transmission is for the use of the named individual or entity to which it is directed and may contain information that is privileged or confidential. If you are not the intended recipient, any disclosure, copying, distribution or use of the contents of any information contained herein is prohibited. If you have received this electronic mail transmission in error, delete it from your system without copying or forwarding it, and notify the sender of the error by replying via email or calling TSS Technologies at (513) 772-7000, so that our address record can be corrected. > Any information included in this email is provided on an ?as is? and ?where as? basis, and TSS Technologies makes no representations or warranties of any kind with respect to the completeness or accuracy of the information contained in this email. > > _______________________________________________ > 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.Zimmer at federalmogul.com Fri Apr 29 14:42:28 2016 From: Michael.Zimmer at federalmogul.com (Zimmer, Michael) Date: Fri, 29 Apr 2016 19:42:28 +0000 Subject: [dba-SQLServer] SQL error in Excel query to IBM DB2 data source In-Reply-To: <54BD631C-A5C2-4CD7-AF88-2F2E70CA6CAD@tsstech.com> References: <6763936ED419A949BE5DEAA5A345C7224CF6EB5D@sfldmiex022> <6763936ED419A949BE5DEAA5A345C7224CF6EB93@sfldmiex022> <54BD631C-A5C2-4CD7-AF88-2F2E70CA6CAD@tsstech.com> Message-ID: <6763936ED419A949BE5DEAA5A345C7224CF6EBF7@sfldmiex022> We are using Excel 2007 to connect to data sources via ODBC that reside on an IBM AS400 system. The program on the AS400 is BPCS storing data in the DB2/400 relational database. Mike -----Original Message----- From: dba-SQLServer [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Scott Marcus Sent: Friday, April 29, 2016 2:05 PM To: Discussion concerning MS SQL Server Subject: Re: [dba-SQLServer] SQL error in Excel query to IBM DB2 data source To which database brand and version are you connecting? Scott Marcus > On Apr 29, 2016, at 2:35 PM, Zimmer, Michael wrote: > > Thanks Scott, > > All good ideas. If I run the query without renaming the columns all is well. It seems that MS Query does not like the original data source field names to be changed to something else. > > The only reason we found this out is because we tried to go back into a query and edit a date range. > > So. 1.the query runs fine on all four of our PCs. > 2. the error only occurs when one right clicks on the table in Excel and chooses Table, then Edit Query. This launches the Microsoft Query window and displays the actual query. > 3. In the actual query in the Criteria field we try to adjust the value for the date. > 4. then when we click Query Now the error message pops up. > 5. By clicking the SQL button we can see the SQL statement and edit as you suggested but running the query still returns the same error. > > NOW here's what's really weird: On the four, identically set-up PCs we run this Excel sheet on -- only one can successfully change criteria and have the query work, the other three all can successfully use the spreadsheet, but cannot adjust any criteria in the query. > > So the error message says that SQL doesn't like the single '' marks for the alias we want to use. But I'm thinking that it might be some setting I'm missing in the ODBC administration, maybe something in the Conversions or CCSID? > > Mike > > -----Original Message----- > From: dba-SQLServer [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Scott Marcus > Sent: Friday, April 29, 2016 12:18 PM > To: Discussion concerning MS SQL Server > Subject: Re: [dba-SQLServer] SQL error in Excel query to IBM DB2 data source > > You have quote marks around ShipDate and Location. Remove those also. > > If the above does not work then... > > Try modifying the string without renaming any columns. If that works, then modify the name on just one column to see if that works (don't use quote marks). Add another column name change after each successful attempt. You may find that a column name is causing the issue. > > -----Original Message----- > From: dba-SQLServer [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Zimmer, Michael > Sent: Friday, April 29, 2016 12:47 PM > To: Discussion concerning MS SQL Server > Subject: Re: [dba-SQLServer] SQL error in Excel query to IBM DB2 data source > > Hi Gustav, > > I've tried to remove the quotes with no results. I don't know if putting in the quotes is hard coded into the query wizard or not, but removing them returns the exact same error. > > I cannot find a place in the ODBC administration to specifiy the SET QUOTED_IDENTIFIER which is an answer I say on the web somewhere. > > IBM has a page about this problem with no resolution unfortunately. http://www-01.ibm.com/support/docview.wss?uid=nas8N1017228 > > The other thing I tried is to change the encoding of the CCSID string from ASCII to Unicode, then Unicode2. Again with no results. > > This is a head scratcher. > > > -----Original Message----- > From: dba-SQLServer [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Gustav Brock > Sent: Friday, April 29, 2016 11:40 AM > To: Discussion concerning MS SQL Server > Subject: Re: [dba-SQLServer] SQL error in Excel query to IBM DB2 data source > > Hi Mike > > I guess the alias should be non-quoted: > > KMRL01.MRLDT AS ArrivalDate > > /guess > > -----Oprindelig meddelelse----- > Fra: dba-SQLServer [mailto:dba-sqlserver-bounces at databaseadvisors.com] P? vegne af Zimmer, Michael > Sendt: 29. april 2016 18:33 > Til: dba-sqlserver at databaseadvisors.com > Emne: [dba-SQLServer] SQL error in Excel query to IBM DB2 data source > > Hi all, > > We have an odd situation: A query using data from an ODBC connection runs fine on our Win 7 PCs with Excel '07. However, the query can only be edited on one machine, on all others editing the query returns this error: > > "SQL0104 - Token 'ArrivalDate' was not valid. Valid tokens: ." > > In the query we have a data field called "MRLDT" and we renamed it to "ArrivalDate" so that it is meaningful to the end users. > > Here is the SQL statement for the query: > SELECT KMRL01.MPROD, KMRL01.MRLDT AS 'ArrivalDate', KMRL01.MRDTE AS 'ShipDate', right(MPRNT,6) AS 'Location', KMRL01.MQTY FROM MAN400.BPCSF9.KMRL01 KMRL01 WHERE (KMRL01.MPROD='750197') AND (KMRL01.MRDTE<=20160615) > > No matter what I've tried, I cannot find a way to amend the SQL statement so that I can edit the arrival date ranges. > > However, the spreadsheet as a whole runs fine on all of our PCs. Just no editing of queries where we rename the column headings to a meaningful title. > > Thanks > > Mike > > > _______________________________________________ > 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 > > > NOTICE: This electronic mail transmission is for the use of the named individual or entity to which it is directed and may contain information that is privileged or confidential. If you are not the intended recipient, any disclosure, copying, distribution or use of the contents of any information contained herein is prohibited. If you have received this electronic mail transmission in error, delete it from your system without copying or forwarding it, and notify the sender of the error by replying via email or calling TSS Technologies at (513) 772-7000, so that our address record can be corrected. > Any information included in this email is provided on an ?as is? and ?where as? basis, and TSS Technologies makes no representations or warranties of any kind with respect to the completeness or accuracy of the information contained in this email. > > _______________________________________________ > 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 stuart at lexacorp.com.pg Fri Apr 29 19:06:27 2016 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Sat, 30 Apr 2016 10:06:27 +1000 Subject: [dba-SQLServer] SQL error in Excel query to IBM DB2 data source In-Reply-To: <6763936ED419A949BE5DEAA5A345C7224CF6EB93@sfldmiex022> References: , , <6763936ED419A949BE5DEAA5A345C7224CF6EB93@sfldmiex022> Message-ID: <5723F703.13081.27C93E77@stuart.lexacorp.com.pg> The OBDC DSN should contain a parameter "Use ANSI Quoted Identifiers:" Set it to Yes and No and see what happens. On 29 Apr 2016 at 18:33, Zimmer, Michael wrote: > > NOW here's what's really weird: On the four, identically set-up PCs > we run this Excel sheet on -- only one can successfully change > criteria and have the query work, the other three all can successfully > use the spreadsheet, but cannot adjust any criteria in the query. > > So the error message says that SQL doesn't like the single '' marks > for the alias we want to use. But I'm thinking that it might be some > setting I'm missing in the ODBC administration, maybe something in the > Conversions or CCSID? > > Mike >