From jwcolby at colbyconsulting.com Fri Feb 1 06:54:45 2008 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 1 Feb 2008 07:54:45 -0500 Subject: [dba-SQLServer] Timeouts executing views Message-ID: <000601c864d1$9f3f3000$0401a8c0@M90> When I try to execute a view, if results aren't returned within some short period of time (about 30 seconds) I get a timeout message. OTOH, if I copy the Sql, open a new query, paste it in and run, it will complete even if it takes hours. Does anyone know where to go to change the timeout period for views run directly? John W. Colby Colby Consulting www.ColbyConsulting.com From pauln at sqlserverbible.com Fri Feb 1 08:52:52 2008 From: pauln at sqlserverbible.com (Paul Nielsen) Date: Fri, 1 Feb 2008 07:52:52 -0700 Subject: [dba-SQLServer] Timeouts executing views In-Reply-To: <000601c864d1$9f3f3000$0401a8c0@M90> References: <000601c864d1$9f3f3000$0401a8c0@M90> Message-ID: <012a01c864e2$1fdaab30$5f900190$@com> Even of it takes hours? Can you show us the SQL and the Query Execution Plan? -Paul -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, February 01, 2008 5:55 AM To: dba-sqlserver at databaseadvisors.com Subject: [dba-SQLServer] Timeouts executing views When I try to execute a view, if results aren't returned within some short period of time (about 30 seconds) I get a timeout message. OTOH, if I copy the Sql, open a new query, paste it in and run, it will complete even if it takes hours. Does anyone know where to go to change the timeout period for views run directly? 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 __________ NOD32 2843 (20080201) Information __________ This message was checked by NOD32 antivirus system. http://www.eset.com From jwcolby at colbyconsulting.com Fri Feb 1 09:02:52 2008 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 1 Feb 2008 10:02:52 -0500 Subject: [dba-SQLServer] Timeouts executing views In-Reply-To: <012a01c864e2$1fdaab30$5f900190$@com> References: <000601c864d1$9f3f3000$0401a8c0@M90> <012a01c864e2$1fdaab30$5f900190$@com> Message-ID: <001c01c864e3$850e4d80$0401a8c0@M90> Paul, It isn't about how long the query takes. No I can't show you the execution plan because this happens for ANY query that takes longer than 30 seconds. I understand that you want long running views to time out, but why does a view time out and the query based on that SQL not time out? It is irritating to have to go get the sql, create a query, dump the SQL in there, then run it in order to get results. I just want to run the View and get the results. 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 Paul Nielsen Sent: Friday, February 01, 2008 9:53 AM To: 'Discussion concerning MS SQL Server' Subject: Re: [dba-SQLServer] Timeouts executing views Even of it takes hours? Can you show us the SQL and the Query Execution Plan? -Paul -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, February 01, 2008 5:55 AM To: dba-sqlserver at databaseadvisors.com Subject: [dba-SQLServer] Timeouts executing views When I try to execute a view, if results aren't returned within some short period of time (about 30 seconds) I get a timeout message. OTOH, if I copy the Sql, open a new query, paste it in and run, it will complete even if it takes hours. Does anyone know where to go to change the timeout period for views run directly? 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 __________ NOD32 2843 (20080201) Information __________ This message was checked by NOD32 antivirus system. http://www.eset.com _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From pauln at sqlserverbible.com Fri Feb 1 09:23:27 2008 From: pauln at sqlserverbible.com (Paul Nielsen) Date: Fri, 1 Feb 2008 08:23:27 -0700 Subject: [dba-SQLServer] Timeouts executing views In-Reply-To: <001c01c864e3$850e4d80$0401a8c0@M90> References: <000601c864d1$9f3f3000$0401a8c0@M90> <012a01c864e2$1fdaab30$5f900190$@com> <001c01c864e3$850e4d80$0401a8c0@M90> Message-ID: <013c01c864e6$6594ded0$30be9c70$@com> The difference has nothing to do with the view, but how you're connecting. ADO has a built in timeout of 30 seconds, SSMS does not. And if you show me the query execution plan, I'll bet we can make it run in seconds not hours. -Paul -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, February 01, 2008 8:03 AM To: 'Discussion concerning MS SQL Server' Subject: Re: [dba-SQLServer] Timeouts executing views Paul, It isn't about how long the query takes. No I can't show you the execution plan because this happens for ANY query that takes longer than 30 seconds. I understand that you want long running views to time out, but why does a view time out and the query based on that SQL not time out? It is irritating to have to go get the sql, create a query, dump the SQL in there, then run it in order to get results. I just want to run the View and get the results. 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 Paul Nielsen Sent: Friday, February 01, 2008 9:53 AM To: 'Discussion concerning MS SQL Server' Subject: Re: [dba-SQLServer] Timeouts executing views Even of it takes hours? Can you show us the SQL and the Query Execution Plan? -Paul -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, February 01, 2008 5:55 AM To: dba-sqlserver at databaseadvisors.com Subject: [dba-SQLServer] Timeouts executing views When I try to execute a view, if results aren't returned within some short period of time (about 30 seconds) I get a timeout message. OTOH, if I copy the Sql, open a new query, paste it in and run, it will complete even if it takes hours. Does anyone know where to go to change the timeout period for views run directly? 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 __________ NOD32 2843 (20080201) Information __________ This message was checked by NOD32 antivirus system. http://www.eset.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 __________ NOD32 2844 (20080201) Information __________ This message was checked by NOD32 antivirus system. http://www.eset.com From jwcolby at colbyconsulting.com Fri Feb 1 09:44:08 2008 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 1 Feb 2008 10:44:08 -0500 Subject: [dba-SQLServer] Timeouts executing views In-Reply-To: <013c01c864e6$6594ded0$30be9c70$@com> References: <000601c864d1$9f3f3000$0401a8c0@M90> <012a01c864e2$1fdaab30$5f900190$@com><001c01c864e3$850e4d80$0401a8c0@M90> <013c01c864e6$6594ded0$30be9c70$@com> Message-ID: <002401c864e9$48d31610$0401a8c0@M90> Paul, I don't think you understand still. I am not saying that a specific query is too long. What I am saying is that I create DOZENS of queries. Some I can just run, others I have to go through this crap to see the data. You can't spend your life examining my execution plans (though I appreciate the offer), and I don't need you to. These are queries run against 50 million records, with complex wheres. There are GOING TO BE queries that take longer than 30 seconds. I just want to find where I tell SQL Server to let a view to take up to X seconds to complete before timing out, so I can up that number to something more reasonable. For tiny databases, 30 seconds is probably quite reasonable. For my large databases 30 seconds is not reasonable. 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 Paul Nielsen Sent: Friday, February 01, 2008 10:23 AM To: 'Discussion concerning MS SQL Server' Subject: Re: [dba-SQLServer] Timeouts executing views The difference has nothing to do with the view, but how you're connecting. ADO has a built in timeout of 30 seconds, SSMS does not. And if you show me the query execution plan, I'll bet we can make it run in seconds not hours. -Paul -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, February 01, 2008 8:03 AM To: 'Discussion concerning MS SQL Server' Subject: Re: [dba-SQLServer] Timeouts executing views Paul, It isn't about how long the query takes. No I can't show you the execution plan because this happens for ANY query that takes longer than 30 seconds. I understand that you want long running views to time out, but why does a view time out and the query based on that SQL not time out? It is irritating to have to go get the sql, create a query, dump the SQL in there, then run it in order to get results. I just want to run the View and get the results. 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 Paul Nielsen Sent: Friday, February 01, 2008 9:53 AM To: 'Discussion concerning MS SQL Server' Subject: Re: [dba-SQLServer] Timeouts executing views Even of it takes hours? Can you show us the SQL and the Query Execution Plan? -Paul -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, February 01, 2008 5:55 AM To: dba-sqlserver at databaseadvisors.com Subject: [dba-SQLServer] Timeouts executing views When I try to execute a view, if results aren't returned within some short period of time (about 30 seconds) I get a timeout message. OTOH, if I copy the Sql, open a new query, paste it in and run, it will complete even if it takes hours. Does anyone know where to go to change the timeout period for views run directly? 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 __________ NOD32 2843 (20080201) Information __________ This message was checked by NOD32 antivirus system. http://www.eset.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 __________ NOD32 2844 (20080201) Information __________ This message was checked by NOD32 antivirus system. http://www.eset.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 Feb 1 09:45:26 2008 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 1 Feb 2008 10:45:26 -0500 Subject: [dba-SQLServer] Timeouts executing views In-Reply-To: <013c01c864e6$6594ded0$30be9c70$@com> References: <000601c864d1$9f3f3000$0401a8c0@M90> <012a01c864e2$1fdaab30$5f900190$@com><001c01c864e3$850e4d80$0401a8c0@M90> <013c01c864e6$6594ded0$30be9c70$@com> Message-ID: <002501c864e9$775a66f0$0401a8c0@M90> Paul, forget I said hours. Most of them in fact run in a minute or two. Just long enough to cause the timeout. I simply need to up that timeout. Thanks, 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 Paul Nielsen Sent: Friday, February 01, 2008 10:23 AM To: 'Discussion concerning MS SQL Server' Subject: Re: [dba-SQLServer] Timeouts executing views The difference has nothing to do with the view, but how you're connecting. ADO has a built in timeout of 30 seconds, SSMS does not. And if you show me the query execution plan, I'll bet we can make it run in seconds not hours. -Paul -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, February 01, 2008 8:03 AM To: 'Discussion concerning MS SQL Server' Subject: Re: [dba-SQLServer] Timeouts executing views Paul, It isn't about how long the query takes. No I can't show you the execution plan because this happens for ANY query that takes longer than 30 seconds. I understand that you want long running views to time out, but why does a view time out and the query based on that SQL not time out? It is irritating to have to go get the sql, create a query, dump the SQL in there, then run it in order to get results. I just want to run the View and get the results. 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 Paul Nielsen Sent: Friday, February 01, 2008 9:53 AM To: 'Discussion concerning MS SQL Server' Subject: Re: [dba-SQLServer] Timeouts executing views Even of it takes hours? Can you show us the SQL and the Query Execution Plan? -Paul -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, February 01, 2008 5:55 AM To: dba-sqlserver at databaseadvisors.com Subject: [dba-SQLServer] Timeouts executing views When I try to execute a view, if results aren't returned within some short period of time (about 30 seconds) I get a timeout message. OTOH, if I copy the Sql, open a new query, paste it in and run, it will complete even if it takes hours. Does anyone know where to go to change the timeout period for views run directly? 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 __________ NOD32 2843 (20080201) Information __________ This message was checked by NOD32 antivirus system. http://www.eset.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 __________ NOD32 2844 (20080201) Information __________ This message was checked by NOD32 antivirus system. http://www.eset.com _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From pauln at sqlserverbible.com Fri Feb 1 10:21:39 2008 From: pauln at sqlserverbible.com (Paul Nielsen) Date: Fri, 1 Feb 2008 09:21:39 -0700 Subject: [dba-SQLServer] Timeouts executing views In-Reply-To: <002501c864e9$775a66f0$0401a8c0@M90> References: <000601c864d1$9f3f3000$0401a8c0@M90> <012a01c864e2$1fdaab30$5f900190$@com><001c01c864e3$850e4d80$0401a8c0@M90> <013c01c864e6$6594ded0$30be9c70$@com> <002501c864e9$775a66f0$0401a8c0@M90> Message-ID: <002301c864ee$86d85e20$94891a60$@com> How are you connecting when using a view? -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, February 01, 2008 8:45 AM To: 'Discussion concerning MS SQL Server' Subject: Re: [dba-SQLServer] Timeouts executing views Paul, forget I said hours. Most of them in fact run in a minute or two. Just long enough to cause the timeout. I simply need to up that timeout. Thanks, 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 Paul Nielsen Sent: Friday, February 01, 2008 10:23 AM To: 'Discussion concerning MS SQL Server' Subject: Re: [dba-SQLServer] Timeouts executing views The difference has nothing to do with the view, but how you're connecting. ADO has a built in timeout of 30 seconds, SSMS does not. And if you show me the query execution plan, I'll bet we can make it run in seconds not hours. -Paul -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, February 01, 2008 8:03 AM To: 'Discussion concerning MS SQL Server' Subject: Re: [dba-SQLServer] Timeouts executing views Paul, It isn't about how long the query takes. No I can't show you the execution plan because this happens for ANY query that takes longer than 30 seconds. I understand that you want long running views to time out, but why does a view time out and the query based on that SQL not time out? It is irritating to have to go get the sql, create a query, dump the SQL in there, then run it in order to get results. I just want to run the View and get the results. 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 Paul Nielsen Sent: Friday, February 01, 2008 9:53 AM To: 'Discussion concerning MS SQL Server' Subject: Re: [dba-SQLServer] Timeouts executing views Even of it takes hours? Can you show us the SQL and the Query Execution Plan? -Paul -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, February 01, 2008 5:55 AM To: dba-sqlserver at databaseadvisors.com Subject: [dba-SQLServer] Timeouts executing views When I try to execute a view, if results aren't returned within some short period of time (about 30 seconds) I get a timeout message. OTOH, if I copy the Sql, open a new query, paste it in and run, it will complete even if it takes hours. Does anyone know where to go to change the timeout period for views run directly? 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 __________ NOD32 2843 (20080201) Information __________ This message was checked by NOD32 antivirus system. http://www.eset.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 __________ NOD32 2844 (20080201) Information __________ This message was checked by NOD32 antivirus system. http://www.eset.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 __________ NOD32 2844 (20080201) Information __________ This message was checked by NOD32 antivirus system. http://www.eset.com From jwcolby at colbyconsulting.com Fri Feb 1 10:32:34 2008 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 1 Feb 2008 11:32:34 -0500 Subject: [dba-SQLServer] Timeouts executing views In-Reply-To: <002301c864ee$86d85e20$94891a60$@com> References: <000601c864d1$9f3f3000$0401a8c0@M90> <012a01c864e2$1fdaab30$5f900190$@com><001c01c864e3$850e4d80$0401a8c0@M90> <013c01c864e6$6594ded0$30be9c70$@com><002501c864e9$775a66f0$0401a8c0@M90> <002301c864ee$86d85e20$94891a60$@com> Message-ID: <003601c864f0$0d074cd0$0401a8c0@M90> I am talking about inside of SQL Server 2005 Management Studio. Beyond that I don't understand the question. 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 Paul Nielsen Sent: Friday, February 01, 2008 11:22 AM To: 'Discussion concerning MS SQL Server' Subject: Re: [dba-SQLServer] Timeouts executing views How are you connecting when using a view? -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, February 01, 2008 8:45 AM To: 'Discussion concerning MS SQL Server' Subject: Re: [dba-SQLServer] Timeouts executing views Paul, forget I said hours. Most of them in fact run in a minute or two. Just long enough to cause the timeout. I simply need to up that timeout. Thanks, 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 Paul Nielsen Sent: Friday, February 01, 2008 10:23 AM To: 'Discussion concerning MS SQL Server' Subject: Re: [dba-SQLServer] Timeouts executing views The difference has nothing to do with the view, but how you're connecting. ADO has a built in timeout of 30 seconds, SSMS does not. And if you show me the query execution plan, I'll bet we can make it run in seconds not hours. -Paul -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, February 01, 2008 8:03 AM To: 'Discussion concerning MS SQL Server' Subject: Re: [dba-SQLServer] Timeouts executing views Paul, It isn't about how long the query takes. No I can't show you the execution plan because this happens for ANY query that takes longer than 30 seconds. I understand that you want long running views to time out, but why does a view time out and the query based on that SQL not time out? It is irritating to have to go get the sql, create a query, dump the SQL in there, then run it in order to get results. I just want to run the View and get the results. 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 Paul Nielsen Sent: Friday, February 01, 2008 9:53 AM To: 'Discussion concerning MS SQL Server' Subject: Re: [dba-SQLServer] Timeouts executing views Even of it takes hours? Can you show us the SQL and the Query Execution Plan? -Paul -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, February 01, 2008 5:55 AM To: dba-sqlserver at databaseadvisors.com Subject: [dba-SQLServer] Timeouts executing views When I try to execute a view, if results aren't returned within some short period of time (about 30 seconds) I get a timeout message. OTOH, if I copy the Sql, open a new query, paste it in and run, it will complete even if it takes hours. Does anyone know where to go to change the timeout period for views run directly? 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 __________ NOD32 2843 (20080201) Information __________ This message was checked by NOD32 antivirus system. http://www.eset.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 __________ NOD32 2844 (20080201) Information __________ This message was checked by NOD32 antivirus system. http://www.eset.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 __________ NOD32 2844 (20080201) Information __________ This message was checked by NOD32 antivirus system. http://www.eset.com _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From pauln at sqlserverbible.com Fri Feb 1 10:52:19 2008 From: pauln at sqlserverbible.com (Paul Nielsen) Date: Fri, 1 Feb 2008 09:52:19 -0700 Subject: [dba-SQLServer] Timeouts executing views In-Reply-To: <003601c864f0$0d074cd0$0401a8c0@M90> References: <000601c864d1$9f3f3000$0401a8c0@M90> <012a01c864e2$1fdaab30$5f900190$@com><001c01c864e3$850e4d80$0401a8c0@M90> <013c01c864e6$6594ded0$30be9c70$@com><002501c864e9$775a66f0$0401a8c0@M90> <002301c864ee$86d85e20$94891a60$@com> <003601c864f0$0d074cd0$0401a8c0@M90> Message-ID: <002d01c864f2$cffac300$6ff04900$@com> SSMS times out? It shouldn't. tell me more. -Paul -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, February 01, 2008 9:33 AM To: 'Discussion concerning MS SQL Server' Subject: Re: [dba-SQLServer] Timeouts executing views I am talking about inside of SQL Server 2005 Management Studio. Beyond that I don't understand the question. 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 Paul Nielsen Sent: Friday, February 01, 2008 11:22 AM To: 'Discussion concerning MS SQL Server' Subject: Re: [dba-SQLServer] Timeouts executing views How are you connecting when using a view? -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, February 01, 2008 8:45 AM To: 'Discussion concerning MS SQL Server' Subject: Re: [dba-SQLServer] Timeouts executing views Paul, forget I said hours. Most of them in fact run in a minute or two. Just long enough to cause the timeout. I simply need to up that timeout. Thanks, 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 Paul Nielsen Sent: Friday, February 01, 2008 10:23 AM To: 'Discussion concerning MS SQL Server' Subject: Re: [dba-SQLServer] Timeouts executing views The difference has nothing to do with the view, but how you're connecting. ADO has a built in timeout of 30 seconds, SSMS does not. And if you show me the query execution plan, I'll bet we can make it run in seconds not hours. -Paul -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, February 01, 2008 8:03 AM To: 'Discussion concerning MS SQL Server' Subject: Re: [dba-SQLServer] Timeouts executing views Paul, It isn't about how long the query takes. No I can't show you the execution plan because this happens for ANY query that takes longer than 30 seconds. I understand that you want long running views to time out, but why does a view time out and the query based on that SQL not time out? It is irritating to have to go get the sql, create a query, dump the SQL in there, then run it in order to get results. I just want to run the View and get the results. 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 Paul Nielsen Sent: Friday, February 01, 2008 9:53 AM To: 'Discussion concerning MS SQL Server' Subject: Re: [dba-SQLServer] Timeouts executing views Even of it takes hours? Can you show us the SQL and the Query Execution Plan? -Paul -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, February 01, 2008 5:55 AM To: dba-sqlserver at databaseadvisors.com Subject: [dba-SQLServer] Timeouts executing views When I try to execute a view, if results aren't returned within some short period of time (about 30 seconds) I get a timeout message. OTOH, if I copy the Sql, open a new query, paste it in and run, it will complete even if it takes hours. Does anyone know where to go to change the timeout period for views run directly? 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 __________ NOD32 2843 (20080201) Information __________ This message was checked by NOD32 antivirus system. http://www.eset.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 __________ NOD32 2844 (20080201) Information __________ This message was checked by NOD32 antivirus system. http://www.eset.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 __________ NOD32 2844 (20080201) Information __________ This message was checked by NOD32 antivirus system. http://www.eset.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 __________ NOD32 2844 (20080201) Information __________ This message was checked by NOD32 antivirus system. http://www.eset.com From jwcolby at colbyconsulting.com Fri Feb 1 11:02:18 2008 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 1 Feb 2008 12:02:18 -0500 Subject: [dba-SQLServer] Timeouts executing views In-Reply-To: <002d01c864f2$cffac300$6ff04900$@com> References: <000601c864d1$9f3f3000$0401a8c0@M90> <012a01c864e2$1fdaab30$5f900190$@com><001c01c864e3$850e4d80$0401a8c0@M90> <013c01c864e6$6594ded0$30be9c70$@com><002501c864e9$775a66f0$0401a8c0@M90> <002301c864ee$86d85e20$94891a60$@com><003601c864f0$0d074cd0$0401a8c0@M90> <002d01c864f2$cffac300$6ff04900$@com> Message-ID: <003f01c864f4$34922550$0401a8c0@M90> ROTFL, I can't. I execute a view. It times out. What more can I tell you? It does so on any of my machines, I can tell you that. 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 Paul Nielsen Sent: Friday, February 01, 2008 11:52 AM To: 'Discussion concerning MS SQL Server' Subject: Re: [dba-SQLServer] Timeouts executing views SSMS times out? It shouldn't. tell me more. -Paul -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, February 01, 2008 9:33 AM To: 'Discussion concerning MS SQL Server' Subject: Re: [dba-SQLServer] Timeouts executing views I am talking about inside of SQL Server 2005 Management Studio. Beyond that I don't understand the question. 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 Paul Nielsen Sent: Friday, February 01, 2008 11:22 AM To: 'Discussion concerning MS SQL Server' Subject: Re: [dba-SQLServer] Timeouts executing views How are you connecting when using a view? -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, February 01, 2008 8:45 AM To: 'Discussion concerning MS SQL Server' Subject: Re: [dba-SQLServer] Timeouts executing views Paul, forget I said hours. Most of them in fact run in a minute or two. Just long enough to cause the timeout. I simply need to up that timeout. Thanks, 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 Paul Nielsen Sent: Friday, February 01, 2008 10:23 AM To: 'Discussion concerning MS SQL Server' Subject: Re: [dba-SQLServer] Timeouts executing views The difference has nothing to do with the view, but how you're connecting. ADO has a built in timeout of 30 seconds, SSMS does not. And if you show me the query execution plan, I'll bet we can make it run in seconds not hours. -Paul -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, February 01, 2008 8:03 AM To: 'Discussion concerning MS SQL Server' Subject: Re: [dba-SQLServer] Timeouts executing views Paul, It isn't about how long the query takes. No I can't show you the execution plan because this happens for ANY query that takes longer than 30 seconds. I understand that you want long running views to time out, but why does a view time out and the query based on that SQL not time out? It is irritating to have to go get the sql, create a query, dump the SQL in there, then run it in order to get results. I just want to run the View and get the results. 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 Paul Nielsen Sent: Friday, February 01, 2008 9:53 AM To: 'Discussion concerning MS SQL Server' Subject: Re: [dba-SQLServer] Timeouts executing views Even of it takes hours? Can you show us the SQL and the Query Execution Plan? -Paul -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, February 01, 2008 5:55 AM To: dba-sqlserver at databaseadvisors.com Subject: [dba-SQLServer] Timeouts executing views When I try to execute a view, if results aren't returned within some short period of time (about 30 seconds) I get a timeout message. OTOH, if I copy the Sql, open a new query, paste it in and run, it will complete even if it takes hours. Does anyone know where to go to change the timeout period for views run directly? 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 __________ NOD32 2843 (20080201) Information __________ This message was checked by NOD32 antivirus system. http://www.eset.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 __________ NOD32 2844 (20080201) Information __________ This message was checked by NOD32 antivirus system. http://www.eset.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 __________ NOD32 2844 (20080201) Information __________ This message was checked by NOD32 antivirus system. http://www.eset.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 __________ NOD32 2844 (20080201) Information __________ This message was checked by NOD32 antivirus system. http://www.eset.com _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From pauln at sqlserverbible.com Fri Feb 1 11:42:34 2008 From: pauln at sqlserverbible.com (Paul Nielsen) Date: Fri, 1 Feb 2008 10:42:34 -0700 Subject: [dba-SQLServer] Timeouts executing views In-Reply-To: <003f01c864f4$34922550$0401a8c0@M90> References: <000601c864d1$9f3f3000$0401a8c0@M90> <012a01c864e2$1fdaab30$5f900190$@com><001c01c864e3$850e4d80$0401a8c0@M90> <013c01c864e6$6594ded0$30be9c70$@com><002501c864e9$775a66f0$0401a8c0@M90> <002301c864ee$86d85e20$94891a60$@com><003601c864f0$0d074cd0$0401a8c0@M90> <002d01c864f2$cffac300$6ff04900$@com> <003f01c864f4$34922550$0401a8c0@M90> Message-ID: <002101c864f9$d49ad3d0$7dd07b70$@com> How do you execute the view? Do you type "Select * from view" in a query editor and then press F5? Or Object Explorer>Highlight view>context menu>Open View? -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, February 01, 2008 10:02 AM To: 'Discussion concerning MS SQL Server' Subject: Re: [dba-SQLServer] Timeouts executing views ROTFL, I can't. I execute a view. It times out. What more can I tell you? It does so on any of my machines, I can tell you that. 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 Paul Nielsen Sent: Friday, February 01, 2008 11:52 AM To: 'Discussion concerning MS SQL Server' Subject: Re: [dba-SQLServer] Timeouts executing views SSMS times out? It shouldn't. tell me more. -Paul -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, February 01, 2008 9:33 AM To: 'Discussion concerning MS SQL Server' Subject: Re: [dba-SQLServer] Timeouts executing views I am talking about inside of SQL Server 2005 Management Studio. Beyond that I don't understand the question. 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 Paul Nielsen Sent: Friday, February 01, 2008 11:22 AM To: 'Discussion concerning MS SQL Server' Subject: Re: [dba-SQLServer] Timeouts executing views How are you connecting when using a view? -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, February 01, 2008 8:45 AM To: 'Discussion concerning MS SQL Server' Subject: Re: [dba-SQLServer] Timeouts executing views Paul, forget I said hours. Most of them in fact run in a minute or two. Just long enough to cause the timeout. I simply need to up that timeout. Thanks, 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 Paul Nielsen Sent: Friday, February 01, 2008 10:23 AM To: 'Discussion concerning MS SQL Server' Subject: Re: [dba-SQLServer] Timeouts executing views The difference has nothing to do with the view, but how you're connecting. ADO has a built in timeout of 30 seconds, SSMS does not. And if you show me the query execution plan, I'll bet we can make it run in seconds not hours. -Paul -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, February 01, 2008 8:03 AM To: 'Discussion concerning MS SQL Server' Subject: Re: [dba-SQLServer] Timeouts executing views Paul, It isn't about how long the query takes. No I can't show you the execution plan because this happens for ANY query that takes longer than 30 seconds. I understand that you want long running views to time out, but why does a view time out and the query based on that SQL not time out? It is irritating to have to go get the sql, create a query, dump the SQL in there, then run it in order to get results. I just want to run the View and get the results. 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 Paul Nielsen Sent: Friday, February 01, 2008 9:53 AM To: 'Discussion concerning MS SQL Server' Subject: Re: [dba-SQLServer] Timeouts executing views Even of it takes hours? Can you show us the SQL and the Query Execution Plan? -Paul -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, February 01, 2008 5:55 AM To: dba-sqlserver at databaseadvisors.com Subject: [dba-SQLServer] Timeouts executing views When I try to execute a view, if results aren't returned within some short period of time (about 30 seconds) I get a timeout message. OTOH, if I copy the Sql, open a new query, paste it in and run, it will complete even if it takes hours. Does anyone know where to go to change the timeout period for views run directly? 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 __________ NOD32 2843 (20080201) Information __________ This message was checked by NOD32 antivirus system. http://www.eset.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 __________ NOD32 2844 (20080201) Information __________ This message was checked by NOD32 antivirus system. http://www.eset.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 __________ NOD32 2844 (20080201) Information __________ This message was checked by NOD32 antivirus system. http://www.eset.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 __________ NOD32 2844 (20080201) Information __________ This message was checked by NOD32 antivirus system. http://www.eset.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 __________ NOD32 2844 (20080201) Information __________ This message was checked by NOD32 antivirus system. http://www.eset.com From jwcolby at colbyconsulting.com Fri Feb 1 11:57:56 2008 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 1 Feb 2008 12:57:56 -0500 Subject: [dba-SQLServer] Timeouts executing views In-Reply-To: <002101c864f9$d49ad3d0$7dd07b70$@com> References: <000601c864d1$9f3f3000$0401a8c0@M90> <012a01c864e2$1fdaab30$5f900190$@com><001c01c864e3$850e4d80$0401a8c0@M90> <013c01c864e6$6594ded0$30be9c70$@com><002501c864e9$775a66f0$0401a8c0@M90> <002301c864ee$86d85e20$94891a60$@com><003601c864f0$0d074cd0$0401a8c0@M90> <002d01c864f2$cffac300$6ff04900$@com><003f01c864f4$34922550$0401a8c0@M90> <002101c864f9$d49ad3d0$7dd07b70$@com> Message-ID: <004b01c864fb$fa3f9920$0401a8c0@M90> navigate the dataBASE tree to the database, expand it, expand the view tree. Right click the view and open view. 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 Paul Nielsen Sent: Friday, February 01, 2008 12:43 PM To: 'Discussion concerning MS SQL Server' Subject: Re: [dba-SQLServer] Timeouts executing views How do you execute the view? Do you type "Select * from view" in a query editor and then press F5? Or Object Explorer>Highlight view>context menu>Open View? -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, February 01, 2008 10:02 AM To: 'Discussion concerning MS SQL Server' Subject: Re: [dba-SQLServer] Timeouts executing views ROTFL, I can't. I execute a view. It times out. What more can I tell you? It does so on any of my machines, I can tell you that. 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 Paul Nielsen Sent: Friday, February 01, 2008 11:52 AM To: 'Discussion concerning MS SQL Server' Subject: Re: [dba-SQLServer] Timeouts executing views SSMS times out? It shouldn't. tell me more. -Paul -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, February 01, 2008 9:33 AM To: 'Discussion concerning MS SQL Server' Subject: Re: [dba-SQLServer] Timeouts executing views I am talking about inside of SQL Server 2005 Management Studio. Beyond that I don't understand the question. 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 Paul Nielsen Sent: Friday, February 01, 2008 11:22 AM To: 'Discussion concerning MS SQL Server' Subject: Re: [dba-SQLServer] Timeouts executing views How are you connecting when using a view? -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, February 01, 2008 8:45 AM To: 'Discussion concerning MS SQL Server' Subject: Re: [dba-SQLServer] Timeouts executing views Paul, forget I said hours. Most of them in fact run in a minute or two. Just long enough to cause the timeout. I simply need to up that timeout. Thanks, 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 Paul Nielsen Sent: Friday, February 01, 2008 10:23 AM To: 'Discussion concerning MS SQL Server' Subject: Re: [dba-SQLServer] Timeouts executing views The difference has nothing to do with the view, but how you're connecting. ADO has a built in timeout of 30 seconds, SSMS does not. And if you show me the query execution plan, I'll bet we can make it run in seconds not hours. -Paul -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, February 01, 2008 8:03 AM To: 'Discussion concerning MS SQL Server' Subject: Re: [dba-SQLServer] Timeouts executing views Paul, It isn't about how long the query takes. No I can't show you the execution plan because this happens for ANY query that takes longer than 30 seconds. I understand that you want long running views to time out, but why does a view time out and the query based on that SQL not time out? It is irritating to have to go get the sql, create a query, dump the SQL in there, then run it in order to get results. I just want to run the View and get the results. 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 Paul Nielsen Sent: Friday, February 01, 2008 9:53 AM To: 'Discussion concerning MS SQL Server' Subject: Re: [dba-SQLServer] Timeouts executing views Even of it takes hours? Can you show us the SQL and the Query Execution Plan? -Paul -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, February 01, 2008 5:55 AM To: dba-sqlserver at databaseadvisors.com Subject: [dba-SQLServer] Timeouts executing views When I try to execute a view, if results aren't returned within some short period of time (about 30 seconds) I get a timeout message. OTOH, if I copy the Sql, open a new query, paste it in and run, it will complete even if it takes hours. Does anyone know where to go to change the timeout period for views run directly? 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 __________ NOD32 2843 (20080201) Information __________ This message was checked by NOD32 antivirus system. http://www.eset.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 __________ NOD32 2844 (20080201) Information __________ This message was checked by NOD32 antivirus system. http://www.eset.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 __________ NOD32 2844 (20080201) Information __________ This message was checked by NOD32 antivirus system. http://www.eset.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 __________ NOD32 2844 (20080201) Information __________ This message was checked by NOD32 antivirus system. http://www.eset.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 __________ NOD32 2844 (20080201) Information __________ This message was checked by NOD32 antivirus system. http://www.eset.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 Feb 1 12:03:55 2008 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 1 Feb 2008 13:03:55 -0500 Subject: [dba-SQLServer] Timeouts executing views In-Reply-To: <002101c864f9$d49ad3d0$7dd07b70$@com> References: <000601c864d1$9f3f3000$0401a8c0@M90> <012a01c864e2$1fdaab30$5f900190$@com><001c01c864e3$850e4d80$0401a8c0@M90> <013c01c864e6$6594ded0$30be9c70$@com><002501c864e9$775a66f0$0401a8c0@M90> <002301c864ee$86d85e20$94891a60$@com><003601c864f0$0d074cd0$0401a8c0@M90> <002d01c864f2$cffac300$6ff04900$@com><003f01c864f4$34922550$0401a8c0@M90> <002101c864f9$d49ad3d0$7dd07b70$@com> Message-ID: <004c01c864fc$cff0cc60$0401a8c0@M90> Paul, I just ran a count PK group by income band on 50 million records. It took 2:53 to complete and returned 31 records. There are "cover queries on all necessary fields etc. and I am quite happy with the time it takes, although of course faster is always better. ;-) Since it will time out in under 30 seconds if I try to just run the view, I have to do the whole "get Sql / open query / paste / execute" thing when I should just be able to run the view. 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 Paul Nielsen Sent: Friday, February 01, 2008 12:43 PM To: 'Discussion concerning MS SQL Server' Subject: Re: [dba-SQLServer] Timeouts executing views How do you execute the view? Do you type "Select * from view" in a query editor and then press F5? Or Object Explorer>Highlight view>context menu>Open View? -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, February 01, 2008 10:02 AM To: 'Discussion concerning MS SQL Server' Subject: Re: [dba-SQLServer] Timeouts executing views ROTFL, I can't. I execute a view. It times out. What more can I tell you? It does so on any of my machines, I can tell you that. 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 Paul Nielsen Sent: Friday, February 01, 2008 11:52 AM To: 'Discussion concerning MS SQL Server' Subject: Re: [dba-SQLServer] Timeouts executing views SSMS times out? It shouldn't. tell me more. -Paul -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, February 01, 2008 9:33 AM To: 'Discussion concerning MS SQL Server' Subject: Re: [dba-SQLServer] Timeouts executing views I am talking about inside of SQL Server 2005 Management Studio. Beyond that I don't understand the question. 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 Paul Nielsen Sent: Friday, February 01, 2008 11:22 AM To: 'Discussion concerning MS SQL Server' Subject: Re: [dba-SQLServer] Timeouts executing views How are you connecting when using a view? -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, February 01, 2008 8:45 AM To: 'Discussion concerning MS SQL Server' Subject: Re: [dba-SQLServer] Timeouts executing views Paul, forget I said hours. Most of them in fact run in a minute or two. Just long enough to cause the timeout. I simply need to up that timeout. Thanks, 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 Paul Nielsen Sent: Friday, February 01, 2008 10:23 AM To: 'Discussion concerning MS SQL Server' Subject: Re: [dba-SQLServer] Timeouts executing views The difference has nothing to do with the view, but how you're connecting. ADO has a built in timeout of 30 seconds, SSMS does not. And if you show me the query execution plan, I'll bet we can make it run in seconds not hours. -Paul -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, February 01, 2008 8:03 AM To: 'Discussion concerning MS SQL Server' Subject: Re: [dba-SQLServer] Timeouts executing views Paul, It isn't about how long the query takes. No I can't show you the execution plan because this happens for ANY query that takes longer than 30 seconds. I understand that you want long running views to time out, but why does a view time out and the query based on that SQL not time out? It is irritating to have to go get the sql, create a query, dump the SQL in there, then run it in order to get results. I just want to run the View and get the results. 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 Paul Nielsen Sent: Friday, February 01, 2008 9:53 AM To: 'Discussion concerning MS SQL Server' Subject: Re: [dba-SQLServer] Timeouts executing views Even of it takes hours? Can you show us the SQL and the Query Execution Plan? -Paul -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, February 01, 2008 5:55 AM To: dba-sqlserver at databaseadvisors.com Subject: [dba-SQLServer] Timeouts executing views When I try to execute a view, if results aren't returned within some short period of time (about 30 seconds) I get a timeout message. OTOH, if I copy the Sql, open a new query, paste it in and run, it will complete even if it takes hours. Does anyone know where to go to change the timeout period for views run directly? 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 __________ NOD32 2843 (20080201) Information __________ This message was checked by NOD32 antivirus system. http://www.eset.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 __________ NOD32 2844 (20080201) Information __________ This message was checked by NOD32 antivirus system. http://www.eset.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 __________ NOD32 2844 (20080201) Information __________ This message was checked by NOD32 antivirus system. http://www.eset.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 __________ NOD32 2844 (20080201) Information __________ This message was checked by NOD32 antivirus system. http://www.eset.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 __________ NOD32 2844 (20080201) Information __________ This message was checked by NOD32 antivirus system. http://www.eset.com _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From pauln at sqlserverbible.com Fri Feb 1 12:29:10 2008 From: pauln at sqlserverbible.com (Paul Nielsen) Date: Fri, 1 Feb 2008 11:29:10 -0700 Subject: [dba-SQLServer] Timeouts executing views In-Reply-To: <004c01c864fc$cff0cc60$0401a8c0@M90> References: <000601c864d1$9f3f3000$0401a8c0@M90> <012a01c864e2$1fdaab30$5f900190$@com><001c01c864e3$850e4d80$0401a8c0@M90> <013c01c864e6$6594ded0$30be9c70$@com><002501c864e9$775a66f0$0401a8c0@M90> <002301c864ee$86d85e20$94891a60$@com><003601c864f0$0d074cd0$0401a8c0@M90> <002d01c864f2$cffac300$6ff04900$@com><003f01c864f4$34922550$0401a8c0@M90> <002101c864f9$d49ad3d0$7dd07b70$@com> <004c01c864fc$cff0cc60$0401a8c0@M90> Message-ID: <004601c86500$5764ac40$062e04c0$@com> Just 'New Query' and type 'Select * from ViewName' I never ever open an object or execute from Object Explorer. -Paul -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, February 01, 2008 11:04 AM To: 'Discussion concerning MS SQL Server' Subject: Re: [dba-SQLServer] Timeouts executing views Paul, I just ran a count PK group by income band on 50 million records. It took 2:53 to complete and returned 31 records. There are "cover queries on all necessary fields etc. and I am quite happy with the time it takes, although of course faster is always better. ;-) Since it will time out in under 30 seconds if I try to just run the view, I have to do the whole "get Sql / open query / paste / execute" thing when I should just be able to run the view. 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 Paul Nielsen Sent: Friday, February 01, 2008 12:43 PM To: 'Discussion concerning MS SQL Server' Subject: Re: [dba-SQLServer] Timeouts executing views How do you execute the view? Do you type "Select * from view" in a query editor and then press F5? Or Object Explorer>Highlight view>context menu>Open View? -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, February 01, 2008 10:02 AM To: 'Discussion concerning MS SQL Server' Subject: Re: [dba-SQLServer] Timeouts executing views ROTFL, I can't. I execute a view. It times out. What more can I tell you? It does so on any of my machines, I can tell you that. 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 Paul Nielsen Sent: Friday, February 01, 2008 11:52 AM To: 'Discussion concerning MS SQL Server' Subject: Re: [dba-SQLServer] Timeouts executing views SSMS times out? It shouldn't. tell me more. -Paul -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, February 01, 2008 9:33 AM To: 'Discussion concerning MS SQL Server' Subject: Re: [dba-SQLServer] Timeouts executing views I am talking about inside of SQL Server 2005 Management Studio. Beyond that I don't understand the question. 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 Paul Nielsen Sent: Friday, February 01, 2008 11:22 AM To: 'Discussion concerning MS SQL Server' Subject: Re: [dba-SQLServer] Timeouts executing views How are you connecting when using a view? -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, February 01, 2008 8:45 AM To: 'Discussion concerning MS SQL Server' Subject: Re: [dba-SQLServer] Timeouts executing views Paul, forget I said hours. Most of them in fact run in a minute or two. Just long enough to cause the timeout. I simply need to up that timeout. Thanks, 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 Paul Nielsen Sent: Friday, February 01, 2008 10:23 AM To: 'Discussion concerning MS SQL Server' Subject: Re: [dba-SQLServer] Timeouts executing views The difference has nothing to do with the view, but how you're connecting. ADO has a built in timeout of 30 seconds, SSMS does not. And if you show me the query execution plan, I'll bet we can make it run in seconds not hours. -Paul -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, February 01, 2008 8:03 AM To: 'Discussion concerning MS SQL Server' Subject: Re: [dba-SQLServer] Timeouts executing views Paul, It isn't about how long the query takes. No I can't show you the execution plan because this happens for ANY query that takes longer than 30 seconds. I understand that you want long running views to time out, but why does a view time out and the query based on that SQL not time out? It is irritating to have to go get the sql, create a query, dump the SQL in there, then run it in order to get results. I just want to run the View and get the results. 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 Paul Nielsen Sent: Friday, February 01, 2008 9:53 AM To: 'Discussion concerning MS SQL Server' Subject: Re: [dba-SQLServer] Timeouts executing views Even of it takes hours? Can you show us the SQL and the Query Execution Plan? -Paul -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, February 01, 2008 5:55 AM To: dba-sqlserver at databaseadvisors.com Subject: [dba-SQLServer] Timeouts executing views When I try to execute a view, if results aren't returned within some short period of time (about 30 seconds) I get a timeout message. OTOH, if I copy the Sql, open a new query, paste it in and run, it will complete even if it takes hours. Does anyone know where to go to change the timeout period for views run directly? 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 __________ NOD32 2843 (20080201) Information __________ This message was checked by NOD32 antivirus system. http://www.eset.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 __________ NOD32 2844 (20080201) Information __________ This message was checked by NOD32 antivirus system. http://www.eset.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 __________ NOD32 2844 (20080201) Information __________ This message was checked by NOD32 antivirus system. http://www.eset.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 __________ NOD32 2844 (20080201) Information __________ This message was checked by NOD32 antivirus system. http://www.eset.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 __________ NOD32 2844 (20080201) Information __________ This message was checked by NOD32 antivirus system. http://www.eset.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 __________ NOD32 2844 (20080201) Information __________ This message was checked by NOD32 antivirus system. http://www.eset.com From jwcolby at colbyconsulting.com Fri Feb 1 12:36:49 2008 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 1 Feb 2008 13:36:49 -0500 Subject: [dba-SQLServer] Timeouts executing views In-Reply-To: <004601c86500$5764ac40$062e04c0$@com> References: <000601c864d1$9f3f3000$0401a8c0@M90> <012a01c864e2$1fdaab30$5f900190$@com><001c01c864e3$850e4d80$0401a8c0@M90> <013c01c864e6$6594ded0$30be9c70$@com><002501c864e9$775a66f0$0401a8c0@M90> <002301c864ee$86d85e20$94891a60$@com><003601c864f0$0d074cd0$0401a8c0@M90> <002d01c864f2$cffac300$6ff04900$@com><003f01c864f4$34922550$0401a8c0@M90> <002101c864f9$d49ad3d0$7dd07b70$@com><004c01c864fc$cff0cc60$0401a8c0@M90> <004601c86500$5764ac40$062e04c0$@com> Message-ID: <004e01c86501$68c012d0$0401a8c0@M90> well, thanks for that anyway. It sure makes sense. No help with the timeout value though eh? 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 Paul Nielsen Sent: Friday, February 01, 2008 1:29 PM To: 'Discussion concerning MS SQL Server' Subject: Re: [dba-SQLServer] Timeouts executing views Just 'New Query' and type 'Select * from ViewName' I never ever open an object or execute from Object Explorer. -Paul -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, February 01, 2008 11:04 AM To: 'Discussion concerning MS SQL Server' Subject: Re: [dba-SQLServer] Timeouts executing views Paul, I just ran a count PK group by income band on 50 million records. It took 2:53 to complete and returned 31 records. There are "cover queries on all necessary fields etc. and I am quite happy with the time it takes, although of course faster is always better. ;-) Since it will time out in under 30 seconds if I try to just run the view, I have to do the whole "get Sql / open query / paste / execute" thing when I should just be able to run the view. 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 Paul Nielsen Sent: Friday, February 01, 2008 12:43 PM To: 'Discussion concerning MS SQL Server' Subject: Re: [dba-SQLServer] Timeouts executing views How do you execute the view? Do you type "Select * from view" in a query editor and then press F5? Or Object Explorer>Highlight view>context menu>Open View? -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, February 01, 2008 10:02 AM To: 'Discussion concerning MS SQL Server' Subject: Re: [dba-SQLServer] Timeouts executing views ROTFL, I can't. I execute a view. It times out. What more can I tell you? It does so on any of my machines, I can tell you that. 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 Paul Nielsen Sent: Friday, February 01, 2008 11:52 AM To: 'Discussion concerning MS SQL Server' Subject: Re: [dba-SQLServer] Timeouts executing views SSMS times out? It shouldn't. tell me more. -Paul -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, February 01, 2008 9:33 AM To: 'Discussion concerning MS SQL Server' Subject: Re: [dba-SQLServer] Timeouts executing views I am talking about inside of SQL Server 2005 Management Studio. Beyond that I don't understand the question. 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 Paul Nielsen Sent: Friday, February 01, 2008 11:22 AM To: 'Discussion concerning MS SQL Server' Subject: Re: [dba-SQLServer] Timeouts executing views How are you connecting when using a view? -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, February 01, 2008 8:45 AM To: 'Discussion concerning MS SQL Server' Subject: Re: [dba-SQLServer] Timeouts executing views Paul, forget I said hours. Most of them in fact run in a minute or two. Just long enough to cause the timeout. I simply need to up that timeout. Thanks, 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 Paul Nielsen Sent: Friday, February 01, 2008 10:23 AM To: 'Discussion concerning MS SQL Server' Subject: Re: [dba-SQLServer] Timeouts executing views The difference has nothing to do with the view, but how you're connecting. ADO has a built in timeout of 30 seconds, SSMS does not. And if you show me the query execution plan, I'll bet we can make it run in seconds not hours. -Paul -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, February 01, 2008 8:03 AM To: 'Discussion concerning MS SQL Server' Subject: Re: [dba-SQLServer] Timeouts executing views Paul, It isn't about how long the query takes. No I can't show you the execution plan because this happens for ANY query that takes longer than 30 seconds. I understand that you want long running views to time out, but why does a view time out and the query based on that SQL not time out? It is irritating to have to go get the sql, create a query, dump the SQL in there, then run it in order to get results. I just want to run the View and get the results. 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 Paul Nielsen Sent: Friday, February 01, 2008 9:53 AM To: 'Discussion concerning MS SQL Server' Subject: Re: [dba-SQLServer] Timeouts executing views Even of it takes hours? Can you show us the SQL and the Query Execution Plan? -Paul -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, February 01, 2008 5:55 AM To: dba-sqlserver at databaseadvisors.com Subject: [dba-SQLServer] Timeouts executing views When I try to execute a view, if results aren't returned within some short period of time (about 30 seconds) I get a timeout message. OTOH, if I copy the Sql, open a new query, paste it in and run, it will complete even if it takes hours. Does anyone know where to go to change the timeout period for views run directly? 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 __________ NOD32 2843 (20080201) Information __________ This message was checked by NOD32 antivirus system. http://www.eset.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 __________ NOD32 2844 (20080201) Information __________ This message was checked by NOD32 antivirus system. http://www.eset.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 __________ NOD32 2844 (20080201) Information __________ This message was checked by NOD32 antivirus system. http://www.eset.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 __________ NOD32 2844 (20080201) Information __________ This message was checked by NOD32 antivirus system. http://www.eset.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 __________ NOD32 2844 (20080201) Information __________ This message was checked by NOD32 antivirus system. http://www.eset.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 __________ NOD32 2844 (20080201) Information __________ This message was checked by NOD32 antivirus system. http://www.eset.com _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From pauln at sqlserverbible.com Fri Feb 1 12:43:13 2008 From: pauln at sqlserverbible.com (Paul Nielsen) Date: Fri, 1 Feb 2008 11:43:13 -0700 Subject: [dba-SQLServer] Timeouts executing views In-Reply-To: <004e01c86501$68c012d0$0401a8c0@M90> References: <000601c864d1$9f3f3000$0401a8c0@M90> <012a01c864e2$1fdaab30$5f900190$@com><001c01c864e3$850e4d80$0401a8c0@M90> <013c01c864e6$6594ded0$30be9c70$@com><002501c864e9$775a66f0$0401a8c0@M90> <002301c864ee$86d85e20$94891a60$@com><003601c864f0$0d074cd0$0401a8c0@M90> <002d01c864f2$cffac300$6ff04900$@com><003f01c864f4$34922550$0401a8c0@M90> <002101c864f9$d49ad3d0$7dd07b70$@com><004c01c864fc$cff0cc60$0401a8c0@M90> <004601c86500$5764ac40$062e04c0$@com> <004e01c86501$68c012d0$0401a8c0@M90> Message-ID: <000901c86502$4db66c40$e92344c0$@com> I know that ADO has a default timeout of 30 seconds. My guess is that SSMS is using an ADO call in Query Designer (the tool opened when you Open View from OE) to limit opening huge queries in the UI. Query Editor is a cleaner connection. -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, February 01, 2008 11:37 AM To: 'Discussion concerning MS SQL Server' Subject: Re: [dba-SQLServer] Timeouts executing views well, thanks for that anyway. It sure makes sense. No help with the timeout value though eh? 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 Paul Nielsen Sent: Friday, February 01, 2008 1:29 PM To: 'Discussion concerning MS SQL Server' Subject: Re: [dba-SQLServer] Timeouts executing views Just 'New Query' and type 'Select * from ViewName' I never ever open an object or execute from Object Explorer. -Paul -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, February 01, 2008 11:04 AM To: 'Discussion concerning MS SQL Server' Subject: Re: [dba-SQLServer] Timeouts executing views Paul, I just ran a count PK group by income band on 50 million records. It took 2:53 to complete and returned 31 records. There are "cover queries on all necessary fields etc. and I am quite happy with the time it takes, although of course faster is always better. ;-) Since it will time out in under 30 seconds if I try to just run the view, I have to do the whole "get Sql / open query / paste / execute" thing when I should just be able to run the view. 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 Paul Nielsen Sent: Friday, February 01, 2008 12:43 PM To: 'Discussion concerning MS SQL Server' Subject: Re: [dba-SQLServer] Timeouts executing views How do you execute the view? Do you type "Select * from view" in a query editor and then press F5? Or Object Explorer>Highlight view>context menu>Open View? -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, February 01, 2008 10:02 AM To: 'Discussion concerning MS SQL Server' Subject: Re: [dba-SQLServer] Timeouts executing views ROTFL, I can't. I execute a view. It times out. What more can I tell you? It does so on any of my machines, I can tell you that. 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 Paul Nielsen Sent: Friday, February 01, 2008 11:52 AM To: 'Discussion concerning MS SQL Server' Subject: Re: [dba-SQLServer] Timeouts executing views SSMS times out? It shouldn't. tell me more. -Paul -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, February 01, 2008 9:33 AM To: 'Discussion concerning MS SQL Server' Subject: Re: [dba-SQLServer] Timeouts executing views I am talking about inside of SQL Server 2005 Management Studio. Beyond that I don't understand the question. 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 Paul Nielsen Sent: Friday, February 01, 2008 11:22 AM To: 'Discussion concerning MS SQL Server' Subject: Re: [dba-SQLServer] Timeouts executing views How are you connecting when using a view? -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, February 01, 2008 8:45 AM To: 'Discussion concerning MS SQL Server' Subject: Re: [dba-SQLServer] Timeouts executing views Paul, forget I said hours. Most of them in fact run in a minute or two. Just long enough to cause the timeout. I simply need to up that timeout. Thanks, 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 Paul Nielsen Sent: Friday, February 01, 2008 10:23 AM To: 'Discussion concerning MS SQL Server' Subject: Re: [dba-SQLServer] Timeouts executing views The difference has nothing to do with the view, but how you're connecting. ADO has a built in timeout of 30 seconds, SSMS does not. And if you show me the query execution plan, I'll bet we can make it run in seconds not hours. -Paul -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, February 01, 2008 8:03 AM To: 'Discussion concerning MS SQL Server' Subject: Re: [dba-SQLServer] Timeouts executing views Paul, It isn't about how long the query takes. No I can't show you the execution plan because this happens for ANY query that takes longer than 30 seconds. I understand that you want long running views to time out, but why does a view time out and the query based on that SQL not time out? It is irritating to have to go get the sql, create a query, dump the SQL in there, then run it in order to get results. I just want to run the View and get the results. 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 Paul Nielsen Sent: Friday, February 01, 2008 9:53 AM To: 'Discussion concerning MS SQL Server' Subject: Re: [dba-SQLServer] Timeouts executing views Even of it takes hours? Can you show us the SQL and the Query Execution Plan? -Paul -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Friday, February 01, 2008 5:55 AM To: dba-sqlserver at databaseadvisors.com Subject: [dba-SQLServer] Timeouts executing views When I try to execute a view, if results aren't returned within some short period of time (about 30 seconds) I get a timeout message. OTOH, if I copy the Sql, open a new query, paste it in and run, it will complete even if it takes hours. Does anyone know where to go to change the timeout period for views run directly? 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 __________ NOD32 2843 (20080201) Information __________ This message was checked by NOD32 antivirus system. http://www.eset.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 __________ NOD32 2844 (20080201) Information __________ This message was checked by NOD32 antivirus system. http://www.eset.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 __________ NOD32 2844 (20080201) Information __________ This message was checked by NOD32 antivirus system. http://www.eset.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 __________ NOD32 2844 (20080201) Information __________ This message was checked by NOD32 antivirus system. http://www.eset.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 __________ NOD32 2844 (20080201) Information __________ This message was checked by NOD32 antivirus system. http://www.eset.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 __________ NOD32 2844 (20080201) Information __________ This message was checked by NOD32 antivirus system. http://www.eset.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 __________ NOD32 2844 (20080201) Information __________ This message was checked by NOD32 antivirus system. http://www.eset.com From robert at webedb.com Fri Feb 1 13:36:10 2008 From: robert at webedb.com (Robert L. Stewart) Date: Fri, 01 Feb 2008 13:36:10 -0600 Subject: [dba-SQLServer] Timeouts executing views In-Reply-To: References: Message-ID: <200802011940.m11Je8un028350@databaseadvisors.com> There is not one that is accessible from the user interface. I've looked everywhere for it. At 12:36 PM 2/1/2008, you wrote: >Date: Fri, 1 Feb 2008 13:36:49 -0500 >From: "jwcolby" >Subject: Re: [dba-SQLServer] Timeouts executing views >To: "'Discussion concerning MS SQL Server'" > >Message-ID: <004e01c86501$68c012d0$0401a8c0 at M90> >Content-Type: text/plain; charset="us-ascii" > >well, thanks for that anyway. It sure makes sense. No help with the >timeout value though eh? > > >John W. Colby From pauln at sqlserverbible.com Fri Feb 1 14:32:13 2008 From: pauln at sqlserverbible.com (Paul Nielsen) Date: Fri, 1 Feb 2008 13:32:13 -0700 Subject: [dba-SQLServer] Timeouts executing views In-Reply-To: <200802011940.m11Je8un028350@databaseadvisors.com> References: <200802011940.m11Je8un028350@databaseadvisors.com> Message-ID: <002a01c86511$87e684e0$97b38ea0$@com> Try Options menu > Designers page > Override OR Transaction Time-out It should be only for the table / database designer, but maybe the Query Designer uses it too. -Paul -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Robert L. Stewart Sent: Friday, February 01, 2008 12:36 PM To: dba-sqlserver at databaseadvisors.com Subject: Re: [dba-SQLServer] Timeouts executing views There is not one that is accessible from the user interface. I've looked everywhere for it. At 12:36 PM 2/1/2008, you wrote: >Date: Fri, 1 Feb 2008 13:36:49 -0500 >From: "jwcolby" >Subject: Re: [dba-SQLServer] Timeouts executing views >To: "'Discussion concerning MS SQL Server'" > >Message-ID: <004e01c86501$68c012d0$0401a8c0 at M90> >Content-Type: text/plain; charset="us-ascii" > >well, thanks for that anyway. It sure makes sense. No help with the >timeout value though eh? > > >John W. Colby _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com __________ NOD32 2844 (20080201) Information __________ This message was checked by NOD32 antivirus system. http://www.eset.com From pauln at sqlserverbible.com Fri Feb 1 14:32:43 2008 From: pauln at sqlserverbible.com (Paul Nielsen) Date: Fri, 1 Feb 2008 13:32:43 -0700 Subject: [dba-SQLServer] Katami In-Reply-To: <200802011940.m11Je8un028350@databaseadvisors.com> References: <200802011940.m11Je8un028350@databaseadvisors.com> Message-ID: <002b01c86511$99c67a30$cd536e90$@com> Anyone on this list playing with Katmai? From fuller.artful at gmail.com Fri Feb 1 14:40:38 2008 From: fuller.artful at gmail.com (Arthur Fuller) Date: Fri, 1 Feb 2008 15:40:38 -0500 Subject: [dba-SQLServer] Katami In-Reply-To: <002b01c86511$99c67a30$cd536e90$@com> References: <200802011940.m11Je8un028350@databaseadvisors.com> <002b01c86511$99c67a30$cd536e90$@com> Message-ID: <29f585dd0802011240j39f4654fkd1ac62dfe38f4c50@mail.gmail.com> It's now SQL 2008. And yes, but only occasionally, until Feb. 27 when I attend the launch and get three new packages: VS 2008, SQL 2008 and Windows Server 2008. Toys toys toys for the boys... (and girls, too, should they attend). A. On Fri, Feb 1, 2008 at 3:32 PM, Paul Nielsen wrote: > Anyone on this list playing with Katmai? > > From dwaters at usinternet.com Fri Feb 1 15:00:31 2008 From: dwaters at usinternet.com (Dan Waters) Date: Fri, 1 Feb 2008 15:00:31 -0600 Subject: [dba-SQLServer] Katami In-Reply-To: <29f585dd0802011240j39f4654fkd1ac62dfe38f4c50@mail.gmail.com> References: <200802011940.m11Je8un028350@databaseadvisors.com><002b01c86511$99c67a30$cd536e90$@com> <29f585dd0802011240j39f4654fkd1ac62dfe38f4c50@mail.gmail.com> Message-ID: <001d01c86515$7b90e0b0$0300a8c0@danwaters> I got an invitation to that launch, but no mention of free software. I'll have to look again. Dan -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Arthur Fuller Sent: Friday, February 01, 2008 2:41 PM To: Discussion concerning MS SQL Server Subject: Re: [dba-SQLServer] Katami It's now SQL 2008. And yes, but only occasionally, until Feb. 27 when I attend the launch and get three new packages: VS 2008, SQL 2008 and Windows Server 2008. Toys toys toys for the boys... (and girls, too, should they attend). A. On Fri, Feb 1, 2008 at 3:32 PM, Paul Nielsen wrote: > Anyone on this list playing with Katmai? > > _______________________________________________ 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 Feb 1 16:31:12 2008 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 1 Feb 2008 17:31:12 -0500 Subject: [dba-SQLServer] Katami In-Reply-To: <29f585dd0802011240j39f4654fkd1ac62dfe38f4c50@mail.gmail.com> References: <200802011940.m11Je8un028350@databaseadvisors.com><002b01c86511$99c67a30$cd536e90$@com> <29f585dd0802011240j39f4654fkd1ac62dfe38f4c50@mail.gmail.com> Message-ID: <000301c86522$26a01d20$0401a8c0@M90> Thanks for bringing this to my attention. I just signed up for the one in my area, unfortunately out in April. 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 Arthur Fuller Sent: Friday, February 01, 2008 3:41 PM To: Discussion concerning MS SQL Server Subject: Re: [dba-SQLServer] Katami It's now SQL 2008. And yes, but only occasionally, until Feb. 27 when I attend the launch and get three new packages: VS 2008, SQL 2008 and Windows Server 2008. Toys toys toys for the boys... (and girls, too, should they attend). A. On Fri, Feb 1, 2008 at 3:32 PM, Paul Nielsen wrote: > Anyone on this list playing with Katmai? > > _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From pauln at sqlserverbible.com Fri Feb 1 16:37:46 2008 From: pauln at sqlserverbible.com (Paul Nielsen) Date: Fri, 1 Feb 2008 15:37:46 -0700 Subject: [dba-SQLServer] Katami In-Reply-To: <001d01c86515$7b90e0b0$0300a8c0@danwaters> References: <200802011940.m11Je8un028350@databaseadvisors.com><002b01c86511$99c67a30$cd536e90$@com> <29f585dd0802011240j39f4654fkd1ac62dfe38f4c50@mail.gmail.com> <001d01c86515$7b90e0b0$0300a8c0@danwaters> Message-ID: <003e01c86523$11c9fcd0$355df670$@com> Katmai RTM isn't until Q3. -Paul -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Dan Waters Sent: Friday, February 01, 2008 2:01 PM To: 'Discussion concerning MS SQL Server' Subject: Re: [dba-SQLServer] Katami I got an invitation to that launch, but no mention of free software. I'll have to look again. Dan -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Arthur Fuller Sent: Friday, February 01, 2008 2:41 PM To: Discussion concerning MS SQL Server Subject: Re: [dba-SQLServer] Katami It's now SQL 2008. And yes, but only occasionally, until Feb. 27 when I attend the launch and get three new packages: VS 2008, SQL 2008 and Windows Server 2008. Toys toys toys for the boys... (and girls, too, should they attend). A. On Fri, Feb 1, 2008 at 3:32 PM, Paul Nielsen wrote: > Anyone on this list playing with Katmai? > > _______________________________________________ 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 __________ NOD32 2844 (20080201) Information __________ This message was checked by NOD32 antivirus system. http://www.eset.com From ssharkins at gmail.com Sat Feb 2 09:39:35 2008 From: ssharkins at gmail.com (Susan Harkins) Date: Sat, 2 Feb 2008 10:39:35 -0500 Subject: [dba-SQLServer] hotkeys Message-ID: <006d01c865b1$d17ee430$4b3a8343@SusanOne> =====The only one I tried was Ctrl+4 for selecting the top 100 records in the highlighted table, but I'm positive I haven't downloaded the sp for SQL Server Express, so that's probably why it doesn't work for me. Anyone know if you can define your own hotkeys? I've been looking, but can't find anything on that. Susan H. From markamatte at hotmail.com Sat Feb 2 09:54:31 2008 From: markamatte at hotmail.com (Mark A Matte) Date: Sat, 2 Feb 2008 15:54:31 +0000 Subject: [dba-SQLServer] hotkeys In-Reply-To: <006d01c865b1$d17ee430$4b3a8343@SusanOne> References: <006d01c865b1$d17ee430$4b3a8343@SusanOne> Message-ID: Susan, Just got an email from 'database weekly' that had a link...I think one of these should get you there...but I will forward the email offlist. http://www.sqlservercentral.com/links/549101/27438 http://sqlblog.com/blogs/kalen_delaney/archive/2008/01/27/did-you-know-you-can-define-your-own-hotkeys.aspx Good luck, Mark A. Matte > From: ssharkins at gmail.com > To: dba-SQLServer at databaseadvisors.com > Date: Sat, 2 Feb 2008 10:39:35 -0500 > Subject: [dba-SQLServer] hotkeys > > > > =====The only one I tried was Ctrl+4 for selecting the top 100 records in > the highlighted table, but I'm positive I haven't downloaded the sp for SQL > Server Express, so that's probably why it doesn't work for me. > > Anyone know if you can define your own hotkeys? I've been looking, but can't > find anything on that. > > Susan H. > > _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com > _________________________________________________________________ Climb to the top of the charts!?Play the word scramble challenge with star power. http://club.live.com/star_shuffle.aspx?icid=starshuffle_wlmailtextlink_jan From ssharkins at gmail.com Sat Feb 2 10:00:36 2008 From: ssharkins at gmail.com (Susan Harkins) Date: Sat, 2 Feb 2008 11:00:36 -0500 Subject: [dba-SQLServer] hotkeys References: <006d01c865b1$d17ee430$4b3a8343@SusanOne> Message-ID: <007e01c865b4$c77fcfa0$4b3a8343@SusanOne> I've already read that one -- she never tells how to define a hotkey, just explains what some of the predefined ones do. I think the title of that one's misleading. Susan H. Susan, Just got an email from 'database weekly' that had a link...I think one of these should get you there...but I will forward the email offlist. http://www.sqlservercentral.com/links/549101/27438 http://sqlblog.com/blogs/kalen_delaney/archive/2008/01/27/did-you-know-you-can-define-your-own-hotkeys.aspx Good luck, Mark A. Matte > From: ssharkins at gmail.com > To: dba-SQLServer at databaseadvisors.com > Date: Sat, 2 Feb 2008 10:39:35 -0500 > Subject: [dba-SQLServer] hotkeys > > > > =====The only one I tried was Ctrl+4 for selecting the top 100 records in > the highlighted table, but I'm positive I haven't downloaded the sp for > SQL > Server Express, so that's probably why it doesn't work for me. > > Anyone know if you can define your own hotkeys? I've been looking, but > can't > find anything on that. > > Susan H. > > _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com > _________________________________________________________________ Climb to the top of the charts! Play the word scramble challenge with star power. http://club.live.com/star_shuffle.aspx?icid=starshuffle_wlmailtextlink_jan _______________________________________________ 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 Feb 2 10:47:53 2008 From: jwcolby at colbyconsulting.com (jwcolby) Date: Sat, 2 Feb 2008 11:47:53 -0500 Subject: [dba-SQLServer] SQL Server Pivot Message-ID: <001101c865bb$5b31a8d0$0401a8c0@M90> I have a bunch of columns that break out ages into bands. For example: Presence_of_adults_age_65_74_specific Presence_of_adults_age_55_64_specific Presence_of_adults_age_45_54_specific etc Each column has codes 1,2,3 I need counts of each column, for each value column Cnt1 Cnt2 Cnt3 65_74 45 3 23 55_64 103 48 211 45_54 20 1 49 etc I think the Pivot statement is going to do that for me but I can't seem to wrap my mind around the syntax. Can anyone point me to a web page that clearly explains this or simply write a SQL statement that does this? Thanks John W. Colby Colby Consulting www.ColbyConsulting.com From pauln at sqlserverbible.com Sat Feb 2 11:26:45 2008 From: pauln at sqlserverbible.com (Paul Nielsen) Date: Sat, 2 Feb 2008 10:26:45 -0700 Subject: [dba-SQLServer] SQL Server Pivot In-Reply-To: <001101c865bb$5b31a8d0$0401a8c0@M90> References: <001101c865bb$5b31a8d0$0401a8c0@M90> Message-ID: <004601c865c0$c993ec20$5cbbc460$@com> The case expression method is a easier than the pivot method and both generate the same query execution plan. This chapter code has examples of both in the code. If you want the text, the aggregating data is the sample chapter - you can download it from my site. SELECT Category, SUM(Case Region WHEN 'South' THEN Amount ELSE 0 END) AS South, SUM(Case Region WHEN 'NorthEast' THEN Amount ELSE 0 END) AS NorthEast, SUM(Case Region WHEN 'MidWest' THEN Amount ELSE 0 END) AS MidWest, SUM(Case Region WHEN 'West' THEN Amount ELSE 0 END) AS West, SUM(Amount) as Total FROM RawData GROUP BY Category ORDER BY Category The complexity you have is that you want to group by a range. If you give me some DDL and sample data, I'll help you build a subquery to put the data in ranges. -Paul www.sqlserverbible.com -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Saturday, February 02, 2008 9:48 AM To: 'Access Developers discussion and problem solving'; 'Discussion concerning MS SQL Server' Subject: [dba-SQLServer] SQL Server Pivot I have a bunch of columns that break out ages into bands. For example: Presence_of_adults_age_65_74_specific Presence_of_adults_age_55_64_specific Presence_of_adults_age_45_54_specific etc Each column has codes 1,2,3 I need counts of each column, for each value column Cnt1 Cnt2 Cnt3 65_74 45 3 23 55_64 103 48 211 45_54 20 1 49 etc I think the Pivot statement is going to do that for me but I can't seem to wrap my mind around the syntax. Can anyone point me to a web page that clearly explains this or simply write a SQL statement that does this? Thanks 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 __________ NOD32 2845 (20080202) Information __________ This message was checked by NOD32 antivirus system. http://www.eset.com From pauln at sqlserverbible.com Sat Feb 2 12:03:53 2008 From: pauln at sqlserverbible.com (Paul Nielsen) Date: Sat, 2 Feb 2008 11:03:53 -0700 Subject: [dba-SQLServer] SQL Server Pivot In-Reply-To: <001101c865bb$5b31a8d0$0401a8c0@M90> References: <001101c865bb$5b31a8d0$0401a8c0@M90> Message-ID: <006c01c865c5$f9398c00$ebaca400$@com> USE TempDB CREATE TABLE AgeCount ( Presence_of_adults_age_65_74_specific INT, Presence_of_adults_age_55_64_specific INT, Presence_of_adults_age_45_54_specific INT ) go INSERT AgeCount VALUES (1 ,2 ,3 ) INSERT AgeCount VALUES (1 ,3 ,3 ) INSERT AgeCount VALUES (1 ,2 ,2 ) INSERT AgeCount VALUES (1 ,2 ,1 ) INSERT AgeCount VALUES (2 ,1 ,2 ) INSERT AgeCount VALUES (1 ,3 ,1 ) INSERT AgeCount VALUES (2 ,2 ,2 ) INSERT AgeCount VALUES (3 ,3 ,1 ) INSERT AgeCount VALUES (2 ,2 ,1 ) INSERT AgeCount VALUES (1 ,3 ,1 ) INSERT AgeCount VALUES (2 ,3 ,1 ) -- Case Expression Method SELECT AgeRange, SUM(Case Code WHEN 1 THEN Cnt ELSE 0 END) AS Cnt1, SUM(Case Code WHEN 2 THEN Cnt ELSE 0 END) AS Cnt2, SUM(Case Code WHEN 3 THEN Cnt ELSE 0 END) AS Cnt3 FROM (SELECT '65_74' as AgeRange, Presence_of_adults_age_65_74_specific as Code, Count(*) as Cnt FROM AgeCount GROUP BY Presence_of_adults_age_65_74_specific union SELECT '55_64', Presence_of_adults_age_55_64_specific, Count(*) FROM AgeCount GROUP BY Presence_of_adults_age_55_64_specific union SELECT '45_54', Presence_of_adults_age_45_54_specific, Count(*) FROM AgeCount GROUP BY Presence_of_adults_age_45_54_specific) as Normalized GROUP BY AgeRange ORDER BY AgeRange -- Pivot Method SELECT AgeRange, [1] AS Cnt1, [2] AS Cnt2, [3] AS Cnt3 FROM (SELECT '65_74' as AgeRange, Presence_of_adults_age_65_74_specific as Code, Count(*) as Cnt FROM AgeCount GROUP BY Presence_of_adults_age_65_74_specific union SELECT '55_64', Presence_of_adults_age_55_64_specific, Count(*) FROM AgeCount GROUP BY Presence_of_adults_age_55_64_specific union SELECT '45_54', Presence_of_adults_age_45_54_specific, Count(*) FROM AgeCount GROUP BY Presence_of_adults_age_45_54_specific) as Normalized PIVOT (SUM(Cnt) FOR Code IN ([1],[2],[3]) ) as Pvt ORDER BY AgeRange HTH, -Paul -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Saturday, February 02, 2008 9:48 AM To: 'Access Developers discussion and problem solving'; 'Discussion concerning MS SQL Server' Subject: [dba-SQLServer] SQL Server Pivot I have a bunch of columns that break out ages into bands. For example: Presence_of_adults_age_65_74_specific Presence_of_adults_age_55_64_specific Presence_of_adults_age_45_54_specific etc Each column has codes 1,2,3 I need counts of each column, for each value column Cnt1 Cnt2 Cnt3 65_74 45 3 23 55_64 103 48 211 45_54 20 1 49 etc I think the Pivot statement is going to do that for me but I can't seem to wrap my mind around the syntax. Can anyone point me to a web page that clearly explains this or simply write a SQL statement that does this? Thanks 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 __________ NOD32 2845 (20080202) Information __________ This message was checked by NOD32 antivirus system. http://www.eset.com From Gustav at cactus.dk Sun Feb 3 08:00:50 2008 From: Gustav at cactus.dk (Gustav Brock) Date: Sun, 03 Feb 2008 15:00:50 +0100 Subject: [dba-SQLServer] SQL Server Pivot Message-ID: Hi John I've done this a lot in Access. 1. Create a function that returns 1, 2, 3, etc. for any age as input. 2. Use this function in the query to retrieve the formatted column name: "Ctn" & CStr(GetAgeGroup(Age)) If the client wish to adjust the groups without entering the code, store age boundaries in a table with one column having a unique index and perhaps another column with the date from which the group is valid; this allows you to adjust the groups for a future date. I guess you could create a single UDF to handle this. /gustav -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Saturday, February 02, 2008 9:48 AM To: 'Access Developers discussion and problem solving'; 'Discussion concerning MS SQL Server' Subject: [dba-SQLServer] SQL Server Pivot I have a bunch of columns that break out ages into bands. For example: Presence_of_adults_age_65_74_specific Presence_of_adults_age_55_64_specific Presence_of_adults_age_45_54_specific etc Each column has codes 1,2,3 I need counts of each column, for each value column Cnt1 Cnt2 Cnt3 65_74 45 3 23 55_64 103 48 211 45_54 20 1 49 etc I think the Pivot statement is going to do that for me but I can't seem to wrap my mind around the syntax. Can anyone point me to a web page that clearly explains this or simply write a SQL statement that does this? Thanks John W. Colby Colby Consulting www.ColbyConsulting.com From fuller.artful at gmail.com Sun Feb 3 13:19:36 2008 From: fuller.artful at gmail.com (Arthur Fuller) Date: Sun, 3 Feb 2008 14:19:36 -0500 Subject: [dba-SQLServer] Generate DDL statements from an Access db? Message-ID: <29f585dd0802031119q503a8569t272de3b68a5c2785@mail.gmail.com> Does anyone know of a program that will generate CREATE TABLE statements from an Access database? My import and export wizard seems to be broken and the disks are off-site. I would just do it by hand but several of the tables have lots of columns. TIA, Arthur From ssharkins at gmail.com Sun Feb 3 13:23:46 2008 From: ssharkins at gmail.com (Susan Harkins) Date: Sun, 3 Feb 2008 14:23:46 -0500 Subject: [dba-SQLServer] Generate DDL statements from an Access db? References: <29f585dd0802031119q503a8569t272de3b68a5c2785@mail.gmail.com> Message-ID: <002001c8669a$4df68f20$4b3a8343@SusanOne> > Does anyone know of a program that will generate CREATE TABLE statements > from an Access database? My import and export wizard seems to be broken > and > the disks are off-site. I would just do it by hand but several of the > tables > have lots of columns. =========Would the SQL View window be of any help -- I mean, you could use the design window to drag and drop, then cut and paste from the SQL View window and insert CREATE TABLE manually -- might beat a blank. Susan H. From fuller.artful at gmail.com Sun Feb 3 13:42:46 2008 From: fuller.artful at gmail.com (Arthur Fuller) Date: Sun, 3 Feb 2008 14:42:46 -0500 Subject: [dba-SQLServer] Generate DDL statements from an Access db? In-Reply-To: <002001c8669a$4df68f20$4b3a8343@SusanOne> References: <29f585dd0802031119q503a8569t272de3b68a5c2785@mail.gmail.com> <002001c8669a$4df68f20$4b3a8343@SusanOne> Message-ID: <29f585dd0802031142m595a32f4gbb0025cee479f3cb@mail.gmail.com> That's DML Susan, not DDL. (Manipulation vs. Definition.) A. On Sun, Feb 3, 2008 at 2:23 PM, Susan Harkins wrote: > > > > Does anyone know of a program that will generate CREATE TABLE statements > > from an Access database? My import and export wizard seems to be broken > > and > > the disks are off-site. I would just do it by hand but several of the > > tables > > have lots of columns. > > =========Would the SQL View window be of any help -- I mean, you could use > the design window to drag and drop, then cut and paste from the SQL View > window and insert CREATE TABLE manually -- might beat a blank. > > Susan H. > > From jwcolby at colbyconsulting.com Mon Feb 4 09:07:16 2008 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 4 Feb 2008 10:07:16 -0500 Subject: [dba-SQLServer] Changing database ownership Message-ID: <005701c8673f$a20ed220$0401a8c0@M90> I have another piece of SQL Server that I do not understand. I generally work from my laptop (M90). I open SQL Server and create a database out on one of my servers. I had two servers at the time, but I am down to one now. At the time I was creating a lot of the databases on server AZUL. Azul's motherboard died and I moved the databases off to server Stonehenge. When I try to attach the databases I get an error something to the effect "cannot attach because the user M90.jwcolby is not available". Obviously m90.jwcolby is my user on my laptop, but why doesn't it just ask me for my username / password or something? And how do I change the ownership to Stonehenge.user or something like that? Do I even want to do so? To make matters even stranger, the attach works! So I am able to continue truckin on but it is just one of those "panic moments" when I think that I am going to be locked out of my database. Does anyone have an English language explanation of what is happening, why, and how to cause it to go away? John W. Colby Colby Consulting www.ColbyConsulting.com From fuller.artful at gmail.com Mon Feb 4 09:19:00 2008 From: fuller.artful at gmail.com (Arthur Fuller) Date: Mon, 4 Feb 2008 10:19:00 -0500 Subject: [dba-SQLServer] Changing database ownership In-Reply-To: <005701c8673f$a20ed220$0401a8c0@M90> References: <005701c8673f$a20ed220$0401a8c0@M90> Message-ID: <29f585dd0802040719q7a7149c1ob2faa4b874cc689@mail.gmail.com> I have had similar problems, JC, and I don't quite understand why and how to fix it easily. I do however have a work-around that seems to work. Inelegant, I know, but if it works, it works, until some bolt of insight strikes me. 1. Create a new database. Check that it is sound by opening the database diagrams node on said database. It will either tell you that the stuff is not installed and ask if you want to install it (This is good), or it will tell you that you aren't the owner. 2. Assuming you are the owner, then use the Import Wizard to grab all the data, sprocs, views, etc. from the other database and import them into the newly created one. After that, you can safely delete the old database. A. P.S. Supposedly there is a simple system stored procedure to let you change the ownership but I've had problems with it. Thus I experimented and came up with the recipe above. On Mon, Feb 4, 2008 at 10:07 AM, jwcolby wrote: > I have another piece of SQL Server that I do not understand. I generally > work from my laptop (M90). I open SQL Server and create a database out on > one of my servers. I had two servers at the time, but I am down to one > now. > At the time I was creating a lot of the databases on server AZUL. Azul's > motherboard died and I moved the databases off to server Stonehenge. When > I > try to attach the databases I get an error something to the effect "cannot > attach because the user M90.jwcolby is not available". Obviously > m90.jwcolby is my user on my laptop, but why doesn't it just ask me for my > username / password or something? And how do I change the ownership to > Stonehenge.user or something like that? Do I even want to do so? > > To make matters even stranger, the attach works! So I am able to continue > truckin on but it is just one of those "panic moments" when I think that I > am going to be locked out of my database. > > Does anyone have an English language explanation of what is happening, > why, > and how to cause it to go away? > > 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 Mon Feb 4 10:13:30 2008 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 4 Feb 2008 11:13:30 -0500 Subject: [dba-SQLServer] Changing database ownership In-Reply-To: <29f585dd0802040719q7a7149c1ob2faa4b874cc689@mail.gmail.com> References: <005701c8673f$a20ed220$0401a8c0@M90> <29f585dd0802040719q7a7149c1ob2faa4b874cc689@mail.gmail.com> Message-ID: <007f01c86748$e20b0b60$0401a8c0@M90> Arthur, I think this won't work in my case because the other server is already taken down, no longer exists, so I can't "get at" it. Since it did in fact attach, albeit with an error message, I can do what you are talking about with the mounted instance. 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 Arthur Fuller Sent: Monday, February 04, 2008 10:19 AM To: Discussion concerning MS SQL Server Subject: Re: [dba-SQLServer] Changing database ownership I have had similar problems, JC, and I don't quite understand why and how to fix it easily. I do however have a work-around that seems to work. Inelegant, I know, but if it works, it works, until some bolt of insight strikes me. 1. Create a new database. Check that it is sound by opening the database diagrams node on said database. It will either tell you that the stuff is not installed and ask if you want to install it (This is good), or it will tell you that you aren't the owner. 2. Assuming you are the owner, then use the Import Wizard to grab all the data, sprocs, views, etc. from the other database and import them into the newly created one. After that, you can safely delete the old database. A. P.S. Supposedly there is a simple system stored procedure to let you change the ownership but I've had problems with it. Thus I experimented and came up with the recipe above. On Mon, Feb 4, 2008 at 10:07 AM, jwcolby wrote: > I have another piece of SQL Server that I do not understand. I > generally work from my laptop (M90). I open SQL Server and create a > database out on one of my servers. I had two servers at the time, but > I am down to one now. > At the time I was creating a lot of the databases on server AZUL. > Azul's motherboard died and I moved the databases off to server > Stonehenge. When I try to attach the databases I get an error > something to the effect "cannot attach because the user M90.jwcolby is > not available". Obviously m90.jwcolby is my user on my laptop, but > why doesn't it just ask me for my username / password or something? > And how do I change the ownership to Stonehenge.user or something like > that? Do I even want to do so? > > To make matters even stranger, the attach works! So I am able to > continue truckin on but it is just one of those "panic moments" when I > think that I am going to be locked out of my database. > > Does anyone have an English language explanation of what is happening, > why, and how to cause it to go away? > > 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 fuller.artful at gmail.com Tue Feb 5 13:50:07 2008 From: fuller.artful at gmail.com (Arthur Fuller) Date: Tue, 5 Feb 2008 14:50:07 -0500 Subject: [dba-SQLServer] SQL Express equivalent of Management Studio Message-ID: <29f585dd0802051150r3a78560bn4d9daeb22a7aad6a@mail.gmail.com> What's this program called and where can I find it? A couple of searches on MS have not turned it up. TIA, Arthur From ssharkins at gmail.com Tue Feb 5 13:55:43 2008 From: ssharkins at gmail.com (Susan Harkins) Date: Tue, 5 Feb 2008 14:55:43 -0500 Subject: [dba-SQLServer] SQL Express equivalent of Management Studio References: <29f585dd0802051150r3a78560bn4d9daeb22a7aad6a@mail.gmail.com> Message-ID: <003201c86831$1b9e1410$4b3a8343@SusanOne> http://www.microsoft.com/downloads/details.aspx?FamilyID=c243a5ae-4bd1-4e3d-94b8-5a0f62bf7796&displaylang=en Susan H. > What's this program called and where can I find it? A couple of searches > on > MS have not turned it up. > > TIA, > Arthur > _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com > From fuller.artful at gmail.com Tue Feb 5 14:50:44 2008 From: fuller.artful at gmail.com (Arthur Fuller) Date: Tue, 5 Feb 2008 15:50:44 -0500 Subject: [dba-SQLServer] SQL Express equivalent of Management Studio In-Reply-To: <003201c86831$1b9e1410$4b3a8343@SusanOne> References: <29f585dd0802051150r3a78560bn4d9daeb22a7aad6a@mail.gmail.com> <003201c86831$1b9e1410$4b3a8343@SusanOne> Message-ID: <29f585dd0802051250j6a9559c9n21654e86cf7bc1d2@mail.gmail.com> Thanks, Susan. On Tue, Feb 5, 2008 at 2:55 PM, Susan Harkins wrote: > > http://www.microsoft.com/downloads/details.aspx?FamilyID=c243a5ae-4bd1-4e3d-94b8-5a0f62bf7796&displaylang=en > > Susan H. > From fuller.artful at gmail.com Fri Feb 8 18:54:04 2008 From: fuller.artful at gmail.com (Arthur Fuller) Date: Fri, 8 Feb 2008 19:54:04 -0500 Subject: [dba-SQLServer] Quick trick to drastically reduce Log file size Message-ID: <29f585dd0802081654g54700c14s14a55fe876d88baa@mail.gmail.com> While beta-testing a great forthcoming Red Gate product called Data Generator, I built several test databases with many millions of rows in their tables. After the product populated the databases, I had several whopping log files, approximately 60 GB each. DBCC Shrink is *not* the answer in such a situation. If you deem the contents of the log to be useless, or alternatively, if you've backed up a huge log file and merely want to reclaim the disk space, there is a very quick and slick solution. If you already know it, fine. If you don't, this tip might prove useful to you. 1. Open an Explorer window and also Management Studio. Navigate the Explorer window to the directory in which you house your log files. You may find it useful to sort the listing by file size descending. 2. In Management Studio, detach the database(s) of interest (those with huge log files). 3. Switch to the Explorer window and delete the corresponding log file(s). 4. Switch back to Management Studio, right-click on the Databases node and select Attach. Choose the database of interest. 5. The Attach Database dialog will display both the data and the log files in the lower panel. Select the log file and click Remove. 6. Click OK and Studio attaches the database, creating a brand-new log file automatically, about 1MB in size. In my case, I just got back about 120GB in a couple of minutes. hth someone, Arthur From jlawrenc1 at shaw.ca Sat Feb 9 13:04:09 2008 From: jlawrenc1 at shaw.ca (Jim Lawrence) Date: Sat, 09 Feb 2008 11:04:09 -0800 Subject: [dba-SQLServer] Getting a connection and SQL 2005 security In-Reply-To: <003201c86831$1b9e1410$4b3a8343@SusanOne> References: <29f585dd0802051150r3a78560bn4d9daeb22a7aad6a@mail.gmail.com> <003201c86831$1b9e1410$4b3a8343@SusanOne> Message-ID: Hi All: I have been trying to get a new site with MS SQL 2005 connecting to a DotNetNuke application. In the last 2 days I have learned more about MS SQL 2005 security and am starting to realize that what was easy on MS SQL 2000 is not as straight forward. I have not been able to: 1. Setup an appropriate connection string within the DotNetNuke product. I can connect to the database using the ODBC application (Start > Control Panel > Administration Tools > Data Sources (ODBC)) very easily. There is a way to create a 'connection string text file' from this app but just can not remember the method...??? 2. Setup security and users, using both Windows Authentication and SQL Server mode, with TCP/IP and named pipes and remote login. Grant the appropriate rights... etc There must be a simple straight forward methodology and documentation that can be followed as doing little tweaks and mode can only get me so far. (Now that I have been setting connection strings in my sleep, over and over, when I have been able to sleep it is time to ask for some expert help.) It is probably a small piece that I have overlooked but is a show-stopper. Any thoughts? TIA Jim From Gustav at cactus.dk Sun Feb 10 04:18:26 2008 From: Gustav at cactus.dk (Gustav Brock) Date: Sun, 10 Feb 2008 11:18:26 +0100 Subject: [dba-SQLServer] Visual Studio 2008 and SQL Server 2008 CTP Message-ID: Hi al How odd is this? I just took the time to install SQL Server 2008 Express CTP and VS2008 on a new machine (Vista) to enjoy a brave new world. But as soon you attempt to connect to the server, this message pops: "This server version is not supported. Only servers up to Microsoft SQL Server 2005 are supported." They must be kidding ... even an add-on for VS2005 is available: http://www.microsoft.com/downloads/details.aspx?FamilyID=e1109aef-1aa2-408d-aa0f-9df094f993bf&displaylang=en How odd is this? VS2008 ships with the SQL Server 2005 Express but still. Any ideas on how to get it to accept SQL Server 2008 CTP? /gustav From pauln at sqlserverbible.com Sun Feb 10 04:24:59 2008 From: pauln at sqlserverbible.com (Paul Nielsen) Date: Sun, 10 Feb 2008 03:24:59 -0700 Subject: [dba-SQLServer] Visual Studio 2008 and SQL Server 2008 CTP In-Reply-To: References: Message-ID: <005301c86bcf$31803ff0$9480bfd0$@com> Please say you installed this experiment in a VPC, And not in your real host OS. -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Sunday, February 10, 2008 3:18 AM To: dba-sqlserver at databaseadvisors.com; Hi all Found this tip which can save you a lot of time and lost hair: http://codingreflection.com/wordpress/?p=371 should you receive the message: "None of the selected features can be installed or upgraded." If so, use this command to run the install where d is your cd drive: d:\setup.exe SKUUPGRADE=1 /gustav From Gustav at cactus.dk Sun Feb 10 04:30:15 2008 From: Gustav at cactus.dk (Gustav Brock) Date: Sun, 10 Feb 2008 11:30:15 +0100 Subject: [dba-SQLServer] Visual Studio 2008 and SQL Server 2008 CTP Message-ID: Hi Paul No, but it's a brand new machine with nothing else of importance installed, so it may be reinstalled rather quickly from an image. /gustav >>> pauln at sqlserverbible.com 10-02-2008 11:24 >>> Please say you installed this experiment in a VPC, And not in your real host OS. -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Sunday, February 10, 2008 3:18 AM To: dba-sqlserver at databaseadvisors.com; Hi all Well, they (MS) are not kidding: http://blogs.msdn.com/somasegar/archive/2007/12/09/visual-studio-and-sql-server-2008.aspx For Visual Studio 2008 to support SQL Server 2008, we will be delivering a patch to coincide with the next CTP of SQL Server 2008. which raises the logical question: When is next CTP of SQL Server 2008 coming out? ... Monday, January 21, 2008 1:53 PM by Somasegar The next CTP of SQL Server 2008 will likely come out towards the end of Feburary - in time for the "VS2008, Windows Server 2008 and SQL Server 2008" launch. Good timing? /gustav >>> Gustav at cactus.dk 10-02-2008 11:18 >>> Hi al How odd is this? I just took the time to install SQL Server 2008 Express CTP and VS2008 on a new machine (Vista) to enjoy a brave new world. But as soon you attempt to connect to the server, this message pops: "This server version is not supported. Only servers up to Microsoft SQL Server 2005 are supported." They must be kidding ... even an add-on for VS2005 is available: http://www.microsoft.com/downloads/details.aspx?FamilyID=e1109aef-1aa2-408d-aa0f-9df094f993bf&displaylang=en How odd is this? VS2008 ships with the SQL Server 2005 Express but still. Any ideas on how to get it to accept SQL Server 2008 CTP? /gustav From ssharkins at gmail.com Sun Feb 10 09:03:41 2008 From: ssharkins at gmail.com (Susan Harkins) Date: Sun, 10 Feb 2008 10:03:41 -0500 Subject: [dba-SQLServer] interesting trick Message-ID: <01ec01c86bf6$20d05470$4b3a8343@SusanOne> http://www.sqlskills.com/blogs/conor/2008/02/07/EXISTSSubqueriesSELECT1VsSELECT.aspx I've never even checked to see if SQL Server supports this SELECT syntax. Never needed it and can't imagine using it, but in this one particular case, seems like a good choice. Susan H. From Gustav at cactus.dk Sun Feb 10 11:14:00 2008 From: Gustav at cactus.dk (Gustav Brock) Date: Sun, 10 Feb 2008 18:14:00 +0100 Subject: [dba-SQLServer] Visual Studio 2008: MSDTC on server 'servername' is unavailable (Solution) Message-ID: Hi all When you try to connect to a linked database on a remote server, you will probably succeed. However, when you try to preview the data (using the GetData.. method), you may receive this message just as data are to be retrieved: MSDTC on server 'servername' is unavailable I found the solution here: http://geekswithblogs.net/narent/archive/2006/10/09/93544.aspx Control Panel > Adminstrative Tools > Component Services > Computers > (right click) My Computer > Run MS DTC If you have the application and the SQL Server Data base in two different machines you must do that also Control Panel > Adminstrative Tools > Component Services > Computers > (right click) My Computer > Properties > MS DTC (TAB) > allow remote access In my case, the MS DTC service was running - I just had to touch it as described to get it working. Somewhat strange, I think, but who cares. Also, I modified the hosts and lmhosts.sam files to include the name lookup of the remote server as this is not a server with a public URL, but I'm not sure if that really is necessary as VS previously was perfectly able to preview a table of a normal database (but not of a linked) on that same server. hosts file: xxx.xxx.xxx.xxx servername # Description of server lmhosts.sam file: xxx.xxx.xxx.xxx servername #PRE #Description of server /gustav From jlawrenc1 at shaw.ca Sun Feb 10 12:41:04 2008 From: jlawrenc1 at shaw.ca (Jim Lawrence) Date: Sun, 10 Feb 2008 10:41:04 -0800 Subject: [dba-SQLServer] interesting trick In-Reply-To: <01ec01c86bf6$20d05470$4b3a8343@SusanOne> References: <01ec01c86bf6$20d05470$4b3a8343@SusanOne> Message-ID: <191CBB58A62E451DB93D18E51CEB4419@creativesystemdesigns.com> Hi Susan: Can not find this link... Is it still available? Jim -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Susan Harkins Sent: Sunday, February 10, 2008 7:04 AM To: SQLList Subject: [dba-SQLServer] interesting trick http://www.sqlskills.com/blogs/conor/2008/02/07/EXISTSSubqueriesSELECT1VsSEL ECT.aspx I've never even checked to see if SQL Server supports this SELECT syntax. Never needed it and can't imagine using it, but in this one particular case, seems like a good choice. Susan H. _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From ssharkins at gmail.com Sun Feb 10 12:38:32 2008 From: ssharkins at gmail.com (Susan Harkins) Date: Sun, 10 Feb 2008 13:38:32 -0500 Subject: [dba-SQLServer] interesting trick References: <01ec01c86bf6$20d05470$4b3a8343@SusanOne> <191CBB58A62E451DB93D18E51CEB4419@creativesystemdesigns.com> Message-ID: <002901c86c14$24ff8390$4b3a8343@SusanOne> It's probably the wrap -- I forgot to include the <> to keep it from breaking -- sorry. Try this one. Susan H. > Hi Susan: > > Can not find this link... Is it still available? From pauln at sqlserverbible.com Sun Feb 10 16:09:12 2008 From: pauln at sqlserverbible.com (Paul Nielsen) Date: Sun, 10 Feb 2008 15:09:12 -0700 Subject: [dba-SQLServer] interesting trick In-Reply-To: <002901c86c14$24ff8390$4b3a8343@SusanOne> References: <01ec01c86bf6$20d05470$4b3a8343@SusanOne> <191CBB58A62E451DB93D18E51CEB4419@creativesystemdesigns.com> <002901c86c14$24ff8390$4b3a8343@SusanOne> Message-ID: <009b01c86c31$91d08ba0$b571a2e0$@com> Which trick are you referring to? Using an literal in the exist(select)? -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Susan Harkins Sent: Sunday, February 10, 2008 11:39 AM To: Discussion concerning MS SQL Server Subject: Re: [dba-SQLServer] interesting trick It's probably the wrap -- I forgot to include the <> to keep it from breaking -- sorry. Try this one. Susan H. > Hi Susan: > > Can not find this link... Is it still available? _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com __________ NOD32 2861 (20080209) Information __________ This message was checked by NOD32 antivirus system. http://www.eset.com From ssharkins at gmail.com Sun Feb 10 16:14:08 2008 From: ssharkins at gmail.com (Susan Harkins) Date: Sun, 10 Feb 2008 17:14:08 -0500 Subject: [dba-SQLServer] interesting trick References: <01ec01c86bf6$20d05470$4b3a8343@SusanOne> <191CBB58A62E451DB93D18E51CEB4419@creativesystemdesigns.com><002901c86c14$24ff8390$4b3a8343@SusanOne> <009b01c86c31$91d08ba0$b571a2e0$@com> Message-ID: <005401c86c32$430477b0$4b3a8343@SusanOne> Using SELECT 1 instead of SELECT * -- I know you can use a number to refer to a column's position, but its uses are limited. I found this reason interesting and probably wouldn't have thought of it on my own. Susan H. > Which trick are you referring to? Using an literal in the exist(select)? From Gustav at cactus.dk Sun Feb 10 16:50:38 2008 From: Gustav at cactus.dk (Gustav Brock) Date: Sun, 10 Feb 2008 23:50:38 +0100 Subject: [dba-SQLServer] interesting trick Message-ID: Hi Susan and Paul The tip is to use: SELECT col1 FROM MyTable WHERE EXISTS (SELECT 1 FROM Table2 WHERE MyTable.col1=Table2.col2) to retrieve one column only and not: SELECT col1 FROM MyTable WHERE EXISTS (SELECT * FROM Table2 WHERE MyTable.col1=Table2.col2) But if so why not retrieve zero columns as you can return a constant: SELECT col1 FROM MyTable WHERE EXISTS (SELECT 1 AS Expr1 FROM Table2 WHERE MyTable.col1=Table2.col2) Further, the trick may not be a trick at all as at least SQL Server Management Studio doesn't allow the "SELECT 1 FROM Table .. " syntax - it corrects it at once to "SELECT 1 AS Expr1 FROM Table .." /gustav >>> ssharkins at gmail.com 10-02-2008 16:03 >>> http://www.sqlskills.com/blogs/conor/2008/02/07/EXISTSSubqueriesSELECT1VsSELECT.aspx I've never even checked to see if SQL Server supports this SELECT syntax. Never needed it and can't imagine using it, but in this one particular case, seems like a good choice. Susan H. From pauln at sqlserverbible.com Sun Feb 10 17:05:52 2008 From: pauln at sqlserverbible.com (Paul Nielsen) Date: Sun, 10 Feb 2008 16:05:52 -0700 Subject: [dba-SQLServer] interesting trick In-Reply-To: <005401c86c32$430477b0$4b3a8343@SusanOne> References: <01ec01c86bf6$20d05470$4b3a8343@SusanOne> <191CBB58A62E451DB93D18E51CEB4419@creativesystemdesigns.com><002901c86c14$24ff8390$4b3a8343@SusanOne> <009b01c86c31$91d08ba0$b571a2e0$@com> <005401c86c32$430477b0$4b3a8343@SusanOne> Message-ID: <000901c86c39$7cdad130$76907390$@com> The number to refer to column ordinal position is only in the order by clause. In a column list, you can include any expression or literal, it doesn't have to be a column from the table. The simplest select statement is SELECT 1 Everything else is optional -Paul -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Susan Harkins Sent: Sunday, February 10, 2008 3:14 PM To: Discussion concerning MS SQL Server Subject: Re: [dba-SQLServer] interesting trick Using SELECT 1 instead of SELECT * -- I know you can use a number to refer to a column's position, but its uses are limited. I found this reason interesting and probably wouldn't have thought of it on my own. Susan H. > Which trick are you referring to? Using an literal in the exist(select)? _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com __________ NOD32 2862 (20080210) Information __________ This message was checked by NOD32 antivirus system. http://www.eset.com From pauln at sqlserverbible.com Sun Feb 10 17:08:02 2008 From: pauln at sqlserverbible.com (Paul Nielsen) Date: Sun, 10 Feb 2008 16:08:02 -0700 Subject: [dba-SQLServer] interesting trick In-Reply-To: References: Message-ID: <000a01c86c39$c9c2c660$5d485320$@com> You realize there is absolutely no benefit to 'exists (select 1' vs. 'exist(select column' vs. 'exist (select *' The QP simply looks for the presence of a row. There is no real tip in this thread. -Paul -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Sunday, February 10, 2008 3:51 PM To: dba-sqlserver at databaseadvisors.com Subject: Re: [dba-SQLServer] interesting trick Hi Susan and Paul The tip is to use: SELECT col1 FROM MyTable WHERE EXISTS (SELECT 1 FROM Table2 WHERE MyTable.col1=Table2.col2) to retrieve one column only and not: SELECT col1 FROM MyTable WHERE EXISTS (SELECT * FROM Table2 WHERE MyTable.col1=Table2.col2) But if so why not retrieve zero columns as you can return a constant: SELECT col1 FROM MyTable WHERE EXISTS (SELECT 1 AS Expr1 FROM Table2 WHERE MyTable.col1=Table2.col2) Further, the trick may not be a trick at all as at least SQL Server Management Studio doesn't allow the "SELECT 1 FROM Table .. " syntax - it corrects it at once to "SELECT 1 AS Expr1 FROM Table .." /gustav >>> ssharkins at gmail.com 10-02-2008 16:03 >>> http://www.sqlskills.com/blogs/conor/2008/02/07/EXISTSSubqueriesSELECT1VsSEL ECT.aspx I've never even checked to see if SQL Server supports this SELECT syntax. Never needed it and can't imagine using it, but in this one particular case, seems like a good choice. Susan H. _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com __________ NOD32 2862 (20080210) Information __________ This message was checked by NOD32 antivirus system. http://www.eset.com From accessd at shaw.ca Sun Feb 10 17:28:36 2008 From: accessd at shaw.ca (Jim Lawrence) Date: Sun, 10 Feb 2008 15:28:36 -0800 Subject: [dba-SQLServer] interesting trick In-Reply-To: <002901c86c14$24ff8390$4b3a8343@SusanOne> References: <01ec01c86bf6$20d05470$4b3a8343@SusanOne> <191CBB58A62E451DB93D18E51CEB4419@creativesystemdesigns.com> <002901c86c14$24ff8390$4b3a8343@SusanOne> Message-ID: <1E27D69E4AFF4C26928F1F36DAA80386@creativesystemdesigns.com> Yes, you are right... Jim -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Susan Harkins Sent: Sunday, February 10, 2008 10:39 AM To: Discussion concerning MS SQL Server Subject: Re: [dba-SQLServer] interesting trick It's probably the wrap -- I forgot to include the <> to keep it from breaking -- sorry. Try this one. Susan H. > Hi Susan: > > Can not find this link... Is it still available? _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From ssharkins at gmail.com Sun Feb 10 20:52:55 2008 From: ssharkins at gmail.com (Susan Harkins) Date: Sun, 10 Feb 2008 21:52:55 -0500 Subject: [dba-SQLServer] interesting trick References: <000a01c86c39$c9c2c660$5d485320$@com> Message-ID: <005f01c86c59$5b6453d0$4b3a8343@SusanOne> So, you don't think SELECT 1 is faster than SELECT *? Susan H. > The QP simply looks for the presence of a row. There is no real tip in > this > thread. From pauln at sqlserverbible.com Sun Feb 10 21:07:31 2008 From: pauln at sqlserverbible.com (Paul Nielsen) Date: Sun, 10 Feb 2008 20:07:31 -0700 Subject: [dba-SQLServer] interesting trick In-Reply-To: <005f01c86c59$5b6453d0$4b3a8343@SusanOne> References: <000a01c86c39$c9c2c660$5d485320$@com> <005f01c86c59$5b6453d0$4b3a8343@SusanOne> Message-ID: <002001c86c5b$3e51c870$baf55950$@com> Absolutely no difference - same exact query execution plan. -Paul SQL Server MVP -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Susan Harkins Sent: Sunday, February 10, 2008 7:53 PM To: Discussion concerning MS SQL Server Subject: Re: [dba-SQLServer] interesting trick So, you don't think SELECT 1 is faster than SELECT *? Susan H. > The QP simply looks for the presence of a row. There is no real tip in > this > thread. _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com __________ NOD32 2862 (20080210) Information __________ This message was checked by NOD32 antivirus system. http://www.eset.com From ssharkins at gmail.com Sun Feb 10 21:24:15 2008 From: ssharkins at gmail.com (Susan Harkins) Date: Sun, 10 Feb 2008 22:24:15 -0500 Subject: [dba-SQLServer] interesting trick References: <000a01c86c39$c9c2c660$5d485320$@com><005f01c86c59$5b6453d0$4b3a8343@SusanOne> <002001c86c5b$3e51c870$baf55950$@com> Message-ID: <00ac01c86c5d$c8b320c0$4b3a8343@SusanOne> Hmmmm... Okay. SUsan H. > Absolutely no difference - same exact query execution plan. > > -Paul From accessd at shaw.ca Thu Feb 14 00:35:45 2008 From: accessd at shaw.ca (Jim Lawrence) Date: Wed, 13 Feb 2008 22:35:45 -0800 Subject: [dba-SQLServer] Internet MDB connection method In-Reply-To: References: Message-ID: <72559D4B5B8D434AB850415EE8D23C1C@creativesystemdesigns.com> Hi All: What connection method and code do you use to connect to an MDB DB on your web sites? (I have only used MS SQL in the past and that is fairly straight forward.) My client had originally hard coded the MDB location in a Global file variable and used the DSN-less Database Connection method but that will not work now that he is planning on migrating to a public internet hosting company. Is there a way to pre-setup an ODBC Database Connection that would work on any location? Any insights and coding samples would be greatly appreciated. TIA Jim From jwcolby at colbyconsulting.com Thu Feb 14 12:40:17 2008 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 14 Feb 2008 13:40:17 -0500 Subject: [dba-SQLServer] SQL Server "benchmarks" Message-ID: <00e601c86f39$0c614760$0401a8c0@M90> I am in the process of running some "benchmarks" on my SQL Server machines. I have two machines: AMD Quad core, 4 GByte RAM - Running Windows 2003 x32 and SQL Server X32 AMD Dual Core, 8 gbytes RAM - Running Windows 2003 x64 and SQL Server X64 AMD Dual core, 4 GByte RAM - Running Windows 2003 x32 and SQL Server X32 AMD QUAD Core, 8 gbytes RAM - Running Windows 2003 x64 and SQL Server X64 I have a standard count database and resulting Excel workbook. The database 4 base queries to pull data out of three different databases. It then uses 17 "count" queries to get counts, usually with an ORDER BY clause to get the counts by state, income band, age code etc. This set of counts ultimately pulls records from my 50 million record address table joined to a matching 50 million record criteria table, joined to a zip code table so the resulting queries work the system pretty hard. Both the quad core and the dual core processor almost max the processor usage for all cores, you can still see the top of the waveform but it is running 95% plus on all cores. Page file usage is about 7.5 gig on the X64 system and 2.2 on the x32 system. I am running both machines off of the Areca 1220 RAID controller, however the RAID arrays are not identical because in the quad core x32 machine I have eight 500gb drives whereas in the dual core x64 machine I have only three 500gb drives. This can make a difference in some cases since the streaming read speed is (No of Drives * Read speed of drive) so as you add more drives to an array the streaming read speed off the array rises linearly. This means that the x64 system only has 3/8ths of the streaming read speed of the x32 system. I will be adding more drives to that controller some day but not anytime soon. To summarize, the x32 system just happens to have my only quad core chip. The x64 system just happens to have the dual core chip. Both have maxed out memory that I can provide based on the OS maximums and the motherboard maximums. I discovered after running all the tests that the X32 Quad was running on only 2 gigs of ram, so I put in 4 gigs and reran all the tests for that machine. And for the results (drum roll please.....). x4x32-2gb x4x32-4gb x2x32-4gb x2x64-8gb x4x64-8gb Test 1:56 1:30 2:03 1:23 0:52 Age00_17 2:01 1:27 2:04 1:30 1:02 ByIncome 0:55 0:44 0:59 0:45 0:33 ByState 2:06 1:25 2:02 1:20 0:52 Age75 (by code within that field) 4:17 3:04 4:18 3:50 3:07 Cnt Boating (single count, no groupby) So... The dual core running x64 appears to run about as fast as the quad core running x32 in all but one case. The quad core running x64 has a clear advantage over the dual code or quad core running x32 EXCEPT for that single case mentioned above, where it almost catches up. The additional 2 gigs of memory for the X32 makes a significant difference as would be expected. John W. Colby Colby Consulting www.ColbyConsulting.com From accessd at shaw.ca Thu Feb 14 14:07:07 2008 From: accessd at shaw.ca (Jim Lawrence) Date: Thu, 14 Feb 2008 12:07:07 -0800 Subject: [dba-SQLServer] SQL Server "benchmarks" In-Reply-To: <00e601c86f39$0c614760$0401a8c0@M90> References: <00e601c86f39$0c614760$0401a8c0@M90> Message-ID: Very interesting... John. Jim -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, February 14, 2008 10:40 AM To: 'Discussion of Hardware and Software issues'; 'Discussion concerning MS SQL Server' Subject: [dba-SQLServer] SQL Server "benchmarks" I am in the process of running some "benchmarks" on my SQL Server machines. I have two machines: AMD Quad core, 4 GByte RAM - Running Windows 2003 x32 and SQL Server X32 AMD Dual Core, 8 gbytes RAM - Running Windows 2003 x64 and SQL Server X64 AMD Dual core, 4 GByte RAM - Running Windows 2003 x32 and SQL Server X32 AMD QUAD Core, 8 gbytes RAM - Running Windows 2003 x64 and SQL Server X64 I have a standard count database and resulting Excel workbook. The database 4 base queries to pull data out of three different databases. It then uses 17 "count" queries to get counts, usually with an ORDER BY clause to get the counts by state, income band, age code etc. This set of counts ultimately pulls records from my 50 million record address table joined to a matching 50 million record criteria table, joined to a zip code table so the resulting queries work the system pretty hard. Both the quad core and the dual core processor almost max the processor usage for all cores, you can still see the top of the waveform but it is running 95% plus on all cores. Page file usage is about 7.5 gig on the X64 system and 2.2 on the x32 system. I am running both machines off of the Areca 1220 RAID controller, however the RAID arrays are not identical because in the quad core x32 machine I have eight 500gb drives whereas in the dual core x64 machine I have only three 500gb drives. This can make a difference in some cases since the streaming read speed is (No of Drives * Read speed of drive) so as you add more drives to an array the streaming read speed off the array rises linearly. This means that the x64 system only has 3/8ths of the streaming read speed of the x32 system. I will be adding more drives to that controller some day but not anytime soon. To summarize, the x32 system just happens to have my only quad core chip. The x64 system just happens to have the dual core chip. Both have maxed out memory that I can provide based on the OS maximums and the motherboard maximums. I discovered after running all the tests that the X32 Quad was running on only 2 gigs of ram, so I put in 4 gigs and reran all the tests for that machine. And for the results (drum roll please.....). x4x32-2gb x4x32-4gb x2x32-4gb x2x64-8gb x4x64-8gb Test 1:56 1:30 2:03 1:23 0:52 Age00_17 2:01 1:27 2:04 1:30 1:02 ByIncome 0:55 0:44 0:59 0:45 0:33 ByState 2:06 1:25 2:02 1:20 0:52 Age75 (by code within that field) 4:17 3:04 4:18 3:50 3:07 Cnt Boating (single count, no groupby) So... The dual core running x64 appears to run about as fast as the quad core running x32 in all but one case. The quad core running x64 has a clear advantage over the dual code or quad core running x32 EXCEPT for that single case mentioned above, where it almost catches up. The additional 2 gigs of memory for the X32 makes a significant difference as would be expected. 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 Feb 14 14:31:05 2008 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 14 Feb 2008 15:31:05 -0500 Subject: [dba-SQLServer] SQL Server "benchmarks" In-Reply-To: References: <00e601c86f39$0c614760$0401a8c0@M90> Message-ID: <00ec01c86f48$86817a60$0401a8c0@M90> I hate it when it wraps lines. 8-( 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: Thursday, February 14, 2008 3:07 PM To: 'Discussion concerning MS SQL Server' Subject: Re: [dba-SQLServer] SQL Server "benchmarks" Very interesting... John. Jim -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, February 14, 2008 10:40 AM To: 'Discussion of Hardware and Software issues'; 'Discussion concerning MS SQL Server' Subject: [dba-SQLServer] SQL Server "benchmarks" I am in the process of running some "benchmarks" on my SQL Server machines. I have two machines: AMD Quad core, 4 GByte RAM - Running Windows 2003 x32 and SQL Server X32 AMD Dual Core, 8 gbytes RAM - Running Windows 2003 x64 and SQL Server X64 AMD Dual core, 4 GByte RAM - Running Windows 2003 x32 and SQL Server X32 AMD QUAD Core, 8 gbytes RAM - Running Windows 2003 x64 and SQL Server X64 I have a standard count database and resulting Excel workbook. The database 4 base queries to pull data out of three different databases. It then uses 17 "count" queries to get counts, usually with an ORDER BY clause to get the counts by state, income band, age code etc. This set of counts ultimately pulls records from my 50 million record address table joined to a matching 50 million record criteria table, joined to a zip code table so the resulting queries work the system pretty hard. Both the quad core and the dual core processor almost max the processor usage for all cores, you can still see the top of the waveform but it is running 95% plus on all cores. Page file usage is about 7.5 gig on the X64 system and 2.2 on the x32 system. I am running both machines off of the Areca 1220 RAID controller, however the RAID arrays are not identical because in the quad core x32 machine I have eight 500gb drives whereas in the dual core x64 machine I have only three 500gb drives. This can make a difference in some cases since the streaming read speed is (No of Drives * Read speed of drive) so as you add more drives to an array the streaming read speed off the array rises linearly. This means that the x64 system only has 3/8ths of the streaming read speed of the x32 system. I will be adding more drives to that controller some day but not anytime soon. To summarize, the x32 system just happens to have my only quad core chip. The x64 system just happens to have the dual core chip. Both have maxed out memory that I can provide based on the OS maximums and the motherboard maximums. I discovered after running all the tests that the X32 Quad was running on only 2 gigs of ram, so I put in 4 gigs and reran all the tests for that machine. And for the results (drum roll please.....). x4x32-2gb x4x32-4gb x2x32-4gb x2x64-8gb x4x64-8gb Test 1:56 1:30 2:03 1:23 0:52 Age00_17 2:01 1:27 2:04 1:30 1:02 ByIncome 0:55 0:44 0:59 0:45 0:33 ByState 2:06 1:25 2:02 1:20 0:52 Age75 (by code within that field) 4:17 3:04 4:18 3:50 3:07 Cnt Boating (single count, no groupby) So... The dual core running x64 appears to run about as fast as the quad core running x32 in all but one case. The quad core running x64 has a clear advantage over the dual code or quad core running x32 EXCEPT for that single case mentioned above, where it almost catches up. The additional 2 gigs of memory for the X32 makes a significant difference as would be expected. 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 ssharkins at gmail.com Fri Feb 15 12:39:17 2008 From: ssharkins at gmail.com (Susan Harkins) Date: Fri, 15 Feb 2008 13:39:17 -0500 Subject: [dba-SQLServer] 2008 guinea pigs Message-ID: <015e01c87002$134566a0$4b3a8343@SusanOne> Anyone here know 2008 well enough that they might want to freelance for a few days with new certification documentation? Requires trip to the wild Pacific Northwest -- good pay and expenses reimbursed (that one's a problem for me -- I don't think they should do it that way). let me know privately -- send me a resume and I'll get it into the right hands. Can't promise a thing and I'm not getting squat for it. ssharkins at gmail.com Susan H. From ebarro at verizon.net Fri Feb 15 13:17:24 2008 From: ebarro at verizon.net (Eric Barro) Date: Fri, 15 Feb 2008 11:17:24 -0800 Subject: [dba-SQLServer] Internet MDB connection method In-Reply-To: <72559D4B5B8D434AB850415EE8D23C1C@creativesystemdesigns.com> Message-ID: <0JWA008GWOA3Y5Z2@vms048.mailsrvcs.net> Jim, Use the OLEDB connection to connect. Syntax is similar to the SQL Connection object. The database connection string in this case will be stored in WEB.CONFIG. ---Sample Code--- Sample Call: sql = "SELECT TOP 1 MailServerName, MailFromAccount, SMTPAuthentication, SMTPUser, SMTPPassword, Attachment1, Attachment2 FROM tblMailSettings"; sqlParameters.Clear(); sqlConnect = "AccessMDB.Connect"; Hashtable dbMailProperties = new Hashtable(); //make sure that it's empty before we add and data into it dbMailProperties.Clear(); dbMailProperties = Data.GetOleDbSingleRecord(sql, connectionString, MailServer, MailFrom, SMTPAuthentication.ToString(), SMTPUser, SMTPPassword, Attachment1, Attachment2); ---Public Module in Data class that returns a Hashtable--- NOTES: Hashtable returns key, value pair. You can then walk through the hashtable and grab the key, value pair to populate your web controls. public static Hashtable GetOleDbSingleRecord(string sql, string sqlConnect, params string[] fieldParams) { Hashtable dbFields = new Hashtable(); int recordCount = 0; string ConnectionString = ConfigurationSettings.AppSettings[sqlConnect]; OleDbConnection sqlConn = new OleDbConnection(ConnectionString); sqlConn.Open(); OleDbCommand sqlCmd = new OleDbCommand(sql, sqlConn); OleDbDataReader sqlDR = sqlCmd.ExecuteReader(); //make sure that there's nothing in the hashtable dbFields.Clear(); while (sqlDR.Read()) { //walk through each supplied parameter and associate the values retrieved from the table //NOTE: the order of fields is important and must match the order of fields in the table //the assignment of the returned field values will align with the parameters passed to this function //System.Web.HttpContext.Current.Response.Write("Parameters: " + fieldParams.Length + "
"); for (int x = 0; x <= fieldParams.Length - 1; x++) { //grab the first parameter passed to the function //and assign the first field value from the recordset fieldParams[x] = sqlDR[x].ToString(); //populate the hashtable with the key, value pair //in this instance we use the recordcount and the value assigned to each parameter dbFields.Add(recordCount, fieldParams[x].ToString()); recordCount += 1; } } //clean up sqlDR.Close(); sqlConn.Close(); //return the hashtable if (recordCount == 0) return null; else return dbFields; } //end GetOleDbSingleRecord ---Connection string stored in WEB.CONFIG file--- -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Jim Lawrence Sent: Wednesday, February 13, 2008 10:36 PM To: 'Discussion concerning MS SQL Server' Subject: [dba-SQLServer] Internet MDB connection method Hi All: What connection method and code do you use to connect to an MDB DB on your web sites? (I have only used MS SQL in the past and that is fairly straight forward.) My client had originally hard coded the MDB location in a Global file variable and used the DSN-less Database Connection method but that will not work now that he is planning on migrating to a public internet hosting company. Is there a way to pre-setup an ODBC Database Connection that would work on any location? Any insights and coding samples would be greatly appreciated. TIA Jim _______________________________________________ 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 Feb 15 15:43:57 2008 From: markamatte at hotmail.com (Mark A Matte) Date: Fri, 15 Feb 2008 21:43:57 +0000 Subject: [dba-SQLServer] ODBC to Informix In-Reply-To: <0JWA008GWOA3Y5Z2@vms048.mailsrvcs.net> References: <72559D4B5B8D434AB850415EE8D23C1C@creativesystemdesigns.com> <0JWA008GWOA3Y5Z2@vms048.mailsrvcs.net> Message-ID: Hello All, I'm new to SQL 2005...and I'm trying to import a table via ODBC...but when the import wizard launches...my informix ODBC is not in the list to choose. I can use the informix ODBC in Access...but cannot see it in SQL? Any thoughts? Thanks, mark A. Matte _________________________________________________________________ Climb to the top of the charts!?Play the word scramble challenge with star power. http://club.live.com/star_shuffle.aspx?icid=starshuffle_wlmailtextlink_jan From jlawrenc1 at shaw.ca Fri Feb 15 16:57:12 2008 From: jlawrenc1 at shaw.ca (Jim Lawrence) Date: Fri, 15 Feb 2008 14:57:12 -0800 Subject: [dba-SQLServer] Internet MDB connection method In-Reply-To: <0JWA008GWOA3Y5Z2@vms048.mailsrvcs.net> References: <72559D4B5B8D434AB850415EE8D23C1C@creativesystemdesigns.com> <0JWA008GWOA3Y5Z2@vms048.mailsrvcs.net> Message-ID: <12FB02C35A5848839C51B06132B662E2@creativesystemdesigns.com> Thanks Eric: That list was a little more than expected but thank you... I will save this example as it may answer a few more questions in the future. Jim -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Eric Barro Sent: Friday, February 15, 2008 11:17 AM To: 'Discussion concerning MS SQL Server' Subject: Re: [dba-SQLServer] Internet MDB connection method Jim, Use the OLEDB connection to connect. Syntax is similar to the SQL Connection object. The database connection string in this case will be stored in WEB.CONFIG. ---Sample Code--- Sample Call: sql = "SELECT TOP 1 MailServerName, MailFromAccount, SMTPAuthentication, SMTPUser, SMTPPassword, Attachment1, Attachment2 FROM tblMailSettings"; sqlParameters.Clear(); sqlConnect = "AccessMDB.Connect"; Hashtable dbMailProperties = new Hashtable(); //make sure that it's empty before we add and data into it dbMailProperties.Clear(); dbMailProperties = Data.GetOleDbSingleRecord(sql, connectionString, MailServer, MailFrom, SMTPAuthentication.ToString(), SMTPUser, SMTPPassword, Attachment1, Attachment2); ---Public Module in Data class that returns a Hashtable--- NOTES: Hashtable returns key, value pair. You can then walk through the hashtable and grab the key, value pair to populate your web controls. public static Hashtable GetOleDbSingleRecord(string sql, string sqlConnect, params string[] fieldParams) { Hashtable dbFields = new Hashtable(); int recordCount = 0; string ConnectionString = ConfigurationSettings.AppSettings[sqlConnect]; OleDbConnection sqlConn = new OleDbConnection(ConnectionString); sqlConn.Open(); OleDbCommand sqlCmd = new OleDbCommand(sql, sqlConn); OleDbDataReader sqlDR = sqlCmd.ExecuteReader(); //make sure that there's nothing in the hashtable dbFields.Clear(); while (sqlDR.Read()) { //walk through each supplied parameter and associate the values retrieved from the table //NOTE: the order of fields is important and must match the order of fields in the table //the assignment of the returned field values will align with the parameters passed to this function //System.Web.HttpContext.Current.Response.Write("Parameters: " + fieldParams.Length + "
"); for (int x = 0; x <= fieldParams.Length - 1; x++) { //grab the first parameter passed to the function //and assign the first field value from the recordset fieldParams[x] = sqlDR[x].ToString(); //populate the hashtable with the key, value pair //in this instance we use the recordcount and the value assigned to each parameter dbFields.Add(recordCount, fieldParams[x].ToString()); recordCount += 1; } } //clean up sqlDR.Close(); sqlConn.Close(); //return the hashtable if (recordCount == 0) return null; else return dbFields; } //end GetOleDbSingleRecord ---Connection string stored in WEB.CONFIG file--- -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Jim Lawrence Sent: Wednesday, February 13, 2008 10:36 PM To: 'Discussion concerning MS SQL Server' Subject: [dba-SQLServer] Internet MDB connection method Hi All: What connection method and code do you use to connect to an MDB DB on your web sites? (I have only used MS SQL in the past and that is fairly straight forward.) My client had originally hard coded the MDB location in a Global file variable and used the DSN-less Database Connection method but that will not work now that he is planning on migrating to a public internet hosting company. Is there a way to pre-setup an ODBC Database Connection that would work on any location? Any insights and coding samples would be greatly appreciated. TIA Jim _______________________________________________ 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 accessd at shaw.ca Sat Feb 16 13:52:51 2008 From: accessd at shaw.ca (Jim Lawrence) Date: Sat, 16 Feb 2008 11:52:51 -0800 Subject: [dba-SQLServer] New Library on the DBA site In-Reply-To: <003d01c870a3$a11e3230$4b3a8343@SusanOne> References: <001201c8709f$b7bb5e40$0300a8c0@danwaters> <003d01c870a3$a11e3230$4b3a8343@SusanOne> Message-ID: Hi All: There is a new Library section added to the DBA (http://www.databaseadvisors.com) web site. The section is split into 3 modules, one for books, one for articles and one for Podcast. This section is designed to high-lite the creations of list members. The present pages are by no means current or complete and are but a sample of what our members have created. If you have more links and contribution please email me, Jim Lawrence at webmaster at databaseadvisors.com Regards Jim From fuller.artful at gmail.com Fri Feb 22 14:18:43 2008 From: fuller.artful at gmail.com (Arthur Fuller) Date: Fri, 22 Feb 2008 15:18:43 -0500 Subject: [dba-SQLServer] Reporting Services issue Message-ID: <29f585dd0802221218k40676f4cu779502176b67411d@mail.gmail.com> I just installed SQL 2008 Feb CTP. From the Reporting Services Configuration thing, I can test the connection and it works fine. What I see from there is: Server name: EXCALIBUR Report Server Instance: MSSQLSERVER Report Manager URL: http://EXCALIBUR:80/Reports When I test the connection from there, it works fine (with or without the ":80" since that's the default port). However, when I try to run Report Manager, using the default URL (same as above, with or without the ":80), I get "The page cannot be found." Just to make sure everything else was ok, I ran DreamWeaver and loaded a project I've been working on, and successfully ran it without a problem (i.e. http://localhost/cafe_townsend/index.html). Any suggestions? TIA, Arthur From Gustav at cactus.dk Fri Feb 22 16:19:52 2008 From: Gustav at cactus.dk (Gustav Brock) Date: Fri, 22 Feb 2008 23:19:52 +0100 Subject: [dba-SQLServer] Reporting Services issue Message-ID: Hi Arthur Perhaps #11 here can help you: http://www.codeprof.com/dev-archive/26/19-82-265011.shtm /gustav >>> fuller.artful at gmail.com 22-02-2008 21:18 >>> I just installed SQL 2008 Feb CTP. From the Reporting Services Configuration thing, I can test the connection and it works fine. What I see from there is: Server name: EXCALIBUR Report Server Instance: MSSQLSERVER Report Manager URL: http://EXCALIBUR:80/Reports When I test the connection from there, it works fine (with or without the ":80" since that's the default port). However, when I try to run Report Manager, using the default URL (same as above, with or without the ":80), I get "The page cannot be found." Just to make sure everything else was ok, I ran DreamWeaver and loaded a project I've been working on, and successfully ran it without a problem (i.e. http://localhost/cafe_townsend/index.html). Any suggestions? TIA, Arthur From fuller.artful at gmail.com Sun Feb 24 14:27:59 2008 From: fuller.artful at gmail.com (Arthur Fuller) Date: Sun, 24 Feb 2008 15:27:59 -0500 Subject: [dba-SQLServer] SQL 2005 Express v. SQL 2005 Express with Advanced Services Message-ID: <29f585dd0802241227x722b466cidc53682afb26a144@mail.gmail.com> Anyone know what's in Advanced Services that isn't in the normal version? Thx, Arthur From dwaters at usinternet.com Sun Feb 24 14:36:00 2008 From: dwaters at usinternet.com (Dan Waters) Date: Sun, 24 Feb 2008 14:36:00 -0600 Subject: [dba-SQLServer] SQL 2005 Express v. SQL 2005 Express with Advanced Services In-Reply-To: <29f585dd0802241227x722b466cidc53682afb26a144@mail.gmail.com> References: <29f585dd0802241227x722b466cidc53682afb26a144@mail.gmail.com> Message-ID: <001401c87724$de0337e0$0300a8c0@danwaters> Hi Arthur - this is a start! http://www.microsoft.com/sql/editions/express/comparison.mspx Dan -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Arthur Fuller Sent: Sunday, February 24, 2008 2:28 PM To: Discussion concerning MS SQL Server Subject: [dba-SQLServer] SQL 2005 Express v. SQL 2005 Express with Advanced Services Anyone know what's in Advanced Services that isn't in the normal version? Thx, Arthur _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From fuller.artful at gmail.com Sun Feb 24 14:44:55 2008 From: fuller.artful at gmail.com (Arthur Fuller) Date: Sun, 24 Feb 2008 15:44:55 -0500 Subject: [dba-SQLServer] SQL 2005 Express v. SQL 2005 Express with Advanced Services In-Reply-To: <001401c87724$de0337e0$0300a8c0@danwaters> References: <29f585dd0802241227x722b466cidc53682afb26a144@mail.gmail.com> <001401c87724$de0337e0$0300a8c0@danwaters> Message-ID: <29f585dd0802241244l6e451b73g579ac6a298c9b92e@mail.gmail.com> Thanks, Dan. On Sun, Feb 24, 2008 at 3:36 PM, Dan Waters wrote: > Hi Arthur - this is a start! > > http://www.microsoft.com/sql/editions/express/comparison.mspx > > Dan > From ssharkins at gmail.com Sun Feb 24 14:54:15 2008 From: ssharkins at gmail.com (Susan Harkins) Date: Sun, 24 Feb 2008 15:54:15 -0500 Subject: [dba-SQLServer] SQL 2005 Express v. SQL 2005 Express with AdvancedServices References: <29f585dd0802241227x722b466cidc53682afb26a144@mail.gmail.com> Message-ID: <026401c87727$6dc62070$4b3a8343@SusanOne> I can give you a few basics about the big components -- after that, if you ask about a specific feature, I can say yay or nay: Express supports the same native and managed providers as SS. Express replication supports only subscriptions. Express SQL Server Broker works only with other editions of SQL Server 2005. Susan H. > Anyone know what's in Advanced Services that isn't in the normal version? > From fuller.artful at gmail.com Sun Feb 24 14:59:36 2008 From: fuller.artful at gmail.com (Arthur Fuller) Date: Sun, 24 Feb 2008 15:59:36 -0500 Subject: [dba-SQLServer] SQL 2005 Express v. SQL 2005 Express with AdvancedServices In-Reply-To: <026401c87727$6dc62070$4b3a8343@SusanOne> References: <29f585dd0802241227x722b466cidc53682afb26a144@mail.gmail.com> <026401c87727$6dc62070$4b3a8343@SusanOne> Message-ID: <29f585dd0802241259s461fbb35gb0b3cc7099204103@mail.gmail.com> Puzzling thing. In the chart Dan pointed to, it appears that the basic edition doesn't contain Reporting Services. But I just installed it and it appears to. Maybe that chart predates some revised version of the basic express edition. A. On Sun, Feb 24, 2008 at 3:54 PM, Susan Harkins wrote: > I can give you a few basics about the big components -- after that, if you > ask about a specific feature, I can say yay or nay: > > Express supports the same native and managed providers as SS. > Express replication supports only subscriptions. > Express SQL Server Broker works only with other editions of SQL Server > 2005. > > Susan H. > From ssharkins at gmail.com Sun Feb 24 15:04:51 2008 From: ssharkins at gmail.com (Susan Harkins) Date: Sun, 24 Feb 2008 16:04:51 -0500 Subject: [dba-SQLServer] SQL 2005 Express v. SQL 2005 Express withAdvancedServices References: <29f585dd0802241227x722b466cidc53682afb26a144@mail.gmail.com><026401c87727$6dc62070$4b3a8343@SusanOne> <29f585dd0802241259s461fbb35gb0b3cc7099204103@mail.gmail.com> Message-ID: <028701c87728$e87f1960$4b3a8343@SusanOne> When we wrote the book on Express, it didn't support Reporting Services. We were working with the beta (what a royal pia -- worst betas ever). It's possible that once it was released they got so many requests/complaints that they added it, but I really don't know Arthur -- I haven't kept up with Express as I should've. I really thought that would be my last tech book and I had planned to give up tech articles too -- so much for best laid plans. :( Susan H. > Puzzling thing. In the chart Dan pointed to, it appears that the basic > edition doesn't contain Reporting Services. But I just installed it and it > appears to. Maybe that chart predates some revised version of the basic > express edition. From Gustav at cactus.dk Sun Feb 24 16:10:51 2008 From: Gustav at cactus.dk (Gustav Brock) Date: Sun, 24 Feb 2008 23:10:51 +0100 Subject: [dba-SQLServer] SQL 2005 Express v. SQL 2005 Express withAdvancedServices Message-ID: Hi Susan That seems to be so: http://www.microsoft.com/technet/prodtechnol/sql/2005/msde2sqlexpress.mspx Reporting Services Like MSDE, SQL Server 2005 Express does not possess business intelligence (BI) features such as Analysis Services, Integration Services, or data mining. However, SQL Server 2005 Express does provide support for Reporting Services. While the initial version of SQL Server 2005 Express did not include support for Reporting Services, it is now available via separate downloads. SQL Server 2005 Express Edition with Advanced Services provides the Report Server. The SQL Server 2005 Express Toolkit provides the Business Intelligence Development Studio. SQL Server 2005 Express can act as a data source for relational data that is on your local server for Reporting Services. Plus, Reporting Services in SQL Server 2005 Express can render reports in Excel, PDF, Image, Print, and DHTML formats. The Report Manager utility in SQL Server 2005 Express manages reports. Reporting Services reports used in SQL Server 2005 Express are completely compatible with the Reporting Services in the other SQL Server 2005 editions. >>> ssharkins at gmail.com 24-02-2008 22:04 >>> When we wrote the book on Express, it didn't support Reporting Services. We were working with the beta (what a royal pia -- worst betas ever). It's possible that once it was released they got so many requests/complaints that they added it, but I really don't know Arthur -- I haven't kept up with Express as I should've. I really thought that would be my last tech book and I had planned to give up tech articles too -- so much for best laid plans. :( Susan H. > Puzzling thing. In the chart Dan pointed to, it appears that the basic > edition doesn't contain Reporting Services. But I just installed it and it > appears to. Maybe that chart predates some revised version of the basic > express edition. From jwcolby at colbyconsulting.com Wed Feb 27 09:46:08 2008 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 27 Feb 2008 10:46:08 -0500 Subject: [dba-SQLServer] Arthur is famous again Message-ID: <036401c87957$df154d50$0401a8c0@M90> I just saw this in one of the many newsletters that I subscribe to. http://www.simple-talk.com/sql/sql-tools/the-database-from-hell/ John W. Colby Colby Consulting www.ColbyConsulting.com From Chris.Foote at uk.thalesgroup.com Wed Feb 27 10:01:20 2008 From: Chris.Foote at uk.thalesgroup.com (Foote, Chris) Date: Wed, 27 Feb 2008 16:01:20 -0000 Subject: [dba-SQLServer] Arthur is famous again Message-ID: <7303A459C921B5499AF732CCEEAD2B7F064D13DB@craws161660.int.rdel.co.uk> Gosh! The description of "the Database From Hell" seems vaguely familiar JC ;-) Regards Chris F > -----Original Message----- > From: dba-sqlserver-bounces at databaseadvisors.com > [mailto:dba-sqlserver-bounces at databaseadvisors.com]On Behalf > Of jwcolby > Sent: Wednesday, February 27, 2008 3:46 PM > To: 'Access Developers discussion and problem solving'; 'Discussion > concerning MS SQL Server' > Subject: [dba-SQLServer] Arthur is famous again > > > I just saw this in one of the many newsletters that I subscribe to. > > http://www.simple-talk.com/sql/sql-tools/the-database-from-hell/ > > > > 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 Feb 27 10:21:58 2008 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 27 Feb 2008 11:21:58 -0500 Subject: [dba-SQLServer] Arthur is famous again In-Reply-To: <7303A459C921B5499AF732CCEEAD2B7F064D13DB@craws161660.int.rdel.co.uk> References: <7303A459C921B5499AF732CCEEAD2B7F064D13DB@craws161660.int.rdel.co.uk> Message-ID: <036801c8795c$e0d5a8b0$0401a8c0@M90> ROTFL, yea it does. 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 Foote, Chris Sent: Wednesday, February 27, 2008 11:01 AM To: 'Discussion concerning MS SQL Server' Subject: Re: [dba-SQLServer] Arthur is famous again Gosh! The description of "the Database From Hell" seems vaguely familiar JC ;-) Regards Chris F > -----Original Message----- > From: dba-sqlserver-bounces at databaseadvisors.com > [mailto:dba-sqlserver-bounces at databaseadvisors.com]On Behalf Of > jwcolby > Sent: Wednesday, February 27, 2008 3:46 PM > To: 'Access Developers discussion and problem solving'; 'Discussion > concerning MS SQL Server' > Subject: [dba-SQLServer] Arthur is famous again > > > I just saw this in one of the many newsletters that I subscribe to. > > http://www.simple-talk.com/sql/sql-tools/the-database-from-hell/ > > > > 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 Wed Feb 27 17:46:33 2008 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 27 Feb 2008 18:46:33 -0500 Subject: [dba-SQLServer] Strange happening Message-ID: <038e01c8799a$fc1cf5e0$0401a8c0@M90> I have a pretty strange happening. I have a table with a PK which is an autoincrement int. When I create a view and include that field, then all order by clauses are ignored. IOW I create a query SELECT PKID, Fld1, fld2, fld3 ORDER By Fld3 DESC And when executed the data is ordered by PKID. If I save the view and then create a QUERY SELECT * from MyView ORDER BY Fld3 DESC then it does in fact order by fld3 desc order. If I save THAT SQL MSTATEMENT into another view and then execute that view, I am right back to ordered by PKID. I am at a loss as to why this happens and how to avoid it. I am trying to pull the first 1 million rows, ordered in a random order (for testing of another app) so I tried creating a view where I order by zip 4 DESC. I store the view and then export the view into a CSV file. The data comes out ordered on the PKID. Truly weird! I can't go further on my testing until I get this resolved. John W. Colby Colby Consulting www.ColbyConsulting.com From stuart at lexacorp.com.pg Wed Feb 27 18:25:54 2008 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Thu, 28 Feb 2008 10:25:54 +1000 Subject: [dba-SQLServer] Strange happening In-Reply-To: <038e01c8799a$fc1cf5e0$0401a8c0@M90> References: <038e01c8799a$fc1cf5e0$0401a8c0@M90> Message-ID: <47C68C32.16516.7BF5B529@stuart.lexacorp.com.pg> Have you tried ORDER BY NEWID() What happens if you do that? Does it still order by PK? (I often use SELECT TOP x PK, fld1,fld2 FROM tbl1 ORDER BY NEWID() to return x random records from a table.) On 27 Feb 2008 at 18:46, jwcolby wrote: > I have a pretty strange happening. > > I have a table with a PK which is an autoincrement int. When I create a > view and include that field, then all order by clauses are ignored. IOW I > create a query > > SELECT PKID, Fld1, fld2, fld3 ORDER By Fld3 DESC > > And when executed the data is ordered by PKID. > > If I save the view and then create a QUERY SELECT * from MyView ORDER BY > Fld3 DESC then it does in fact order by fld3 desc order. If I save THAT SQL > MSTATEMENT into another view and then execute that view, I am right back to > ordered by PKID. > > I am at a loss as to why this happens and how to avoid it. I am trying to > pull the first 1 million rows, ordered in a random order (for testing of > another app) so I tried creating a view where I order by zip 4 DESC. I > store the view and then export the view into a CSV file. The data comes out > ordered on the PKID. > > Truly weird! > > I can't go further on my testing until I get this resolved. > > 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 fhtapia at gmail.com Wed Feb 27 18:35:06 2008 From: fhtapia at gmail.com (Francisco Tapia) Date: Wed, 27 Feb 2008 16:35:06 -0800 Subject: [dba-SQLServer] Strange happening In-Reply-To: <038e01c8799a$fc1cf5e0$0401a8c0@M90> References: <038e01c8799a$fc1cf5e0$0401a8c0@M90> Message-ID: Maybe it's a plan that's been pre-buffered, try the following before you re-run the query again or sp_recompile viewname. DBCC DROPCLEANBUFFERS DBCC FREEPROCCACHE -- Francisco On Wed, Feb 27, 2008 at 3:46 PM, jwcolby wrote: > I have a pretty strange happening. > > I have a table with a PK which is an autoincrement int. When I create a > view and include that field, then all order by clauses are ignored. IOW I > create a query > > SELECT PKID, Fld1, fld2, fld3 ORDER By Fld3 DESC > > And when executed the data is ordered by PKID. > > If I save the view and then create a QUERY SELECT * from MyView ORDER BY > Fld3 DESC then it does in fact order by fld3 desc order. If I save THAT > SQL > MSTATEMENT into another view and then execute that view, I am right back > to > ordered by PKID. > > I am at a loss as to why this happens and how to avoid it. I am trying to > pull the first 1 million rows, ordered in a random order (for testing of > another app) so I tried creating a view where I order by zip 4 DESC. I > store the view and then export the view into a CSV file. The data comes > out > ordered on the PKID. > > Truly weird! > > I can't go further on my testing until I get this resolved. > > 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 > > -- -Francisco http://sqlthis.blogspot.com | Tsql and More... From jlawrenc1 at shaw.ca Wed Feb 27 22:14:51 2008 From: jlawrenc1 at shaw.ca (Jim Lawrence) Date: Wed, 27 Feb 2008 20:14:51 -0800 Subject: [dba-SQLServer] Arthur is famous again In-Reply-To: <036401c87957$df154d50$0401a8c0@M90> References: <036401c87957$df154d50$0401a8c0@M90> Message-ID: <3D6BFE055AE34E62B7D4AB4BF44E1911@creativesystemdesigns.com> Both of you are famous... as soon as it was said that there were 800 columns I knew that definition only described a very few database in this world. Jim -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Wednesday, February 27, 2008 7:46 AM To: 'Access Developers discussion and problem solving'; 'Discussion concerning MS SQL Server' Subject: [dba-SQLServer] Arthur is famous again I just saw this in one of the many newsletters that I subscribe to. http://www.simple-talk.com/sql/sql-tools/the-database-from-hell/ 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 fuller.artful at gmail.com Thu Feb 28 06:24:58 2008 From: fuller.artful at gmail.com (Arthur Fuller) Date: Thu, 28 Feb 2008 07:24:58 -0500 Subject: [dba-SQLServer] Arthur is famous again In-Reply-To: <3D6BFE055AE34E62B7D4AB4BF44E1911@creativesystemdesigns.com> References: <036401c87957$df154d50$0401a8c0@M90> <3D6BFE055AE34E62B7D4AB4BF44E1911@creativesystemdesigns.com> Message-ID: <29f585dd0802280424v374c15a5m61ae5418e43ca5c5@mail.gmail.com> Yeah, a dead giveaway. Incidentally, in the original submission JC was mentioned by name but the editor removed the reference. To protect the guilty, I think. :) A. On 2/27/08, Jim Lawrence wrote: > > Both of you are famous... as soon as it was said that there were 800 > columns > I knew that definition only described a very few database in this world. > > > Jim > From fuller.artful at gmail.com Thu Feb 28 06:51:21 2008 From: fuller.artful at gmail.com (Arthur Fuller) Date: Thu, 28 Feb 2008 07:51:21 -0500 Subject: [dba-SQLServer] Arthur is famous again In-Reply-To: <3D6BFE055AE34E62B7D4AB4BF44E1911@creativesystemdesigns.com> References: <036401c87957$df154d50$0401a8c0@M90> <3D6BFE055AE34E62B7D4AB4BF44E1911@creativesystemdesigns.com> Message-ID: <29f585dd0802280451o7f63fb53yd0ea6012a9259bff@mail.gmail.com> I love the illustration that accompanies the piece. I was thinking I could use it as a business card, but it's only fair to give JC first dibs. A. On 2/27/08, Jim Lawrence wrote: > > Both of you are famous... as soon as it was said that there were 800 > columns > I knew that definition only described a very few database in this world. > > > Jim > > > -----Original Message----- > From: dba-sqlserver-bounces at databaseadvisors.com > > [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Wednesday, February 27, 2008 7:46 AM > To: 'Access Developers discussion and problem solving'; 'Discussion > concerning MS SQL Server' > > Subject: [dba-SQLServer] Arthur is famous again > > I just saw this in one of the many newsletters that I subscribe to. > > http://www.simple-talk.com/sql/sql-tools/the-database-from-hell/ > > > > 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 Thu Feb 28 06:53:36 2008 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 28 Feb 2008 07:53:36 -0500 Subject: [dba-SQLServer] Strange happening In-Reply-To: References: <038e01c8799a$fc1cf5e0$0401a8c0@M90> Message-ID: <000001c87a08$f07510b0$0201a8c0@M90> I do have a cover index that includes all of the fields in my view, and PK is the leftmost (top) field in the index. I am thinking that perhaps it is pulling all of the data from that index and somehow that is causing the issue. 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 Francisco Tapia Sent: Wednesday, February 27, 2008 7:35 PM To: Discussion concerning MS SQL Server Subject: Re: [dba-SQLServer] Strange happening Maybe it's a plan that's been pre-buffered, try the following before you re-run the query again or sp_recompile viewname. DBCC DROPCLEANBUFFERS DBCC FREEPROCCACHE -- Francisco On Wed, Feb 27, 2008 at 3:46 PM, jwcolby wrote: > I have a pretty strange happening. > > I have a table with a PK which is an autoincrement int. When I create > a view and include that field, then all order by clauses are ignored. > IOW I create a query > > SELECT PKID, Fld1, fld2, fld3 ORDER By Fld3 DESC > > And when executed the data is ordered by PKID. > > If I save the view and then create a QUERY SELECT * from MyView ORDER > BY > Fld3 DESC then it does in fact order by fld3 desc order. If I save > THAT SQL MSTATEMENT into another view and then execute that view, I am > right back to ordered by PKID. > > I am at a loss as to why this happens and how to avoid it. I am > trying to pull the first 1 million rows, ordered in a random order > (for testing of another app) so I tried creating a view where I order > by zip 4 DESC. I store the view and then export the view into a CSV > file. The data comes out ordered on the PKID. > > Truly weird! > > I can't go further on my testing until I get this resolved. > > 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 > > -- -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 jwcolby at colbyconsulting.com Thu Feb 28 06:58:57 2008 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 28 Feb 2008 07:58:57 -0500 Subject: [dba-SQLServer] Arthur is famous again In-Reply-To: <29f585dd0802280424v374c15a5m61ae5418e43ca5c5@mail.gmail.com> References: <036401c87957$df154d50$0401a8c0@M90><3D6BFE055AE34E62B7D4AB4BF44E1911@creativesystemdesigns.com> <29f585dd0802280424v374c15a5m61ae5418e43ca5c5@mail.gmail.com> Message-ID: <000d01c87a09$aea6f210$0201a8c0@M90> ROTFL. They probably thought I designed the database and would be ashamed to see my name associated with it. ;-) 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 Arthur Fuller Sent: Thursday, February 28, 2008 7:25 AM To: Discussion concerning MS SQL Server Subject: Re: [dba-SQLServer] Arthur is famous again Yeah, a dead giveaway. Incidentally, in the original submission JC was mentioned by name but the editor removed the reference. To protect the guilty, I think. :) A. On 2/27/08, Jim Lawrence wrote: > > Both of you are famous... as soon as it was said that there were 800 > columns I knew that definition only described a very few database in > this world. > > > Jim > _______________________________________________ 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 Feb 28 07:00:18 2008 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 28 Feb 2008 08:00:18 -0500 Subject: [dba-SQLServer] Arthur is famous again In-Reply-To: <29f585dd0802280451o7f63fb53yd0ea6012a9259bff@mail.gmail.com> References: <036401c87957$df154d50$0401a8c0@M90><3D6BFE055AE34E62B7D4AB4BF44E1911@creativesystemdesigns.com> <29f585dd0802280451o7f63fb53yd0ea6012a9259bff@mail.gmail.com> Message-ID: <000e01c87a09$deee9090$0201a8c0@M90> LOL, You may have it. I am afraid of getting a reputation of designing databases that evoke that expression. 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 Arthur Fuller Sent: Thursday, February 28, 2008 7:51 AM To: Discussion concerning MS SQL Server Subject: Re: [dba-SQLServer] Arthur is famous again I love the illustration that accompanies the piece. I was thinking I could use it as a business card, but it's only fair to give JC first dibs. A. On 2/27/08, Jim Lawrence wrote: > > Both of you are famous... as soon as it was said that there were 800 > columns I knew that definition only described a very few database in > this world. > > > Jim > > > -----Original Message----- > From: dba-sqlserver-bounces at databaseadvisors.com > > [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of > jwcolby > Sent: Wednesday, February 27, 2008 7:46 AM > To: 'Access Developers discussion and problem solving'; 'Discussion > concerning MS SQL Server' > > Subject: [dba-SQLServer] Arthur is famous again > > I just saw this in one of the many newsletters that I subscribe to. > > http://www.simple-talk.com/sql/sql-tools/the-database-from-hell/ > > > > 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 fuller.artful at gmail.com Thu Feb 28 07:07:00 2008 From: fuller.artful at gmail.com (Arthur Fuller) Date: Thu, 28 Feb 2008 08:07:00 -0500 Subject: [dba-SQLServer] Strange happening In-Reply-To: <000001c87a08$f07510b0$0201a8c0@M90> References: <038e01c8799a$fc1cf5e0$0401a8c0@M90> <000001c87a08$f07510b0$0201a8c0@M90> Message-ID: <29f585dd0802280507k34393475l29d72f3dabe0be94@mail.gmail.com> I think that you could modify the index to include the NewID() column as Stuart suggested, and get the results you want. Alternatively, SELECT TOP n * FROM yourView ORDER BY NewID(). A. On 2/28/08, jwcolby wrote: > > I do have a cover index that includes all of the fields in my view, and PK > is the leftmost (top) field in the index. I am thinking that perhaps it > is > pulling all of the data from that index and somehow that is causing the > issue. > > From pauln at sqlserverbible.com Thu Feb 28 08:36:24 2008 From: pauln at sqlserverbible.com (Paul Nielsen) Date: Thu, 28 Feb 2008 07:36:24 -0700 Subject: [dba-SQLServer] Strange happening In-Reply-To: <29f585dd0802280507k34393475l29d72f3dabe0be94@mail.gmail.com> References: <038e01c8799a$fc1cf5e0$0401a8c0@M90> <000001c87a08$f07510b0$0201a8c0@M90> <29f585dd0802280507k34393475l29d72f3dabe0be94@mail.gmail.com> Message-ID: <032c01c87a17$4bf234a0$e3d69de0$@com> Order by is ignored in a view unless is has a top. The Top 100 percent trick works in some versions but not all versions (sp versions) of SQL Server. Using the top 100 percent trick to force an order by in a view is considered a bad practice. -Paul -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Arthur Fuller Sent: Thursday, February 28, 2008 6:07 AM To: Discussion concerning MS SQL Server Subject: Re: [dba-SQLServer] Strange happening I think that you could modify the index to include the NewID() column as Stuart suggested, and get the results you want. Alternatively, SELECT TOP n * FROM yourView ORDER BY NewID(). A. On 2/28/08, jwcolby wrote: > > I do have a cover index that includes all of the fields in my view, and PK > is the leftmost (top) field in the index. I am thinking that perhaps it > is > pulling all of the data from that index and somehow that is causing the > issue. > > _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com __________ NOD32 2908 (20080228) Information __________ This message was checked by NOD32 antivirus system. http://www.eset.com From pauln at sqlserverbible.com Thu Feb 28 08:38:28 2008 From: pauln at sqlserverbible.com (Paul Nielsen) Date: Thu, 28 Feb 2008 07:38:28 -0700 Subject: [dba-SQLServer] Strange happening In-Reply-To: <038e01c8799a$fc1cf5e0$0401a8c0@M90> References: <038e01c8799a$fc1cf5e0$0401a8c0@M90> Message-ID: <032d01c87a17$95fcfa80$c1f6ef80$@com> The issue with order by newID() is performance, add a tablesample clause to your tables in the from clause to speed up the random sampling. -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Wednesday, February 27, 2008 4:47 PM To: 'Discussion concerning MS SQL Server' Subject: [dba-SQLServer] Strange happening I have a pretty strange happening. I have a table with a PK which is an autoincrement int. When I create a view and include that field, then all order by clauses are ignored. IOW I create a query SELECT PKID, Fld1, fld2, fld3 ORDER By Fld3 DESC And when executed the data is ordered by PKID. If I save the view and then create a QUERY SELECT * from MyView ORDER BY Fld3 DESC then it does in fact order by fld3 desc order. If I save THAT SQL MSTATEMENT into another view and then execute that view, I am right back to ordered by PKID. I am at a loss as to why this happens and how to avoid it. I am trying to pull the first 1 million rows, ordered in a random order (for testing of another app) so I tried creating a view where I order by zip 4 DESC. I store the view and then export the view into a CSV file. The data comes out ordered on the PKID. Truly weird! I can't go further on my testing until I get this resolved. 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 __________ NOD32 2908 (20080228) Information __________ This message was checked by NOD32 antivirus system. http://www.eset.com From jwcolby at colbyconsulting.com Thu Feb 28 08:45:33 2008 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 28 Feb 2008 09:45:33 -0500 Subject: [dba-SQLServer] Strange happening In-Reply-To: <032c01c87a17$4bf234a0$e3d69de0$@com> References: <038e01c8799a$fc1cf5e0$0401a8c0@M90> <000001c87a08$f07510b0$0201a8c0@M90><29f585dd0802280507k34393475l29d72f3dabe0be94@mail.gmail.com> <032c01c87a17$4bf234a0$e3d69de0$@com> Message-ID: <001501c87a18$9319bb40$0201a8c0@M90> If order by is ignored in a view without a TOP, why is a TOP considered bad form? It sounds like a REQUIREMENT. 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 Paul Nielsen Sent: Thursday, February 28, 2008 9:36 AM To: 'Discussion concerning MS SQL Server' Subject: Re: [dba-SQLServer] Strange happening Order by is ignored in a view unless is has a top. The Top 100 percent trick works in some versions but not all versions (sp versions) of SQL Server. Using the top 100 percent trick to force an order by in a view is considered a bad practice. -Paul -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Arthur Fuller Sent: Thursday, February 28, 2008 6:07 AM To: Discussion concerning MS SQL Server Subject: Re: [dba-SQLServer] Strange happening I think that you could modify the index to include the NewID() column as Stuart suggested, and get the results you want. Alternatively, SELECT TOP n * FROM yourView ORDER BY NewID(). A. On 2/28/08, jwcolby wrote: > > I do have a cover index that includes all of the fields in my view, > and PK is the leftmost (top) field in the index. I am thinking that > perhaps it is pulling all of the data from that index and somehow that > is causing the issue. > > _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com __________ NOD32 2908 (20080228) Information __________ This message was checked by NOD32 antivirus system. http://www.eset.com _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From ebarro at verizon.net Thu Feb 28 08:53:28 2008 From: ebarro at verizon.net (Eric Barro) Date: Thu, 28 Feb 2008 06:53:28 -0800 Subject: [dba-SQLServer] Strange happening In-Reply-To: <032c01c87a17$4bf234a0$e3d69de0$@com> Message-ID: <0JWY00F0OE5PS3F2@vms173001.mailsrvcs.net> In fact in SQL Management Studio it forces the saved query for the view to use TOP 100 PERCENT even if you delete it, it will still insert that when you save the view. -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Paul Nielsen Sent: Thursday, February 28, 2008 6:36 AM To: 'Discussion concerning MS SQL Server' Subject: Re: [dba-SQLServer] Strange happening Order by is ignored in a view unless is has a top. The Top 100 percent trick works in some versions but not all versions (sp versions) of SQL Server. Using the top 100 percent trick to force an order by in a view is considered a bad practice. -Paul -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Arthur Fuller Sent: Thursday, February 28, 2008 6:07 AM To: Discussion concerning MS SQL Server Subject: Re: [dba-SQLServer] Strange happening I think that you could modify the index to include the NewID() column as Stuart suggested, and get the results you want. Alternatively, SELECT TOP n * FROM yourView ORDER BY NewID(). A. On 2/28/08, jwcolby wrote: > > I do have a cover index that includes all of the fields in my view, > and PK is the leftmost (top) field in the index. I am thinking that > perhaps it is pulling all of the data from that index and somehow that > is causing the issue. > > _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com __________ NOD32 2908 (20080228) Information __________ This message was checked by NOD32 antivirus system. http://www.eset.com _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From pauln at sqlserverbible.com Thu Feb 28 10:12:27 2008 From: pauln at sqlserverbible.com (Paul Nielsen) Date: Thu, 28 Feb 2008 09:12:27 -0700 Subject: [dba-SQLServer] Strange happening In-Reply-To: <001501c87a18$9319bb40$0201a8c0@M90> References: <038e01c8799a$fc1cf5e0$0401a8c0@M90> <000001c87a08$f07510b0$0201a8c0@M90><29f585dd0802280507k34393475l29d72f3dabe0be94@mail.gmail.com> <032c01c87a17$4bf234a0$e3d69de0$@com> <001501c87a18$9319bb40$0201a8c0@M90> Message-ID: <003901c87a24$b763ee10$262bca30$@com> By SQL definition, a view should not include any sort order. But top is useless without a sort order, so order by is allowed with a top. For example, a view that returns the top 5 salespersons would have to include the top and the order by. The Top 100 percent is a hack/trick to use an order by in a view. In SQL Server 2005 RTM the syntax is allowed but the QP detects the trick and ignores the order by. I think in one of the sp the order by again works, but it is not correct to order by in a view. -Paul -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, February 28, 2008 7:46 AM To: 'Discussion concerning MS SQL Server' Subject: Re: [dba-SQLServer] Strange happening If order by is ignored in a view without a TOP, why is a TOP considered bad form? It sounds like a REQUIREMENT. 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 Paul Nielsen Sent: Thursday, February 28, 2008 9:36 AM To: 'Discussion concerning MS SQL Server' Subject: Re: [dba-SQLServer] Strange happening Order by is ignored in a view unless is has a top. The Top 100 percent trick works in some versions but not all versions (sp versions) of SQL Server. Using the top 100 percent trick to force an order by in a view is considered a bad practice. -Paul -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Arthur Fuller Sent: Thursday, February 28, 2008 6:07 AM To: Discussion concerning MS SQL Server Subject: Re: [dba-SQLServer] Strange happening I think that you could modify the index to include the NewID() column as Stuart suggested, and get the results you want. Alternatively, SELECT TOP n * FROM yourView ORDER BY NewID(). A. On 2/28/08, jwcolby wrote: > > I do have a cover index that includes all of the fields in my view, > and PK is the leftmost (top) field in the index. I am thinking that > perhaps it is pulling all of the data from that index and somehow that > is causing the issue. > > _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com __________ NOD32 2908 (20080228) Information __________ This message was checked by NOD32 antivirus system. http://www.eset.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 __________ NOD32 2909 (20080228) Information __________ This message was checked by NOD32 antivirus system. http://www.eset.com From pauln at sqlserverbible.com Thu Feb 28 10:14:07 2008 From: pauln at sqlserverbible.com (Paul Nielsen) Date: Thu, 28 Feb 2008 09:14:07 -0700 Subject: [dba-SQLServer] Strange happening In-Reply-To: <0JWY00F0OE5PS3F2@vms173001.mailsrvcs.net> References: <032c01c87a17$4bf234a0$e3d69de0$@com> <0JWY00F0OE5PS3F2@vms173001.mailsrvcs.net> Message-ID: <003a01c87a24$f2a610c0$d7f23240$@com> SSMS is just a tool. Just as you've never want to develop production code using the gui, you never want to determine a best practice from what the gui does. -Paul -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Eric Barro Sent: Thursday, February 28, 2008 7:53 AM To: 'Discussion concerning MS SQL Server' Subject: Re: [dba-SQLServer] Strange happening In fact in SQL Management Studio it forces the saved query for the view to use TOP 100 PERCENT even if you delete it, it will still insert that when you save the view. -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Paul Nielsen Sent: Thursday, February 28, 2008 6:36 AM To: 'Discussion concerning MS SQL Server' Subject: Re: [dba-SQLServer] Strange happening Order by is ignored in a view unless is has a top. The Top 100 percent trick works in some versions but not all versions (sp versions) of SQL Server. Using the top 100 percent trick to force an order by in a view is considered a bad practice. -Paul -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Arthur Fuller Sent: Thursday, February 28, 2008 6:07 AM To: Discussion concerning MS SQL Server Subject: Re: [dba-SQLServer] Strange happening I think that you could modify the index to include the NewID() column as Stuart suggested, and get the results you want. Alternatively, SELECT TOP n * FROM yourView ORDER BY NewID(). A. On 2/28/08, jwcolby wrote: > > I do have a cover index that includes all of the fields in my view, > and PK is the leftmost (top) field in the index. I am thinking that > perhaps it is pulling all of the data from that index and somehow that > is causing the issue. > > _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com __________ NOD32 2908 (20080228) Information __________ This message was checked by NOD32 antivirus system. http://www.eset.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 __________ NOD32 2909 (20080228) Information __________ This message was checked by NOD32 antivirus system. http://www.eset.com From jwcolby at colbyconsulting.com Thu Feb 28 11:10:36 2008 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 28 Feb 2008 12:10:36 -0500 Subject: [dba-SQLServer] Strange happening In-Reply-To: <003901c87a24$b763ee10$262bca30$@com> References: <038e01c8799a$fc1cf5e0$0401a8c0@M90> <000001c87a08$f07510b0$0201a8c0@M90><29f585dd0802280507k34393475l29d72f3dabe0be94@mail.gmail.com> <032c01c87a17$4bf234a0$e3d69de0$@com><001501c87a18$9319bb40$0201a8c0@M90> <003901c87a24$b763ee10$262bca30$@com> Message-ID: <002201c87a2c$d6b9ce30$0201a8c0@M90> Paul, I make no claim to be an SQL expert, so fill me in on why a view should not be ordered - other than "by SQL Definition". I always just kind of thought that a view was a stored "view" (look at) some set of data. It makes perfect sense to order a "look at" some set of data. I might want a view of sales people ordered by name, or a view of orders in reverse chrono order etc. So what is a VIEW and why would it not be ordered? And if the view can not be ordered, then how do you get the data from a view ordered? 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 Paul Nielsen Sent: Thursday, February 28, 2008 11:12 AM To: 'Discussion concerning MS SQL Server' Subject: Re: [dba-SQLServer] Strange happening By SQL definition, a view should not include any sort order. But top is useless without a sort order, so order by is allowed with a top. For example, a view that returns the top 5 salespersons would have to include the top and the order by. The Top 100 percent is a hack/trick to use an order by in a view. In SQL Server 2005 RTM the syntax is allowed but the QP detects the trick and ignores the order by. I think in one of the sp the order by again works, but it is not correct to order by in a view. -Paul -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, February 28, 2008 7:46 AM To: 'Discussion concerning MS SQL Server' Subject: Re: [dba-SQLServer] Strange happening If order by is ignored in a view without a TOP, why is a TOP considered bad form? It sounds like a REQUIREMENT. 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 Paul Nielsen Sent: Thursday, February 28, 2008 9:36 AM To: 'Discussion concerning MS SQL Server' Subject: Re: [dba-SQLServer] Strange happening Order by is ignored in a view unless is has a top. The Top 100 percent trick works in some versions but not all versions (sp versions) of SQL Server. Using the top 100 percent trick to force an order by in a view is considered a bad practice. -Paul -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Arthur Fuller Sent: Thursday, February 28, 2008 6:07 AM To: Discussion concerning MS SQL Server Subject: Re: [dba-SQLServer] Strange happening I think that you could modify the index to include the NewID() column as Stuart suggested, and get the results you want. Alternatively, SELECT TOP n * FROM yourView ORDER BY NewID(). A. On 2/28/08, jwcolby wrote: > > I do have a cover index that includes all of the fields in my view, > and PK is the leftmost (top) field in the index. I am thinking that > perhaps it is pulling all of the data from that index and somehow that > is causing the issue. > > _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com __________ NOD32 2908 (20080228) Information __________ This message was checked by NOD32 antivirus system. http://www.eset.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 __________ NOD32 2909 (20080228) Information __________ This message was checked by NOD32 antivirus system. http://www.eset.com _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From word_diva at hotmail.com Thu Feb 28 11:42:40 2008 From: word_diva at hotmail.com (Nancy Lytle) Date: Thu, 28 Feb 2008 12:42:40 -0500 Subject: [dba-SQLServer] Strange happening In-Reply-To: <002201c87a2c$d6b9ce30$0201a8c0@M90> References: <038e01c8799a$fc1cf5e0$0401a8c0@M90> <000001c87a08$f07510b0$0201a8c0@M90><29f585dd0802280507k34393475l29d72f3dabe0be94@mail.gmail.com> <032c01c87a17$4bf234a0$e3d69de0$@com><001501c87a18$9319bb40$0201a8c0@M90> <003901c87a24$b763ee10$262bca30$@com> <002201c87a2c$d6b9ce30$0201a8c0@M90> Message-ID: Don't think of a view as a 'view' but as a virtual table, and in a table there is no 'sort' order. You would have to query a view, just like a table to get a sort order. Hope this helps,Nancy Lytle N_Lytle at terpalum.umd.edu > From: jwcolby at colbyconsulting.com> To: dba-sqlserver at databaseadvisors.com> Date: Thu, 28 Feb 2008 12:10:36 -0500> Subject: Re: [dba-SQLServer] Strange happening> > Paul,> > I make no claim to be an SQL expert, so fill me in on why a view should not> be ordered - other than "by SQL Definition". I always just kind of thought> that a view was a stored "view" (look at) some set of data. It makes> perfect sense to order a "look at" some set of data. I might want a view of> sales people ordered by name, or a view of orders in reverse chrono order> etc.> > So what is a VIEW and why would it not be ordered? And if the view can not> be ordered, then how do you get the data from a view ordered? > > > 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 Paul> Nielsen> Sent: Thursday, February 28, 2008 11:12 AM> To: 'Discussion concerning MS SQL Server'> Subject: Re: [dba-SQLServer] Strange happening> > By SQL definition, a view should not include any sort order. But top is> useless without a sort order, so order by is allowed with a top. For> example, a view that returns the top 5 salespersons would have to include> the top and the order by. The Top 100 percent is a hack/trick to use an> order by in a view. In SQL Server 2005 RTM the syntax is allowed but the QP> detects the trick and ignores the order by. I think in one of the sp the> order by again works, but it is not correct to order by in a view. > > -Paul > > -----Original Message-----> From: dba-sqlserver-bounces at databaseadvisors.com> [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of jwcolby> Sent: Thursday, February 28, 2008 7:46 AM> To: 'Discussion concerning MS SQL Server'> Subject: Re: [dba-SQLServer] Strange happening> > If order by is ignored in a view without a TOP, why is a TOP considered bad> form? It sounds like a REQUIREMENT. > > > 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 Paul> Nielsen> Sent: Thursday, February 28, 2008 9:36 AM> To: 'Discussion concerning MS SQL Server'> Subject: Re: [dba-SQLServer] Strange happening> > Order by is ignored in a view unless is has a top. The Top 100 percent trick> works in some versions but not all versions (sp versions) of SQL Server.> Using the top 100 percent trick to force an order by in a view is considered> a bad practice. > > -Paul > > -----Original Message-----> From: dba-sqlserver-bounces at databaseadvisors.com> [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Arthur> Fuller> Sent: Thursday, February 28, 2008 6:07 AM> To: Discussion concerning MS SQL Server> Subject: Re: [dba-SQLServer] Strange happening> > I think that you could modify the index to include the NewID() column as> Stuart suggested, and get the results you want. Alternatively, SELECT TOP n> * FROM yourView ORDER BY NewID().> > A.> > On 2/28/08, jwcolby wrote:> >> > I do have a cover index that includes all of the fields in my view, > > and PK is the leftmost (top) field in the index. I am thinking that > > perhaps it is pulling all of the data from that index and somehow that > > is causing the issue.> >> >> _______________________________________________> dba-SQLServer mailing list> dba-SQLServer at databaseadvisors.com> http://databaseadvisors.com/mailman/listinfo/dba-sqlserver> http://www.databaseadvisors.com> > > __________ NOD32 2908 (20080228) Information __________> > This message was checked by NOD32 antivirus system.> http://www.eset.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> > > __________ NOD32 2909 (20080228) Information __________> > This message was checked by NOD32 antivirus system.> http://www.eset.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 pauln at sqlserverbible.com Thu Feb 28 12:27:11 2008 From: pauln at sqlserverbible.com (Paul Nielsen) Date: Thu, 28 Feb 2008 11:27:11 -0700 Subject: [dba-SQLServer] Strange happening In-Reply-To: References: <038e01c8799a$fc1cf5e0$0401a8c0@M90> <000001c87a08$f07510b0$0201a8c0@M90><29f585dd0802280507k34393475l29d72f3dabe0be94@mail.gmail.com> <032c01c87a17$4bf234a0$e3d69de0$@com><001501c87a18$9319bb40$0201a8c0@M90> <003901c87a24$b763ee10$262bca30$@com> <002201c87a2c$d6b9ce30$0201a8c0@M90> Message-ID: <003f01c87a37$8bc850d0$a358f270$@com> A view is nothing more than a saved query. There's no virtual table, no saved data. The order by is supposed to be added by the outer query that selects from the view. The theory is that the view is used to "project" certain columns, but the order by belongs in the outermost query, not in a view or subquery. Data sources (table, views, subqueries, Xqueries, full-text search, etc) don't have a sort order. The fact that you can Open View and see the results of a view in SSMS is less than correct. Behind the scenes, SSMS is wrapping the view in a select * from view. -Paul -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Nancy Lytle Sent: Thursday, February 28, 2008 10:43 AM To: Discussion concerning MS SQL Server Subject: Re: [dba-SQLServer] Strange happening Don't think of a view as a 'view' but as a virtual table, and in a table there is no 'sort' order. You would have to query a view, just like a table to get a sort order. Hope this helps,Nancy Lytle N_Lytle at terpalum.umd.edu > From: jwcolby at colbyconsulting.com> To: dba-sqlserver at databaseadvisors.com> Date: Thu, 28 Feb 2008 12:10:36 -0500> Subject: Re: [dba-SQLServer] Strange happening> > Paul,> > I make no claim to be an SQL expert, so fill me in on why a view should not> be ordered - other than "by SQL Definition". I always just kind of thought> that a view was a stored "view" (look at) some set of data. It makes> perfect sense to order a "look at" some set of data. I might want a view of> sales people ordered by name, or a view of orders in reverse chrono order> etc.> > So what is a VIEW and why would it not be ordered? And if the view can not> be ordered, then how do you get the data from a view ordered? > > > 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 Paul> Nielsen> Sent: Thursday, February 28, 2008 11:12 AM> To: 'Discussion concerning! MS SQL Server'> Subject: Re: [dba-SQLServer] Strange happening> > By SQL definition, a view should not include any sort order. But top is> useless without a sort order, so order by is allowed with a top. For> example, a view that returns the top 5 salespersons would have to include> the top and the order by. The Top 100 percent is a hack/trick to use an> order by in a view. In SQL Server 2005 RTM the syntax is allowed but the QP> detects the trick and ignores the order by. I think in one of the sp the> order by again works, but it is not correct to order by in a view. > > -Paul > > -----Original Message-----> From: dba-sqlserver-bounces at databaseadvisors.com> [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of jwcolby> Sent: Thursday, February 28, 2008 7:46 AM> To: 'Discussion concerning MS SQL Server'> Subject: Re: [dba-SQLServer] Strange happening> > If order by is ignored in a view without a TOP, why is a TOP considered bad> form? It sounds like a REQUIREMEN! T. > > > 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 Paul> Nielsen> Sent: Thursday, February 28, 2008 9:36 AM> To: 'Discussion concerning MS SQL Server'> Subject: Re: [dba-SQLServer] Strange happening> > Order by is ignored in a view unless is has a top. The Top 100 percent trick> works in some versions but not all versions (sp versions) of SQL Server.> Using the top 100 percent trick to force an order by in a view is considered> a bad practice. > > -Paul > > -----Original Message-----> From: dba-sqlserver-bounces at databaseadvisors.com> [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Arthur> Fuller> Sent: Thursday, February 28, 2008 6:07 AM> To: Discussion concerning MS SQL Server> Subject: Re: [dba-SQLServer] Strange happening> > I think that you could modify the index to include the NewID() column as> Stuart suggested, and get the results you want. Alternatively, SELECT T! OP n> * FROM yourView ORDER BY NewID().> > A.> > On 2/28/08, jwcolby wrote:> >> > I do have a cover index that includes all of the fields in my view, > > and PK is the leftmost (top) field in the index. I am thinking that > > perhaps it is pulling all of the data from that index and somehow that > > is causing the issue.> >> >> _______________________________________________> dba-SQLServer mailing list> dba-SQLServer at databaseadvisors.com> http://databaseadvisors.com/mailman/listinfo/dba-sqlserver> http://www.databaseadvisors.com> > > __________ NOD32 2908 (20080228) Information __________> > This message was checked by NOD32 antivirus system.> http://www.eset.com> > > _______________________________________________> dba-SQLServer mailing list> dba-SQLServer at databaseadvisors.com> http://databaseadvisors.com/mailman/listinfo/dba-sqlserver> http://www.databaseadvisors.com> > _______________________________________________> dba-SQLServer mailing li! st> dba-SQLServer at databaseadvisors.com> http://databaseadvisors.com/ma ilman/listinfo/dba-sqlserver> http://www.databaseadvisors.com> > > __________ NOD32 2909 (20080228) Information __________> > This message was checked by NOD32 antivirus system.> http://www.eset.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 __________ NOD32 2909 (20080228) Information __________ This message was checked by NOD32 antivirus system. http://www.eset.com From jwcolby at colbyconsulting.com Thu Feb 28 14:38:55 2008 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 28 Feb 2008 15:38:55 -0500 Subject: [dba-SQLServer] Cnts in sets Message-ID: <005601c87a49$f0c8ec80$0201a8c0@M90> I have a table with 50 million records, which is a subset of a bigger table of 65 million records. IOW, of 65 million records, only about 50 million were selected for inclusion in the smaller table. The reason for this is that of the 65 million records, ~15 million had addresses that were undeliverable. I need a way to "view" or understand the distribution of PKIDs across that table. Back in the beginning I performed a very manual labor intensive task of processing these records through accuzip (address validation) where I had to break the 65 million records down into CSV files of ~1.5 million records, export them out to Accuzip, then reimport the validated results back into SQL Server, filter out bad records etc. I have discovered a "hole" in my results where there are no PKIDs across a range of hundreds of thousands of records. I do not know how big the "hole" is. Under normal circumstances (a visual view for example) you will see a few missing PKIDs in a range of 20 or 30, but never consecutive sets of missing records. But I have at least one "hole" where hundreds of thousands are missing. I need a way to find the "edges" of the hole of the missing PKIDs. IE I need to view the distribution of numbers across the range of numbers. It should be a "flat line" if you will where every once in awhile a number is missing, but where the hole is will be a drop to zero for an extended range. Or something. I have no idea how to "see" this data. I have a process that is exporting the validated records back out to be revalidated (people move). It is this export program (which I wrote) that discovered the hole, and I can if necessary use this program to find the hole but I thought some of you folks might know of a way to do this in SQL. Something like specify a range of numbers, a from/to and get a count, rinse / repeat. I did this manually to verify that a 1 million record range came up about 400 K short of the normal - ~800K is a "normal" count within a given million records, the "hole" only had ~400K records. BTW, I found the hole because I normally export "100K" records at a time into a file , and was filling a recordset with a WHERE PKID >=X and <=X+100K (which of course does not provide 100K but around 80K) and was looking for an empty recordset to tell me that I was done. Well... when I hit the "hole" I got the empty recordset and my process was saying it was done, except it had only exported about twenty 1 million record files out of a total 50 million records. oooops. So, I have a hole. I need to know if there are any other holes (smaller than my 100k export piece) but I really need a generic way to sense such a hole in my PKs. Any ideas? John W. Colby Colby Consulting www.ColbyConsulting.com