From jwcolby at colbyconsulting.com Thu Apr 3 09:56:59 2008 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 3 Apr 2008 10:56:59 -0400 Subject: [dba-SQLServer] It kinds of describes us all Message-ID: <000301c8959a$f8774f50$0601a8c0@M90> I ran across this in one of the newsletters I get. I read it with amusement, but after a little reflection I realized I too have a bit of this "new man". In order to survive in this high tech world it takes a bit of "I can do that" attitude when faced with stuff we have never seen before. Of course we then actually go figure it out and do it. http://www.simple-talk.com/opinion/opinion-pieces/the-new-man/ John W. Colby Colby Consulting www.ColbyConsulting.com From scapistrant at symphonyinfo.com Fri Apr 4 07:55:44 2008 From: scapistrant at symphonyinfo.com (steve) Date: Fri, 4 Apr 2008 07:55:44 -0500 Subject: [dba-SQLServer] Newbie resources In-Reply-To: <580B8DAE8E3A4246874F1902228F0CEB@symphony.symphonyinfo.com> References: <004701c833d7$99526c00$647aa8c0@M90><010d01c835e5$6424b7d0$800101df@fci.local><00e101c835e9$d49ab560$647aa8c0@M90> <580B8DAE8E3A4246874F1902228F0CEB@symphony.symphonyinfo.com> Message-ID: <19618268FA3946BB8AE22F870FF8A5BC@symphony.symphonyinfo.com> I owe a belated thank you to all who answered this Q. Steve Capistrant Symphony Information Services www.symphonyinfo.com Email: scapistrant at symphonyinfo.com Direct phone: 612-237-0075 Main Phone: 763-391-7400 ext 801 Skype: steve.capistrant -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of steve Sent: Monday, March 03, 2008 9:22 AM To: dba-sqlserver at databaseadvisors.com Subject: [dba-SQLServer] Newbie resources Ok, after 12 years of focusing on Access and using SQL Server only occasionally (treating it just as another table via and ODBC connection) I'm ready to plunge in. Can anyone provide advice on the best current resources for getting a good start? I'm sure this question is asked frequently, but by its very nature, the answer probably changes every 6 months. Steve Capistrant Symphony Information Services www.symphonyinfo.com Email: scapistrant at symphonyinfo.com Skype: steve.capistrant _______________________________________________ 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 Apr 4 08:09:33 2008 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 4 Apr 2008 09:09:33 -0400 Subject: [dba-SQLServer] Newbie resources In-Reply-To: <19618268FA3946BB8AE22F870FF8A5BC@symphony.symphonyinfo.com> References: <004701c833d7$99526c00$647aa8c0@M90><010d01c835e5$6424b7d0$800101df@fci.local><00e101c835e9$d49ab560$647aa8c0@M90><580B8DAE8E3A4246874F1902228F0CEB@symphony.symphonyinfo.com> <19618268FA3946BB8AE22F870FF8A5BC@symphony.symphonyinfo.com> Message-ID: <001601c89655$2090db90$0601a8c0@M90> LOL. Given how long it took you to respond, I am guessing that the answer provided is already out of date. ;-) 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 steve Sent: Friday, April 04, 2008 8:56 AM To: 'Discussion concerning MS SQL Server' Subject: Re: [dba-SQLServer] Newbie resources I owe a belated thank you to all who answered this Q. Steve Capistrant Symphony Information Services www.symphonyinfo.com Email: scapistrant at symphonyinfo.com Direct phone: 612-237-0075 Main Phone: 763-391-7400 ext 801 Skype: steve.capistrant -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of steve Sent: Monday, March 03, 2008 9:22 AM To: dba-sqlserver at databaseadvisors.com Subject: [dba-SQLServer] Newbie resources Ok, after 12 years of focusing on Access and using SQL Server only occasionally (treating it just as another table via and ODBC connection) I'm ready to plunge in. Can anyone provide advice on the best current resources for getting a good start? I'm sure this question is asked frequently, but by its very nature, the answer probably changes every 6 months. Steve Capistrant Symphony Information Services www.symphonyinfo.com Email: scapistrant at symphonyinfo.com Skype: steve.capistrant _______________________________________________ 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 Tue Apr 8 13:37:07 2008 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 8 Apr 2008 14:37:07 -0400 Subject: [dba-SQLServer] The 2008 "stuff" Message-ID: <000101c899a7$8d941720$0601a8c0@M90> I just got back from the intro event and am wondering who is using this stuff. I got released 2008 Visual Studio as well as released Windows Enterprise 2008 (x32 and x64). The SQL Server is not released however with a February CTP available (which I am downloading) in x32 and x64. So has anyone installed this and using it for real? Also does anyone have any knowledge about how this stuff will fit into the Action Pack? At this time SQL Server 2005 and Windows 2003 is the available there. John W. Colby Colby Consulting www.ColbyConsulting.com From dwaters at usinternet.com Tue Apr 8 14:05:01 2008 From: dwaters at usinternet.com (Dan Waters) Date: Tue, 8 Apr 2008 14:05:01 -0500 Subject: [dba-SQLServer] The 2008 "stuff" In-Reply-To: <000101c899a7$8d941720$0601a8c0@M90> References: <000101c899a7$8d941720$0601a8c0@M90> Message-ID: <000301c899ab$729824d0$0300a8c0@danwaters> Hi John, I got some of the same things - my goal was really to get a copy of VS 2008 in case I ever wanted to develop in .Net. I know I'll never use the Server 2008 software. SQL Server 2008 - I'm just now planning to move to SQL Server 2005! I also got a copy of Vista Ultimate w/SP1. Wasn't expecting that - but I'll install it eventually. This also came with Windows Live Services, and a 90 day trial of Windows Live OneCare. I probably won't use these. This is the third launch event I've been to. This time I showed up about noon. Gave my registration bar code to the gal at the desk. Asked her when the software was available to pick up and she gave it to me right then. Then I went downstairs to get a lunch - they were giving away insulated lunch cooler bags (MS branded of course) which could hold two lunches and are actually pretty nice. Then I went home and back to work. No sleepy seminars this time. Dan -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Tuesday, April 08, 2008 1:37 PM To: 'Access Developers discussion and problem solving'; 'Discussion of Hardware and Software issues'; dba-sqlserver at databaseadvisors.com Subject: [dba-SQLServer] The 2008 "stuff" I just got back from the intro event and am wondering who is using this stuff. I got released 2008 Visual Studio as well as released Windows Enterprise 2008 (x32 and x64). The SQL Server is not released however with a February CTP available (which I am downloading) in x32 and x64. So has anyone installed this and using it for real? Also does anyone have any knowledge about how this stuff will fit into the Action Pack? At this time SQL Server 2005 and Windows 2003 is the available there. 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 Apr 9 01:44:15 2008 From: fhtapia at gmail.com (Francisco Tapia) Date: Tue, 8 Apr 2008 23:44:15 -0700 Subject: [dba-SQLServer] The 2008 "stuff" In-Reply-To: <000301c899ab$729824d0$0300a8c0@danwaters> References: <000101c899a7$8d941720$0601a8c0@M90> <000301c899ab$729824d0$0300a8c0@danwaters> Message-ID: Dan, Where did you attend the event? I went to the one in Anaheim, showed up about 8am, went through the demo's etc for Sql 2008. etc, but I didn't get a lunch bag in a cooler... man i missed out! :O On Tue, Apr 8, 2008 at 12:05 PM, Dan Waters wrote: > Hi John, > > I got some of the same things - my goal was really to get a copy of VS > 2008 > in case I ever wanted to develop in .Net. > > I know I'll never use the Server 2008 software. > > SQL Server 2008 - I'm just now planning to move to SQL Server 2005! > > I also got a copy of Vista Ultimate w/SP1. Wasn't expecting that - but > I'll > install it eventually. This also came with Windows Live Services, and a > 90 > day trial of Windows Live OneCare. I probably won't use these. > > This is the third launch event I've been to. This time I showed up about > noon. Gave my registration bar code to the gal at the desk. Asked her > when > the software was available to pick up and she gave it to me right then. > Then I went downstairs to get a lunch - they were giving away insulated > lunch cooler bags (MS branded of course) which could hold two lunches and > are actually pretty nice. Then I went home and back to work. No sleepy > seminars this time. > > Dan > > -----Original Message----- > From: dba-sqlserver-bounces at databaseadvisors.com > [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Tuesday, April 08, 2008 1:37 PM > To: 'Access Developers discussion and problem solving'; 'Discussion of > Hardware and Software issues'; dba-sqlserver at databaseadvisors.com > Subject: [dba-SQLServer] The 2008 "stuff" > > I just got back from the intro event and am wondering who is using this > stuff. I got released 2008 Visual Studio as well as released Windows > Enterprise 2008 (x32 and x64). The SQL Server is not released however > with > a February CTP available (which I am downloading) in x32 and x64. > > So has anyone installed this and using it for real? > > Also does anyone have any knowledge about how this stuff will fit into the > Action Pack? At this time SQL Server 2005 and Windows 2003 is the > available > there. > > 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 > > -- -Francisco http://sqlthis.blogspot.com | Tsql and More... From dwaters at usinternet.com Wed Apr 9 06:58:54 2008 From: dwaters at usinternet.com (Dan Waters) Date: Wed, 9 Apr 2008 06:58:54 -0500 Subject: [dba-SQLServer] The 2008 "stuff" In-Reply-To: References: <000101c899a7$8d941720$0601a8c0@M90><000301c899ab$729824d0$0300a8c0@danwaters> Message-ID: <001201c89a39$15865e40$0300a8c0@danwaters> I went to the one in Minneapolis. They did seem to have a limited number and I happened to be one of the first people there for lunch - guess I got lucky! Dan -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Francisco Tapia Sent: Wednesday, April 09, 2008 1:44 AM To: Discussion concerning MS SQL Server Subject: Re: [dba-SQLServer] The 2008 "stuff" Dan, Where did you attend the event? I went to the one in Anaheim, showed up about 8am, went through the demo's etc for Sql 2008. etc, but I didn't get a lunch bag in a cooler... man i missed out! :O On Tue, Apr 8, 2008 at 12:05 PM, Dan Waters wrote: > Hi John, > > I got some of the same things - my goal was really to get a copy of VS > 2008 > in case I ever wanted to develop in .Net. > > I know I'll never use the Server 2008 software. > > SQL Server 2008 - I'm just now planning to move to SQL Server 2005! > > I also got a copy of Vista Ultimate w/SP1. Wasn't expecting that - but > I'll > install it eventually. This also came with Windows Live Services, and a > 90 > day trial of Windows Live OneCare. I probably won't use these. > > This is the third launch event I've been to. This time I showed up about > noon. Gave my registration bar code to the gal at the desk. Asked her > when > the software was available to pick up and she gave it to me right then. > Then I went downstairs to get a lunch - they were giving away insulated > lunch cooler bags (MS branded of course) which could hold two lunches and > are actually pretty nice. Then I went home and back to work. No sleepy > seminars this time. > > Dan > > -----Original Message----- > From: dba-sqlserver-bounces at databaseadvisors.com > [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Tuesday, April 08, 2008 1:37 PM > To: 'Access Developers discussion and problem solving'; 'Discussion of > Hardware and Software issues'; dba-sqlserver at databaseadvisors.com > Subject: [dba-SQLServer] The 2008 "stuff" > > I just got back from the intro event and am wondering who is using this > stuff. I got released 2008 Visual Studio as well as released Windows > Enterprise 2008 (x32 and x64). The SQL Server is not released however > with > a February CTP available (which I am downloading) in x32 and x64. > > So has anyone installed this and using it for real? > > Also does anyone have any knowledge about how this stuff will fit into the > Action Pack? At this time SQL Server 2005 and Windows 2003 is the > available > there. > > 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 > > -- -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 robert at webedb.com Thu Apr 10 07:30:45 2008 From: robert at webedb.com (Robert L. Stewart) Date: Thu, 10 Apr 2008 07:30:45 -0500 Subject: [dba-SQLServer] The 2008 "stuff" In-Reply-To: References: Message-ID: <200804101232.m3ACWEXB014179@databaseadvisors.com> I am using the VS2008. I will be getting a Win2008 server setup in a VM later this week. And will start on SQL 2008 at the same time I get the Win2008 install done. At the developer group that I teach, we are moving to VS2008 also. Robert At 12:00 PM 4/9/2008, you wrote: >Message: 1 >Date: Tue, 8 Apr 2008 14:37:07 -0400 >From: "jwcolby" >Subject: [dba-SQLServer] The 2008 "stuff" >To: "'Access Developers discussion and problem solving'" > , "'Discussion of > Hardware and Software > issues'" , > >Message-ID: <000101c899a7$8d941720$0601a8c0 at M90> >Content-Type: text/plain; charset="us-ascii" > >I just got back from the intro event and am wondering who is using this >stuff. I got released 2008 Visual Studio as well as released Windows >Enterprise 2008 (x32 and x64). The SQL Server is not released however with >a February CTP available (which I am downloading) in x32 and x64. > >So has anyone installed this and using it for real? > >Also does anyone have any knowledge about how this stuff will fit into the >Action Pack? At this time SQL Server 2005 and Windows 2003 is the available >there. > >John W. Colby >Colby Consulting >www.ColbyConsulting.com From jwcolby at colbyconsulting.com Mon Apr 14 08:35:41 2008 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 14 Apr 2008 09:35:41 -0400 Subject: [dba-SQLServer] Unable to open billing database Message-ID: <48035DAD.6090005@colbyconsulting.com> I have rather an emergency here. I am trying to get at my billing database which runs through an Access FE attached to tables in a SQL Server database. This was all working for many years on my old XP machine. The database was created in SQL Server Express AFAICR. When my laptop died I received a new one from Dell, and I installed Vista on it. I also installed Visual Studio 2008 in preparation for going there. It apparently installed PARTS of SQL Server 2005 and SQL Server Express. Management studio was NOT installed, so first I tried to install SQL Server 2005 but it told me that I could not install the user interface because what I already had installed was newer than what I was trying to install, however AFAICT Management Studio was NOT installed. Needless to say not having management studio is causing me problems doing anything with SQL Server. I subsequently downloaded and installed Management studio express which DID install. However (and here comes the problem) when I try to attach the billing database I get a message saying: An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.Express.ConnectionInfo) ------------------------------ Unable to open the physical file "C:\Colby Consulting\C2DbBilling\C2DbBilling.mdf". Operating system error 5: "5(Access is denied.)". (Microsoft SQL Server, Error: 5120) Unfortunately so much has changed that I have no clue where to start troubleshooting this problem. I googled the error but ended up with a bunch of "SQL Server can't start" stuff, but SQL Server is running as is Management Studio Express. Any ideas where to start figuring this thing out. My billing database is locked up in SQL Server at the moment and I can't get at it. 8-( John W. Colby www.ColbyConsulting.com From Gustav at cactus.dk Mon Apr 14 08:49:56 2008 From: Gustav at cactus.dk (Gustav Brock) Date: Mon, 14 Apr 2008 15:49:56 +0200 Subject: [dba-SQLServer] Unable to open billing database Message-ID: Hi John You can open Management Studio on another machine and connect to your server instance on the Vista machine. Also, can't you move your mdf file to the default data folder of your SQL Server? It should have been granted rights to this. If that fails too, you could move your mdf file to one of your other SQL Server installations on your server machines and connect to this from the Vista machine. /gustav >>> jwcolby at colbyconsulting.com 14-04-2008 15:35 >>> I have rather an emergency here. I am trying to get at my billing database which runs through an Access FE attached to tables in a SQL Server database. This was all working for many years on my old XP machine. The database was created in SQL Server Express AFAICR. When my laptop died I received a new one from Dell, and I installed Vista on it. I also installed Visual Studio 2008 in preparation for going there. It apparently installed PARTS of SQL Server 2005 and SQL Server Express. Management studio was NOT installed, so first I tried to install SQL Server 2005 but it told me that I could not install the user interface because what I already had installed was newer than what I was trying to install, however AFAICT Management Studio was NOT installed. Needless to say not having management studio is causing me problems doing anything with SQL Server. I subsequently downloaded and installed Management studio express which DID install. However (and here comes the problem) when I try to attach the billing database I get a message saying: An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.Express.ConnectionInfo) ------------------------------ Unable to open the physical file "C:\Colby Consulting\C2DbBilling\C2DbBilling.mdf". Operating system error 5: "5(Access is denied.)". (Microsoft SQL Server, Error: 5120) Unfortunately so much has changed that I have no clue where to start troubleshooting this problem. I googled the error but ended up with a bunch of "SQL Server can't start" stuff, but SQL Server is running as is Management Studio Express. Any ideas where to start figuring this thing out. My billing database is locked up in SQL Server at the moment and I can't get at it. 8-( From jwcolby at colbyconsulting.com Mon Apr 14 08:51:42 2008 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 14 Apr 2008 09:51:42 -0400 Subject: [dba-SQLServer] Unable to open billing database In-Reply-To: <48035DAD.6090005@colbyconsulting.com> References: <48035DAD.6090005@colbyconsulting.com> Message-ID: <4803616E.1010903@colbyconsulting.com> OK, the emergency is off but the mystery remains. I moved the database files off of the C: drive and onto a thumb drive and the Management Express can now mount the drives. So it appears to have something to do with the directory it is in on Vista. I know that the directory is read-only, and that prevented a zip file from being unzipped directly into a read-only directory. Perhaps Management Express / SQL Server also has issues running a database file in a read-only directory? jwcolby wrote: > I have rather an emergency here. I am trying to get at my billing > database which runs through an Access FE attached to tables in a SQL > Server database. This was all working for many years on my old XP > machine. The database was created in SQL Server Express AFAICR. > > When my laptop died I received a new one from Dell, and I installed > Vista on it. I also installed Visual Studio 2008 in preparation for > going there. It apparently installed PARTS of SQL Server 2005 and SQL > Server Express. > > Management studio was NOT installed, so first I tried to install SQL > Server 2005 but it told me that I could not install the user interface > because what I already had installed was newer than what I was trying to > install, however AFAICT Management Studio was NOT installed. Needless > to say not having management studio is causing me problems doing > anything with SQL Server. > > I subsequently downloaded and installed Management studio express which > DID install. However (and here comes the problem) when I try to attach > the billing database I get a message saying: > > > An exception occurred while executing a Transact-SQL statement or batch. > (Microsoft.SqlServer.Express.ConnectionInfo) > > ------------------------------ > > Unable to open the physical file "C:\Colby > Consulting\C2DbBilling\C2DbBilling.mdf". Operating system error 5: > "5(Access is denied.)". (Microsoft SQL Server, Error: 5120) > > Unfortunately so much has changed that I have no clue where to start > troubleshooting this problem. I googled the error but ended up with a > bunch of "SQL Server can't start" stuff, but SQL Server is running as is > Management Studio Express. > > Any ideas where to start figuring this thing out. My billing database > is locked up in SQL Server at the moment and I can't get at it. > > 8-( > > John W. Colby > www.ColbyConsulting.com > _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com > > -- John W. Colby www.ColbyConsulting.com From ab-mi at post3.tele.dk Mon Apr 14 09:00:44 2008 From: ab-mi at post3.tele.dk (Asger Blond) Date: Mon, 14 Apr 2008 16:00:44 +0200 Subject: [dba-SQLServer] Unable to open billing database In-Reply-To: <20080414133833.CEVG22792.fep26.mail.dk@databaseadvisors.com> Message-ID: <000001c89e37$ef2a0f00$2101a8c0@AB> John, Does the service account for your SQL Server have read/write permission on the folder hosting your database? Asger -----Oprindelig meddelelse----- Fra: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] P? vegne af jwcolby Sendt: 14. april 2008 15:36 Til: Dba-Sqlserver Emne: [dba-SQLServer] Unable to open billing database I have rather an emergency here. I am trying to get at my billing database which runs through an Access FE attached to tables in a SQL Server database. This was all working for many years on my old XP machine. The database was created in SQL Server Express AFAICR. When my laptop died I received a new one from Dell, and I installed Vista on it. I also installed Visual Studio 2008 in preparation for going there. It apparently installed PARTS of SQL Server 2005 and SQL Server Express. Management studio was NOT installed, so first I tried to install SQL Server 2005 but it told me that I could not install the user interface because what I already had installed was newer than what I was trying to install, however AFAICT Management Studio was NOT installed. Needless to say not having management studio is causing me problems doing anything with SQL Server. I subsequently downloaded and installed Management studio express which DID install. However (and here comes the problem) when I try to attach the billing database I get a message saying: An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.Express.ConnectionInfo) ------------------------------ Unable to open the physical file "C:\Colby Consulting\C2DbBilling\C2DbBilling.mdf". Operating system error 5: "5(Access is denied.)". (Microsoft SQL Server, Error: 5120) Unfortunately so much has changed that I have no clue where to start troubleshooting this problem. I googled the error but ended up with a bunch of "SQL Server can't start" stuff, but SQL Server is running as is Management Studio Express. Any ideas where to start figuring this thing out. My billing database is locked up in SQL Server at the moment and I can't get at it. 8-( John W. Colby 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 Apr 14 09:13:03 2008 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 14 Apr 2008 10:13:03 -0400 Subject: [dba-SQLServer] Unable to open billing database In-Reply-To: References: Message-ID: <4803666F.6000700@colbyconsulting.com> Gustav, > You can open Management Studio on another machine and connect to your server instance on the Vista machine. With the Management express I can now connect to the express server instance running on my laptop. > Also, can't you move your mdf file to the default data folder of your SQL Server? It should have been granted rights to this. I have never done this before and don't particularly want to as that directory is buried rather deeply down a directory path which I can never remember. To be honest I suspect that this is a "Vista security" thing. I never had an issue like this on XP, I could open my databases regardless of where they were located (on the current machine). I managed to get the database to attach by simply moving it to the root of a thumb drive. I detached, created a C2DbBilling directory on the thumb (which Vista claims is read-only) and moved the database files into that. Re-attached just fine. Detached, copied the directory to the C: drive. Could not attach the files. So it appears that Vista thinks the entire C: drive belongs to it and I have to jump through some (unknown) hoops to do "normal" stuff on that drive. That is just a guess of course as I really know nothing yet about Vista. Gustav Brock wrote: > Hi John > > You can open Management Studio on another machine and connect to your server instance on the Vista machine. > Also, can't you move your mdf file to the default data folder of your SQL Server? It should have been granted rights to this. > > If that fails too, you could move your mdf file to one of your other SQL Server installations on your server machines and connect to this from the Vista machine. > > /gustav > >>>> jwcolby at colbyconsulting.com 14-04-2008 15:35 >>> > I have rather an emergency here. I am trying to get at my billing > database which runs through an Access FE attached to tables in a SQL > Server database. This was all working for many years on my old XP > machine. The database was created in SQL Server Express AFAICR. > > When my laptop died I received a new one from Dell, and I installed > Vista on it. I also installed Visual Studio 2008 in preparation for > going there. It apparently installed PARTS of SQL Server 2005 and SQL > Server Express. > > Management studio was NOT installed, so first I tried to install SQL > Server 2005 but it told me that I could not install the user interface > because what I already had installed was newer than what I was trying to > install, however AFAICT Management Studio was NOT installed. Needless > to say not having management studio is causing me problems doing > anything with SQL Server. > > I subsequently downloaded and installed Management studio express which > DID install. However (and here comes the problem) when I try to attach > the billing database I get a message saying: > > > An exception occurred while executing a Transact-SQL statement or batch. > (Microsoft.SqlServer.Express.ConnectionInfo) > > ------------------------------ > > Unable to open the physical file "C:\Colby > Consulting\C2DbBilling\C2DbBilling.mdf". Operating system error 5: > "5(Access is denied.)". (Microsoft SQL Server, Error: 5120) > > Unfortunately so much has changed that I have no clue where to start > troubleshooting this problem. I googled the error but ended up with a > bunch of "SQL Server can't start" stuff, but SQL Server is running as is > Management Studio Express. > > Any ideas where to start figuring this thing out. My billing database > is locked up in SQL Server at the moment and I can't get at it. > > 8-( > > > > _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com > > -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Mon Apr 14 09:19:46 2008 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 14 Apr 2008 10:19:46 -0400 Subject: [dba-SQLServer] Unable to open billing database In-Reply-To: <000001c89e37$ef2a0f00$2101a8c0@AB> References: <000001c89e37$ef2a0f00$2101a8c0@AB> Message-ID: <48036802.800@colbyconsulting.com> Well... I have to say "I don't think so". The problem is that this is Vista, and I do not yet understand Vista. Let's take some examples: I tried to unzip a file directly into a directory in the C: drive of this machine. The unzip failed saying that it was read-only. I copied the zip to my documents directory and could unzip it there. I had to ask permission to copy the unzipped contents back to that directory. OTOH, I have an Access database FE in the same directory that I am trying to run this SQL Server DB from. I can open that MDB and modify it, so that mdb file is not read-only and I have permission to do that. The folder itself is marked read-only from the properties window. When I tell it to set it to not read-only it goes off without complaint to start marking all the files and folders underneath that directory as not read-only, but the folder itself is still read-only when it is done. So I don't have a clue what Vista / SQL Server is doing in this case. What I do know is that if I move the files off to a thumb drive they will attach just fine so it is SOMETHING about the C: drive in particular. Asger Blond wrote: > John, > Does the service account for your SQL Server have read/write permission on > the folder hosting your database? > > Asger > > -----Oprindelig meddelelse----- > Fra: dba-sqlserver-bounces at databaseadvisors.com > [mailto:dba-sqlserver-bounces at databaseadvisors.com] P? vegne af jwcolby > Sendt: 14. april 2008 15:36 > Til: Dba-Sqlserver > Emne: [dba-SQLServer] Unable to open billing database > > I have rather an emergency here. I am trying to get at my billing > database which runs through an Access FE attached to tables in a SQL > Server database. This was all working for many years on my old XP > machine. The database was created in SQL Server Express AFAICR. > > When my laptop died I received a new one from Dell, and I installed > Vista on it. I also installed Visual Studio 2008 in preparation for > going there. It apparently installed PARTS of SQL Server 2005 and SQL > Server Express. > > Management studio was NOT installed, so first I tried to install SQL > Server 2005 but it told me that I could not install the user interface > because what I already had installed was newer than what I was trying to > install, however AFAICT Management Studio was NOT installed. Needless > to say not having management studio is causing me problems doing > anything with SQL Server. > > I subsequently downloaded and installed Management studio express which > DID install. However (and here comes the problem) when I try to attach > the billing database I get a message saying: > > > An exception occurred while executing a Transact-SQL statement or batch. > (Microsoft.SqlServer.Express.ConnectionInfo) > > ------------------------------ > > Unable to open the physical file "C:\Colby > Consulting\C2DbBilling\C2DbBilling.mdf". Operating system error 5: > "5(Access is denied.)". (Microsoft SQL Server, Error: 5120) > > Unfortunately so much has changed that I have no clue where to start > troubleshooting this problem. I googled the error but ended up with a > bunch of "SQL Server can't start" stuff, but SQL Server is running as is > Management Studio Express. > > Any ideas where to start figuring this thing out. My billing database > is locked up in SQL Server at the moment and I can't get at it. > > 8-( > > John W. Colby > 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 > > -- John W. Colby www.ColbyConsulting.com From Gustav at cactus.dk Mon Apr 14 09:33:22 2008 From: Gustav at cactus.dk (Gustav Brock) Date: Mon, 14 Apr 2008 16:33:22 +0200 Subject: [dba-SQLServer] Unable to open billing database Message-ID: Hi John In the Manager you can look up the properties of a database and look for Files. Path is probably something like: C:\Program Files\Microsoft SQL Server\MSSQL\Data /gustav >>> jwcolby at colbyconsulting.com 14-04-2008 16:13 >>> Gustav, > You can open Management Studio on another machine and connect to your server instance on the Vista machine. With the Management express I can now connect to the express server instance running on my laptop. > Also, can't you move your mdf file to the default data folder of your SQL Server? It should have been granted rights to this. I have never done this before and don't particularly want to as that directory is buried rather deeply down a directory path which I can never remember. To be honest I suspect that this is a "Vista security" thing. I never had an issue like this on XP, I could open my databases regardless of where they were located (on the current machine). I managed to get the database to attach by simply moving it to the root of a thumb drive. I detached, created a C2DbBilling directory on the thumb (which Vista claims is read-only) and moved the database files into that. Re-attached just fine. Detached, copied the directory to the C: drive. Could not attach the files. So it appears that Vista thinks the entire C: drive belongs to it and I have to jump through some (unknown) hoops to do "normal" stuff on that drive. That is just a guess of course as I really know nothing yet about Vista. Gustav Brock wrote: > Hi John > > You can open Management Studio on another machine and connect to your server instance on the Vista machine. > Also, can't you move your mdf file to the default data folder of your SQL Server? It should have been granted rights to this. > > If that fails too, you could move your mdf file to one of your other SQL Server installations on your server machines and connect to this from the Vista machine. > > /gustav > >>>> jwcolby at colbyconsulting.com 14-04-2008 15:35 >>> > I have rather an emergency here. I am trying to get at my billing > database which runs through an Access FE attached to tables in a SQL > Server database. This was all working for many years on my old XP > machine. The database was created in SQL Server Express AFAICR. > > When my laptop died I received a new one from Dell, and I installed > Vista on it. I also installed Visual Studio 2008 in preparation for > going there. It apparently installed PARTS of SQL Server 2005 and SQL > Server Express. > > Management studio was NOT installed, so first I tried to install SQL > Server 2005 but it told me that I could not install the user interface > because what I already had installed was newer than what I was trying to > install, however AFAICT Management Studio was NOT installed. Needless > to say not having management studio is causing me problems doing > anything with SQL Server. > > I subsequently downloaded and installed Management studio express which > DID install. However (and here comes the problem) when I try to attach > the billing database I get a message saying: > > > An exception occurred while executing a Transact-SQL statement or batch. > (Microsoft.SqlServer.Express.ConnectionInfo) > > ------------------------------ > > Unable to open the physical file "C:\Colby > Consulting\C2DbBilling\C2DbBilling.mdf". Operating system error 5: > "5(Access is denied.)". (Microsoft SQL Server, Error: 5120) > > Unfortunately so much has changed that I have no clue where to start > troubleshooting this problem. I googled the error but ended up with a > bunch of "SQL Server can't start" stuff, but SQL Server is running as is > Management Studio Express. > > Any ideas where to start figuring this thing out. My billing database > is locked up in SQL Server at the moment and I can't get at it. > > 8-( From jwcolby at colbyconsulting.com Mon Apr 14 09:37:51 2008 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 14 Apr 2008 10:37:51 -0400 Subject: [dba-SQLServer] Unable to open billing database In-Reply-To: <48036802.800@colbyconsulting.com> References: <000001c89e37$ef2a0f00$2101a8c0@AB> <48036802.800@colbyconsulting.com> Message-ID: <48036C3F.6020407@colbyconsulting.com> Further to this, I opened my access billing mdb (FE) in a directory under my jwcolby directory, modified a module, and then couldn't save it. I closed, right clicked the directory and unchecked the read-only of the directory. It went through and processed all the files and folders underneath. I could then edit and save a module in that same Access FE. I then copied that entire directory back to the C: drive and I could no longer edit a module in that FE. I copied the entire directory back to my jwcolby directory and tried the edit / save and it worked. So there is definitely something about "directly under the C: drive". jwcolby wrote: > Well... I have to say "I don't think so". The problem is that this is > Vista, and I do not yet understand Vista. > > Let's take some examples: > > I tried to unzip a file directly into a directory in the C: drive of > this machine. The unzip failed saying that it was read-only. I copied > the zip to my documents directory and could unzip it there. I had to > ask permission to copy the unzipped contents back to that directory. > > OTOH, I have an Access database FE in the same directory that I am > trying to run this SQL Server DB from. I can open that MDB and modify > it, so that mdb file is not read-only and I have permission to do that. > > The folder itself is marked read-only from the properties window. When > I tell it to set it to not read-only it goes off without complaint to > start marking all the files and folders underneath that directory as not > read-only, but the folder itself is still read-only when it is done. > > So I don't have a clue what Vista / SQL Server is doing in this case. > What I do know is that if I move the files off to a thumb drive they > will attach just fine so it is SOMETHING about the C: drive in particular. > > Asger Blond wrote: >> John, >> Does the service account for your SQL Server have read/write permission on >> the folder hosting your database? >> >> Asger >> >> -----Oprindelig meddelelse----- >> Fra: dba-sqlserver-bounces at databaseadvisors.com >> [mailto:dba-sqlserver-bounces at databaseadvisors.com] P? vegne af jwcolby >> Sendt: 14. april 2008 15:36 >> Til: Dba-Sqlserver >> Emne: [dba-SQLServer] Unable to open billing database >> >> I have rather an emergency here. I am trying to get at my billing >> database which runs through an Access FE attached to tables in a SQL >> Server database. This was all working for many years on my old XP >> machine. The database was created in SQL Server Express AFAICR. >> >> When my laptop died I received a new one from Dell, and I installed >> Vista on it. I also installed Visual Studio 2008 in preparation for >> going there. It apparently installed PARTS of SQL Server 2005 and SQL >> Server Express. >> >> Management studio was NOT installed, so first I tried to install SQL >> Server 2005 but it told me that I could not install the user interface >> because what I already had installed was newer than what I was trying to >> install, however AFAICT Management Studio was NOT installed. Needless >> to say not having management studio is causing me problems doing >> anything with SQL Server. >> >> I subsequently downloaded and installed Management studio express which >> DID install. However (and here comes the problem) when I try to attach >> the billing database I get a message saying: >> >> >> An exception occurred while executing a Transact-SQL statement or batch. >> (Microsoft.SqlServer.Express.ConnectionInfo) >> >> ------------------------------ >> >> Unable to open the physical file "C:\Colby >> Consulting\C2DbBilling\C2DbBilling.mdf". Operating system error 5: >> "5(Access is denied.)". (Microsoft SQL Server, Error: 5120) >> >> Unfortunately so much has changed that I have no clue where to start >> troubleshooting this problem. I googled the error but ended up with a >> bunch of "SQL Server can't start" stuff, but SQL Server is running as is >> Management Studio Express. >> >> Any ideas where to start figuring this thing out. My billing database >> is locked up in SQL Server at the moment and I can't get at it. >> >> 8-( >> >> John W. Colby >> 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 >> >> > -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Mon Apr 14 09:49:32 2008 From: jwcolby at colbyconsulting.com (jwcolby) Date: Mon, 14 Apr 2008 10:49:32 -0400 Subject: [dba-SQLServer] Solved - unable to open billing database Message-ID: <48036EFC.9020605@colbyconsulting.com> The issue was rights to the c: root drive fro my user. My user had no "full control" or "modify" rights to the C: drive so if I created a folder there that folder did not have those rights either (for my user anyway). I set security to allow my user those rights and then copied the database folder to the C: drive and I could then mount the database. Interestingly, it refused to grant my user those rights to the Windows directory or the Program Files directory, which is good I guess. Anyway, I can now create directories in C: with my user and have full rights to those directories. Thanks for the suggestions guys. -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Wed Apr 16 15:20:58 2008 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 16 Apr 2008 16:20:58 -0400 Subject: [dba-SQLServer] Name parsing Message-ID: <48065FAA.5010808@colbyconsulting.com> Does anyone have a reasonable efficient name parsing query or udf? I have names in the format LASTNAME FIRSTNAME MI all in one field. I have been around enough to know that you run into issues like Mac Donalds - spaces between two words that make up a last name. I do have the ability to parse the names using my address validation software but just thought I'd throw it out here first. Thanks, -- John W. Colby www.ColbyConsulting.com From dwaters at usinternet.com Wed Apr 16 15:46:40 2008 From: dwaters at usinternet.com (Dan Waters) Date: Wed, 16 Apr 2008 15:46:40 -0500 Subject: [dba-SQLServer] Name parsing In-Reply-To: <48065FAA.5010808@colbyconsulting.com> References: <48065FAA.5010808@colbyconsulting.com> Message-ID: <003b01c8a002$f949ef10$0300a8c0@danwaters> John I have a vague memory of an 'official' list of name and all the abbreviation permutations - but don't know where to get it. I always use just one field for people's names - that way it doesn't matter how my users want to enter their names. Some cultures put the family name first and the individual's name last (but without any commas). As the world gets 'smaller', we'll have both types of names in our databases, and you won't want multiple fields for one person's name. Dan -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Wednesday, April 16, 2008 3:21 PM To: Dba-Sqlserver Subject: [dba-SQLServer] Name parsing Does anyone have a reasonable efficient name parsing query or udf? I have names in the format LASTNAME FIRSTNAME MI all in one field. I have been around enough to know that you run into issues like Mac Donalds - spaces between two words that make up a last name. I do have the ability to parse the names using my address validation software but just thought I'd throw it out here first. Thanks, -- John W. Colby 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 Apr 16 16:26:03 2008 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 16 Apr 2008 17:26:03 -0400 Subject: [dba-SQLServer] Name parsing In-Reply-To: <003b01c8a002$f949ef10$0300a8c0@danwaters> References: <48065FAA.5010808@colbyconsulting.com> <003b01c8a002$f949ef10$0300a8c0@danwaters> Message-ID: <48066EEB.4070100@colbyconsulting.com> Unfortunately I really don't have a lot of choice. This is for a mailing list and I need to parse them in order to do address validation. Dan Waters wrote: > John > > I have a vague memory of an 'official' list of name and all the abbreviation > permutations - but don't know where to get it. > > I always use just one field for people's names - that way it doesn't matter > how my users want to enter their names. > > Some cultures put the family name first and the individual's name last (but > without any commas). As the world gets 'smaller', we'll have both types of > names in our databases, and you won't want multiple fields for one person's > name. > > Dan > > -----Original Message----- > From: dba-sqlserver-bounces at databaseadvisors.com > [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Wednesday, April 16, 2008 3:21 PM > To: Dba-Sqlserver > Subject: [dba-SQLServer] Name parsing > > Does anyone have a reasonable efficient name parsing query or udf? I > have names in the format LASTNAME FIRSTNAME MI all in one field. I have > been around enough to know that you run into issues like Mac Donalds - > spaces between two words that make up a last name. I do have the > ability to parse the names using my address validation software but just > thought I'd throw it out here first. > > Thanks, > -- John W. Colby www.ColbyConsulting.com From fuller.artful at gmail.com Wed Apr 16 19:11:31 2008 From: fuller.artful at gmail.com (Arthur Fuller) Date: Wed, 16 Apr 2008 20:11:31 -0400 Subject: [dba-SQLServer] Rapid transactions Message-ID: <29f585dd0804161711l5df9a38fh63c0be0a1e7bf84a@mail.gmail.com> Let's imagine that there are 899 transactions per minute. Said transactions infect/affect only one table of interest, but the data-flow is constant. Let's also imagine that the boss wants to see numbers reflecting the state up to the second. Let's imagine that I build an OLAP db with everyting up to last year. What I would want to do is somehow join the old data with the new data. I already know how to do this but I'm looking for expert advice to point out what could go wrong with my scenario. Let us suppose that I roll up the old data about 5 times per day, and that a query as to where we stand now equals "grab the old (consolidated) numbers plus teh current numbers. How might I achieve this? Is it as simple as I think (roll up the old numbers and do a join with the recent stuff and we're there), or am I overlooking something important? I am assuing that anything that happened in 2006 and 2007 is not subject to edit, and therefore can be rolled up in the classical AS format. If I am correct, then T1 is Read0nly and T2 is the current stuff and a Union get us to the current answer. Am I off-base on this conjecture? So far, I don't think so, but I open the question for smarter minds than mine. In the roughest strokes, we have an OLAP db and and OLTP. We have to unite them with a single query. What has occurred a year or two ago is dead, so to speak. It cannot be edited but it can be summarized using Group By etc. What occurs this year is another set of data, and we have no choice but to do a GroupBy etc. We want now to marry the datasets. IOW, if I want to computer sales this year/month versus the last year/month, I need to union the OLTP table with the OLAP table and then I have my result set. Is this correct or am I missing something important? TIA, Arthur From mikedorism at verizon.net Fri Apr 18 21:04:07 2008 From: mikedorism at verizon.net (Doris Manning) Date: Fri, 18 Apr 2008 22:04:07 -0400 Subject: [dba-SQLServer] Verifying LDAP login using SQL Server 2000 Message-ID: <000501c8a1c1$a7ea2840$2d01a8c0@Kermit> My boss wants to create a way for internal and external users to login in to a website by passing the login information through to SQL Server. The stored procedure would determine if the user is an internal employee or an external employee and perform the appropriate validation. I have successfully built a linked server connection to Active Directory. I am able to execute a SQL statement that retrieves a listing of all of the users. I'm stuck trying to figure out how to limit the returned list to just the entry that matches the username and password that are passed into the stored procedure. If anyone has any pointers, please let me know. Doris Manning Database Administrator Hargrove Inc. From jwcolby at colbyconsulting.com Thu Apr 24 08:43:49 2008 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 24 Apr 2008 09:43:49 -0400 Subject: [dba-SQLServer] Counts of value ranges Message-ID: <48108E95.3030801@colbyconsulting.com> Guys, Is there a way in SQL to get counts of records in value ranges: $2,000,000+ $1 - $1.99M $750K - $999K $500K - $749K $400K - $499K $300K - $399K $200K - $299K $100K - $199K <$100K -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Thu Apr 24 09:02:21 2008 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 24 Apr 2008 10:02:21 -0400 Subject: [dba-SQLServer] Counts of value ranges In-Reply-To: <48108E95.3030801@colbyconsulting.com> References: <48108E95.3030801@colbyconsulting.com> Message-ID: <481092ED.3090503@colbyconsulting.com> I just wrote a query in Access: SELECT qrptBilling.Bill, [Bill]<10 AS LT10, [Bill]<20 And [Bill]>=10 AS GTE10LT20 FROM qrptBilling; When I try to do the same thing in SQL Server it promptly wraps the [Bill]<10 in single quotes and treats it as a string: SELECT qrptBilling.Bill, '[Bill]<10' AS LT10, '[Bill]<20' And '[Bill]>=10' AS GTE10LT20 FROM qrptBilling; Obviously not what I am trying to get at. So how does one accomplish turning a value comparison into a boolean in SQL Server? jwcolby wrote: > Guys, > > Is there a way in SQL to get counts of records in value ranges: > > $2,000,000+ > $1 - $1.99M > $750K - $999K > $500K - $749K > $400K - $499K > $300K - $399K > $200K - $299K > $100K - $199K > <$100K -- John W. Colby www.ColbyConsulting.com From James at fcidms.com Thu Apr 24 10:44:01 2008 From: James at fcidms.com (James Barash) Date: Thu, 24 Apr 2008 11:44:01 -0400 Subject: [dba-SQLServer] Counts of value ranges In-Reply-To: <481092ED.3090503@colbyconsulting.com> Message-ID: <00aa01c8a622$053aaf10$6d0101c0@fci.local> John: You need to use a Case statement. To translate your query you need something like: Select qrptBilling.Bill, (case when [Bill]<10 then 1 else 0 end) as LT10, (case then [Bill] < 20 and [Bill]>=10 then 1 else 0 end) as GTE10LT20 from qrptBilling For your original question, you could use: Select sum((case when [Bill]>=2000000 then 1 else 0 end)) as GR2M, sum((case when [Bill]>=1000000 and [Bill]<2000000 then 1 else 0 end)) as 1Mto2M, etc. from qrptBilling That should at least point you in the right direction. James Barash -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Thursday, April 24, 2008 10:02 AM To: Discussion concerning MS SQL Server Subject: Re: [dba-SQLServer] Counts of value ranges I just wrote a query in Access: SELECT qrptBilling.Bill, [Bill]<10 AS LT10, [Bill]<20 And [Bill]>=10 AS GTE10LT20 FROM qrptBilling; When I try to do the same thing in SQL Server it promptly wraps the [Bill]<10 in single quotes and treats it as a string: SELECT qrptBilling.Bill, '[Bill]<10' AS LT10, '[Bill]<20' And '[Bill]>=10' AS GTE10LT20 FROM qrptBilling; Obviously not what I am trying to get at. So how does one accomplish turning a value comparison into a boolean in SQL Server? jwcolby wrote: > Guys, > > Is there a way in SQL to get counts of records in value ranges: > > $2,000,000+ > $1 - $1.99M > $750K - $999K > $500K - $749K > $400K - $499K > $300K - $399K > $200K - $299K > $100K - $199K > <$100K -- John W. Colby 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 Apr 24 11:19:50 2008 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 24 Apr 2008 12:19:50 -0400 Subject: [dba-SQLServer] Counts of value ranges In-Reply-To: <00aa01c8a622$053aaf10$6d0101c0@fci.local> References: <00aa01c8a622$053aaf10$6d0101c0@fci.local> Message-ID: <4810B326.7060302@colbyconsulting.com> Thanks for that answer James. A poster over on the AccessD list provided a method which uses a little table to hold the ranges, which I used and which works great. > SELECT MinValue, MaxValue, (SELECT Count(*) FROM tblDataTable WHERE > Value >=T1.MinValue AND Value <=T1.MaxValue) FROM tblRanges AS T1 Thanks again for your reply. I keep forgetting about the case statement, never having used it. James Barash wrote: > John: > > You need to use a Case statement. To translate your query you need > something like: > > Select qrptBilling.Bill, (case when [Bill]<10 then 1 else 0 end) as LT10, > (case then [Bill] < 20 and [Bill]>=10 then 1 else 0 end) as GTE10LT20 from > qrptBilling > > For your original question, you could use: > > Select sum((case when [Bill]>=2000000 then 1 else 0 end)) as GR2M, sum((case > when [Bill]>=1000000 and [Bill]<2000000 then 1 else 0 end)) as 1Mto2M, etc. > from qrptBilling > > That should at least point you in the right direction. > > James Barash > > -----Original Message----- > From: dba-sqlserver-bounces at databaseadvisors.com > [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of jwcolby > Sent: Thursday, April 24, 2008 10:02 AM > To: Discussion concerning MS SQL Server > Subject: Re: [dba-SQLServer] Counts of value ranges > > I just wrote a query in Access: > > SELECT qrptBilling.Bill, [Bill]<10 AS LT10, [Bill]<20 And [Bill]>=10 AS > GTE10LT20 FROM qrptBilling; > > When I try to do the same thing in SQL Server it promptly wraps the > [Bill]<10 in single quotes and treats it as a string: > > SELECT qrptBilling.Bill, '[Bill]<10' AS LT10, '[Bill]<20' And > '[Bill]>=10' AS GTE10LT20 FROM qrptBilling; > > Obviously not what I am trying to get at. So how does one accomplish > turning a value comparison into a boolean in SQL Server? > > jwcolby wrote: >> Guys, >> >> Is there a way in SQL to get counts of records in value ranges: >> >> $2,000,000+ >> $1 - $1.99M >> $750K - $999K >> $500K - $749K >> $400K - $499K >> $300K - $399K >> $200K - $299K >> $100K - $199K >> <$100K > -- John W. Colby www.ColbyConsulting.com