From artful at rogers.com Thu Feb 1 07:22:56 2007 From: artful at rogers.com (Arthur Fuller) Date: Thu, 1 Feb 2007 08:22:56 -0500 Subject: [dba-SQLServer] Route Planning In-Reply-To: <45B916CF.8040905@shaw.ca> References: <20070121053226.15570.qmail@web88209.mail.re2.yahoo.com> <45B916CF.8040905@shaw.ca> Message-ID: <00b601c74604$1635b320$6e01a8c0@Guinivere> Thanks! I'll look into that. -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of MartyConnelly Sent: January 25, 2007 3:45 PM To: dba-sqlserver at databaseadvisors.com Subject: Re: [dba-SQLServer] Route Planning Have a look at MapInfo's Routing Server They have an office in Toronto. They don't list prices. From darrend at nimble.com.au Thu Feb 1 20:24:04 2007 From: darrend at nimble.com.au (Darren HALL) Date: Fri, 2 Feb 2007 13:24:04 +1100 Subject: [dba-SQLServer] RepServices: Max No of Parameters Message-ID: <200702020224.l122OnO29646@databaseadvisors.com> Hi All Does anyone know if there is a Max no of parameters for a report to have in rep Services? If there is - anyone know what that limit is? Many thanks in advance DD From fhtapia at gmail.com Fri Feb 2 11:31:54 2007 From: fhtapia at gmail.com (Francisco Tapia) Date: Fri, 2 Feb 2007 09:31:54 -0800 Subject: [dba-SQLServer] RepServices: Max No of Parameters In-Reply-To: <200702020224.l122OnO29646@databaseadvisors.com> References: <200702020224.l122OnO29646@databaseadvisors.com> Message-ID: I've never hit it... of course I try to keep the number of parameters down... :) On 2/1/07, Darren HALL wrote: > Hi All > > > > Does anyone know if there is a Max no of parameters for a report to have in rep > Services? > > > > If there is - anyone know what that limit is? > > > > Many thanks in advance > > > > DD > > > > _______________________________________________ > 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 artful at rogers.com Fri Feb 2 16:44:00 2007 From: artful at rogers.com (Arthur Fuller) Date: Fri, 2 Feb 2007 17:44:00 -0500 Subject: [dba-SQLServer] RepServices: Max No of Parameters In-Reply-To: References: <200702020224.l122OnO29646@databaseadvisors.com> Message-ID: <017301c7471b$a2090e20$6e01a8c0@Guinivere> I'm not certain but I believe that the maximum parms are 255. -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Francisco Tapia Sent: February 2, 2007 12:32 PM To: dba-sqlserver at databaseadvisors.com Subject: Re: [dba-SQLServer] RepServices: Max No of Parameters I've never hit it... of course I try to keep the number of parameters down... :) From jwcolby at colbyconsulting.com Sat Feb 3 08:32:29 2007 From: jwcolby at colbyconsulting.com (JWColby) Date: Sat, 3 Feb 2007 09:32:29 -0500 Subject: [dba-SQLServer] Count by state Message-ID: <01ee01c747a0$229c8150$657aa8c0@m6805> I have a query where I need to count records by state. I use the groupby and count and voila. The problem is that I need every state, whether or not there is a record (give me a null or a zero), and I need it DOWN the page, not across the page, i.e. it is going into a spreadsheet as a set of rows, one row per state. I will be doing comparisons with other counts where each count will show up in a different set of states. I always need all the states represented in every count. I know I can do that with the transform, but that also turns it into columns and I need it kept in rows. Any suggestions? John W. Colby Colby Consulting www.ColbyConsulting.com From ssharkins at setel.com Sat Feb 3 09:16:51 2007 From: ssharkins at setel.com (Susan Harkins) Date: Sat, 3 Feb 2007 10:16:51 -0500 Subject: [dba-SQLServer] Count by state In-Reply-To: <01ee01c747a0$229c8150$657aa8c0@m6805> Message-ID: <000e01c747a6$55803fc0$32b82ad1@SUSANONE> John, a few things about Count(): 1.) Count(fld) won't consider Nulls -- are your states with no values, Null or 0? 2.) Count(*) will count all rows. Susan H. I have a query where I need to count records by state. I use the groupby and count and voila. The problem is that I need every state, whether or not there is a record (give me a null or a zero), and I need it DOWN the page, not across the page, i.e. it is going into a spreadsheet as a set of rows, one row per state. I will be doing comparisons with other counts where each count will show up in a different set of states. I always need all the states represented in every count. I know I can do that with the transform, but that also turns it into columns and I need it kept in rows. Any suggestions? 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 -- No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.5.432 / Virus Database: 268.17.14/657 - Release Date: 1/29/2007 9:04 AM From Patricia.O'Connor at otda.state.ny.us Sat Feb 3 12:02:26 2007 From: Patricia.O'Connor at otda.state.ny.us (O'Connor, Patricia (OTDA)) Date: Sat, 3 Feb 2007 13:02:26 -0500 Subject: [dba-SQLServer] Count by state References: <01ee01c747a0$229c8150$657aa8c0@m6805> Message-ID: <01DBAB52E30A9A4AB3D94EF8029EDBE80253C09B@EXCNYSM0A1AI.nysemail.nyenet> Do you have a table with all the state id codes, names, abbreviations, etc? I have done this several ways. 1) Left outer join to sub query . Below is how I would do it in older oracle. Select SID.State_ID, SID.State_name, q1.My_Count1, q1.My_count2 From State_ID_TBL SID, (SELECT mot.State_id, Count(mot.fld1) my_count1, Count(mot.fld2) my_count2 From my_otherTable Mot Where whatever gets your counter group by mot.STATE_ID ) q1 Where SID.STATE_ID = q1.STATE_ID (+) '*** oracle left outer join****" Group by SID.STATE_ID, SID.STATE_NAME ORDER BY SID.STATE_ID if you want zeros then use NVL, DECODE or CASE. I have examples in A97 if you need that mail me offline at pattioc at yahoo.com ************************************************************* * Patricia E. O'Connor * Associate Computer Programmer/Analyst * OTDA - BDMA * (W) mailto:Patricia.O'Connor at otda.state.ny.us * (W) mailto:aa1160 at otda.state.ny.us *********************************************************** -------------------------------------------------------- This e-mail, including any attachments, may be confidential, privileged or otherwise legally protected. It is intended only for the addressee. If you received this e-mail in error or from someone who was not authorized to send it to you, do not disseminate, copy or otherwise use this e-mail or its attachments. Please notify the sender immediately by reply e-mail and delete the e-mail from your system. ________________________________ From: dba-sqlserver-bounces at databaseadvisors.com on behalf of JWColby Sent: Sat 02/03/2007 9:32 AM To: dba-sqlserver at databaseadvisors.com Subject: [dba-SQLServer] Count by state I have a query where I need to count records by state. I use the groupby and count and voila. The problem is that I need every state, whether or not there is a record (give me a null or a zero), and I need it DOWN the page, not across the page, i.e. it is going into a spreadsheet as a set of rows, one row per state. I will be doing comparisons with other counts where each count will show up in a different set of states. I always need all the states represented in every count. I know I can do that with the transform, but that also turns it into columns and I need it kept in rows. Any suggestions? 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 martyconnelly at shaw.ca Sat Feb 3 20:03:04 2007 From: martyconnelly at shaw.ca (MartyConnelly) Date: Sat, 03 Feb 2007 18:03:04 -0800 Subject: [dba-SQLServer] Route Planning In-Reply-To: <00b601c74604$1635b320$6e01a8c0@Guinivere> References: <20070121053226.15570.qmail@web88209.mail.re2.yahoo.com> <45B916CF.8040905@shaw.ca> <00b601c74604$1635b320$6e01a8c0@Guinivere> Message-ID: <45C53ED8.8050204@shaw.ca> Here is some code to footle around with it produces text route driving directions and distance from a starting lat/long to an ending one Just remember this is from a Virtual Earth server It isn't documented, I am still puzzling out. If you aren't paying for it there are no guarantees. it will work tomorrow If you wanted to get fancy you could add Yahoo Traffic and Construsction Info. Left in debug code to show what is happening ' This code takes about a second to return info. I don't know how 'you want to parse the returned string; but if this file was an XML file ' rather than html that would only take another second. 'This code fires off request to aspx Virtual Earth page ' sends start and end latitude/ 'returns route directions in text string 'direction, lat, long, distance 'Makes use of the XMLHTTPRequest object contained in msxml.dll. '?SendGrabRoute(48.0,-123.0,48.5,-123.5) Public Function SendGrabRoute(dStartLat As Double, dStartLon As Double, _ dEndLat As Double, dEndLon As Double) As String Dim strText As String Dim strPhoneNo As String Dim oHttp As Object Dim strURL As String Dim strRoute As String 'make use of the XMLHTTPRequest object contained in msxml.dll Set oHttp = CreateObject("Microsoft.XMLHTTP") 'oHttp.setRequestHeader "Content-Type", "application/x-www-form-urlencoded" 'oHttp.setRequestHeader "Content-Type", "text/xml" 'oHttp.setRequestHeader "Content-Type", "multipart/form-data" strURL = "http://local.live.com/directions.ashx?startlat=" & dStartLat & _ "&startlon=" & dStartLon & _ "&endlat=" & dEndLat & _ "&endlon=" & dEndLon Debug.Print strURL oHttp.Open "GET", strURL, False ' oHttp.Open "GET", "http://local.live.com/directions.ashx?startlat=48.0&startlon=-123.0&endlat=48.5&endlon=-123.5", False oHttp.setRequestHeader "Content-Type", "application/x-www-form-urlencoded" oHttp.send 'check the feedback from the Net File Debug.Print "Ready State =" & oHttp.ReadyState 'normal state =4 Debug.Print "Status =" & oHttp.Status 'normal status = 200 Debug.Print "Status Text =" & oHttp.StatusText Debug.Print oHttp.getAllResponseHeaders() 'Debug.Print "Response Body =" & oHttp.responseBody Dim strResponseBody As String strResponseBody = StrConv(oHttp.responseBody, vbUnicode) Debug.Print "Response Body =" & strResponseBody 'Debug.Print "Response Text =" & oHttp.responseText 'On Error Resume Next Set oHttp = Nothing Dim strAddrParts() As String ReDim strAddrParts(0) Dim i As Long Dim larrSize As Long Dim llast As Long ' maybe not the best parsing method in javascript use IndexOf strAddrParts = Split(strResponseBody, "new VE_RouteInstruction(") larrSize = UBound(strAddrParts) Debug.Print larrSize i = 0 strRoute = "" Do While i <= larrSize If i = larrSize Then ' strip out jpeg and extra lines on last line llast = InStr(1, strAddrParts(i), "]") strAddrParts(i) = Mid(strAddrParts(i), 1, llast - 1) 'Debug.Print "ver " & i & "=" & strAddrParts(i) strRoute = strRoute & strAddrParts(i) & vbCrLf ' Debug.Print strRoute Else ' Debug.Print "ver " & i & "=" & strAddrParts(i) strRoute = strRoute & strAddrParts(i) & vbCrLf ' Debug.Print strRoute End If i = i + 1 Loop SendGrabRoute = strRoute Exit Function ErrHandler: MsgBox Err.Number & vbCrLf & Err.Description, vbCritical & vbOKOnly & _ Err.Source End Function Arthur Fuller wrote: >Thanks! I'll look into that. > >-----Original Message----- >From: dba-sqlserver-bounces at databaseadvisors.com >[mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of >MartyConnelly >Sent: January 25, 2007 3:45 PM >To: dba-sqlserver at databaseadvisors.com >Subject: Re: [dba-SQLServer] Route Planning > >Have a look at MapInfo's Routing Server >They have an office in Toronto. >They don't list prices. > > > > -- Marty Connelly Victoria, B.C. Canada From martyconnelly at shaw.ca Sun Feb 4 01:08:16 2007 From: martyconnelly at shaw.ca (MartyConnelly) Date: Sat, 03 Feb 2007 23:08:16 -0800 Subject: [dba-SQLServer] Route Planning In-Reply-To: <00b601c74604$1635b320$6e01a8c0@Guinivere> References: <20070121053226.15570.qmail@web88209.mail.re2.yahoo.com> <45B916CF.8040905@shaw.ca> <00b601c74604$1635b320$6e01a8c0@Guinivere> Message-ID: <45C58660.5070509@shaw.ca> Arthur Fuller wrote: >Thanks! I'll look into that. > >-----Original Message----- >From: dba-sqlserver-bounces at databaseadvisors.com >[mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of >MartyConnelly >Sent: January 25, 2007 3:45 PM >To: dba-sqlserver at databaseadvisors.com >Subject: Re: [dba-SQLServer] Route Planning > >Have a look at MapInfo's Routing Server >They have an office in Toronto. >They don't list prices. > > >_______________________________________________ >dba-SQLServer mailing list >dba-SQLServer at databaseadvisors.com >http://databaseadvisors.com/mailman/listinfo/dba-sqlserver >http://www.databaseadvisors.com > > > > > -- Marty Connelly Victoria, B.C. Canada From darrend at nimble.com.au Sun Feb 4 16:26:33 2007 From: darrend at nimble.com.au (Darren DICK) Date: Mon, 5 Feb 2007 09:26:33 +1100 Subject: [dba-SQLServer] RepServices: Max No of Parameters In-Reply-To: <017301c7471b$a2090e20$6e01a8c0@Guinivere> Message-ID: <200702042226.l14MQXO04473@databaseadvisors.com> Thank you Francisco and thank you Arthur We only have approx 10 - still too many (from a user point of view) me thinks Darren ------------------ -----Original Message----- From: Arthur Fuller [mailto:artful at rogers.com] Sent: Saturday, 3 February 2007 9:44 AM To: dba-sqlserver at databaseadvisors.com Subject: Re: [dba-SQLServer] RepServices: Max No of Parameters I'm not certain but I believe that the maximum parms are 255. -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Francisco Tapia Sent: February 2, 2007 12:32 PM To: dba-sqlserver at databaseadvisors.com Subject: Re: [dba-SQLServer] RepServices: Max No of Parameters I've never hit it... of course I try to keep the number of parameters down... :) _______________________________________________ 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 Sun Feb 4 23:49:07 2007 From: ebarro at verizon.net (Eric Barro) Date: Sun, 04 Feb 2007 21:49:07 -0800 Subject: [dba-SQLServer] Count by state In-Reply-To: <01ee01c747a0$229c8150$657aa8c0@m6805> Message-ID: <0JCZ0071N6TMB5HA@vms048.mailsrvcs.net> Try this... SELECT 'Total' = COUNT(*), 'AK' = COUNT(CASE WHEN [State] = 'AK' THEN [State] ELSE 0 END), 'AZ' = COUNT(CASE WHEN [State] = 'AZ' THEN [State] ELSE 0 END), .... FROM MyStateTable (nolock) GROUP BY [State] ORDER BY [State] -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of JWColby Sent: Saturday, February 03, 2007 6:32 AM To: dba-sqlserver at databaseadvisors.com Subject: [dba-SQLServer] Count by state I have a query where I need to count records by state. I use the groupby and count and voila. The problem is that I need every state, whether or not there is a record (give me a null or a zero), and I need it DOWN the page, not across the page, i.e. it is going into a spreadsheet as a set of rows, one row per state. I will be doing comparisons with other counts where each count will show up in a different set of states. I always need all the states represented in every count. I know I can do that with the transform, but that also turns it into columns and I need it kept in rows. Any suggestions? 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 -- No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.1.411 / Virus Database: 268.17.24/668 - Release Date: 2/4/2007 From jwcolby at colbyconsulting.com Mon Feb 5 14:55:04 2007 From: jwcolby at colbyconsulting.com (JWColby) Date: Mon, 5 Feb 2007 15:55:04 -0500 Subject: [dba-SQLServer] Monitoring net traffic to the internet Message-ID: <00a301c74967$eac3ad20$657aa8c0@m6805> Can anyone point me to software that allows monitoring traffic to the internet and tracking it back to the workstation? My client has a very limited bandwidth to the internet and it is being used in an unexplained manner, i.e. the bandwidth is not available to me (for example) if I do an upload or download to FTP, response time is slow for remote desktop etc. We have seen this occur when one of the technical types is downloading large service packs etc which we have arranged to have done "off hours", but there are still times when the internet bandwidth is abnormally low. Thus we want to discover if someone is playing FM radio, watching a video etc. just so we can go rap on their door and ask them to stop. I haven't a clue how to discover what workstation is using bandwidth like this. John W. Colby Colby Consulting www.ColbyConsulting.com From artful at rogers.com Mon Feb 5 16:59:04 2007 From: artful at rogers.com (artful at rogers.com) Date: Mon, 5 Feb 2007 14:59:04 -0800 (PST) Subject: [dba-SQLServer] SQL in SP failing Message-ID: <20070205225904.16332.qmail@web88212.mail.re2.yahoo.com> Missed this earlier. The double quotes are your problem. Arthur Fuller Technical Writer, Data Modeler, SQL Sensei Artful Databases Organization www.artfulsoftware.com ----- Original Message ---- From: Mark A Matte To: dba-sqlserver at databaseadvisors.com Sent: Thursday, November 30, 2006 2:13:44 PM Subject: [dba-SQLServer] SQL in SP failing Hello All, Any idea why the following SQL will fail in an SP? 'insert into tblBrita_ID(case_id,Criteria) SELECT case_id, "test" As Criteria FROM tblCase where case_id=1' The error is "Invalid column name 'test'." It doesn't always fail...normally 'test' is a parameter passed to the SP...I have modified it to the above for demo purposes...but using just the word 'test' as above still gives the same error. Thanks, Mark A. Matte From markamatte at hotmail.com Tue Feb 6 09:23:22 2007 From: markamatte at hotmail.com (Mark A Matte) Date: Tue, 06 Feb 2007 15:23:22 +0000 Subject: [dba-SQLServer] SQL in SP failing In-Reply-To: <20070205225904.16332.qmail@web88212.mail.re2.yahoo.com> Message-ID: Arthur, I've pretty much given up on understanding this one. Below is the SP in question. This is not the final version I use...but a simplified version to show the problem: CREATE PROCEDURE [Select_Records_1] @ID nvarchar(255) AS declare @sql as varchar(1000) declare @nsql as nchar(3000) set @sql='insert into tblBrita_ID(case_id,Criteria) SELECT case_id, "test" As Criteria FROM tblCase where case_id=1' set @nsql=@sql set nocount on exec sp_executesql @nsql set nocount off ********************* This works...sometimes...I think I need the double quotes because "test" is just some text I put in. If I don't need the doublequotes how to I show that test is NOT a field. To get this to work...I remove all criteria and the word test(replace with a field)...and running the query that calls the SP...if it runs...I add some criteria back in...and keep doing this until I have rebuilt the SP. Finally it will run...so I save and all is good. But the next day I change just the table name...try to run it...and it fails...I don't get it??? Then I just start modifying until I get back to where it started....I am confused. Thanks, Mark A. Matte >From: artful at rogers.com >Reply-To: dba-sqlserver at databaseadvisors.com >To: dba-sqlserver at databaseadvisors.com >Subject: Re: [dba-SQLServer] SQL in SP failing >Date: Mon, 5 Feb 2007 14:59:04 -0800 (PST) > >Missed this earlier. The double quotes are your problem. > >Arthur Fuller >Technical Writer, Data Modeler, SQL Sensei >Artful Databases Organization >www.artfulsoftware.com > > > > >----- Original Message ---- >From: Mark A Matte >To: dba-sqlserver at databaseadvisors.com >Sent: Thursday, November 30, 2006 2:13:44 PM >Subject: [dba-SQLServer] SQL in SP failing > > >Hello All, > >Any idea why the following SQL will fail in an SP? > >'insert into tblBrita_ID(case_id,Criteria) SELECT case_id, "test" As >Criteria FROM tblCase where case_id=1' > >The error is "Invalid column name 'test'." It doesn't always >fail...normally 'test' is a parameter passed to the SP...I have modified it >to the above for demo purposes...but using just the word 'test' as above >still gives the same error. > >Thanks, > >Mark A. Matte >_______________________________________________ >dba-SQLServer mailing list >dba-SQLServer at databaseadvisors.com >http://databaseadvisors.com/mailman/listinfo/dba-sqlserver >http://www.databaseadvisors.com > _________________________________________________________________ Search for grocery stores. Find gratitude. Turn a simple search into something more. http://click4thecause.live.com/search/charity/default.aspx?source=hmemtagline_gratitude&FORM=WLMTAG From mikedorism at verizon.net Tue Feb 6 09:34:06 2007 From: mikedorism at verizon.net (Doris Manning) Date: Tue, 06 Feb 2007 10:34:06 -0500 Subject: [dba-SQLServer] SQL in SP failing In-Reply-To: References: <20070205225904.16332.qmail@web88212.mail.re2.yahoo.com> Message-ID: <000b01c74a04$3d5c1d00$2f01a8c0@Kermit> SQL doesn't like double quotes. Try declaring an additional parameter to hold your test variable. CREATE PROCEDURE [Select_Records_1] @ID nvarchar(255) AS Declare @test as varchar(4) declare @sql as varchar(1000) declare @nsql as nchar(3000) set @test = N'test' set @sql='insert into tblBrita_ID(case_id,Criteria) SELECT case_id, ' + @test + ' As Criteria FROM tblCase where case_id=1' set @nsql=@sql set nocount on exec sp_executesql @nsql set nocount off Doris Manning Database Administrator Hargrove Inc. -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Mark A Matte Sent: Tuesday, February 06, 2007 10:23 AM To: dba-sqlserver at databaseadvisors.com Subject: Re: [dba-SQLServer] SQL in SP failing Arthur, I've pretty much given up on understanding this one. Below is the SP in question. This is not the final version I use...but a simplified version to show the problem: CREATE PROCEDURE [Select_Records_1] @ID nvarchar(255) AS declare @sql as varchar(1000) declare @nsql as nchar(3000) set @sql='insert into tblBrita_ID(case_id,Criteria) SELECT case_id, "test" As Criteria FROM tblCase where case_id=1' set @nsql=@sql set nocount on exec sp_executesql @nsql set nocount off ********************* This works...sometimes...I think I need the double quotes because "test" is just some text I put in. If I don't need the doublequotes how to I show that test is NOT a field. To get this to work...I remove all criteria and the word test(replace with a field)...and running the query that calls the SP...if it runs...I add some criteria back in...and keep doing this until I have rebuilt the SP. Finally it will run...so I save and all is good. But the next day I change just the table name...try to run it...and it fails...I don't get it??? Then I just start modifying until I get back to where it started....I am confused. Thanks, Mark A. Matte >From: artful at rogers.com >Reply-To: dba-sqlserver at databaseadvisors.com >To: dba-sqlserver at databaseadvisors.com >Subject: Re: [dba-SQLServer] SQL in SP failing >Date: Mon, 5 Feb 2007 14:59:04 -0800 (PST) > >Missed this earlier. The double quotes are your problem. > >Arthur Fuller >Technical Writer, Data Modeler, SQL Sensei >Artful Databases Organization >www.artfulsoftware.com > > > > >----- Original Message ---- >From: Mark A Matte >To: dba-sqlserver at databaseadvisors.com >Sent: Thursday, November 30, 2006 2:13:44 PM >Subject: [dba-SQLServer] SQL in SP failing > > >Hello All, > >Any idea why the following SQL will fail in an SP? > >'insert into tblBrita_ID(case_id,Criteria) SELECT case_id, "test" As >Criteria FROM tblCase where case_id=1' > >The error is "Invalid column name 'test'." It doesn't always >fail...normally 'test' is a parameter passed to the SP...I have modified it >to the above for demo purposes...but using just the word 'test' as above >still gives the same error. > >Thanks, > >Mark A. Matte >_______________________________________________ >dba-SQLServer mailing list >dba-SQLServer at databaseadvisors.com >http://databaseadvisors.com/mailman/listinfo/dba-sqlserver >http://www.databaseadvisors.com > _________________________________________________________________ Search for grocery stores. Find gratitude. Turn a simple search into something more. http://click4thecause.live.com/search/charity/default.aspx?source=hmemtaglin e_gratitude&FORM=WLMTAG _______________________________________________ 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 Tue Feb 6 09:40:36 2007 From: ebarro at verizon.net (Eric Barro) Date: Tue, 06 Feb 2007 07:40:36 -0800 Subject: [dba-SQLServer] SQL in SP failing In-Reply-To: Message-ID: <0JD100EKJSVSQ8L2@vms046.mailsrvcs.net> Mark, You need to use CHAR(39) for the single quotes. CREATE PROCEDURE [Select_Records_1] ( @ID nvarchar(255) ) AS declare @sql as varchar(1000) Set @sql ='insert into tblBrita_ID(case_id,Criteria) SELECT case_id, ' + CHAR(39) + 'test' + CHAR(39) Set @sql = @sql + ' As Criteria FROM tblCase where case_id=1' exec (@sql) --Eric -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Mark A Matte Sent: Tuesday, February 06, 2007 7:23 AM To: dba-sqlserver at databaseadvisors.com Subject: Re: [dba-SQLServer] SQL in SP failing Arthur, I've pretty much given up on understanding this one. Below is the SP in question. This is not the final version I use...but a simplified version to show the problem: CREATE PROCEDURE [Select_Records_1] @ID nvarchar(255) AS declare @sql as varchar(1000) declare @nsql as nchar(3000) set @sql='insert into tblBrita_ID(case_id,Criteria) SELECT case_id, "test" As Criteria FROM tblCase where case_id=1' set @nsql=@sql set nocount on exec sp_executesql @nsql set nocount off ********************* This works...sometimes...I think I need the double quotes because "test" is just some text I put in. If I don't need the doublequotes how to I show that test is NOT a field. To get this to work...I remove all criteria and the word test(replace with a field)...and running the query that calls the SP...if it runs...I add some criteria back in...and keep doing this until I have rebuilt the SP. Finally it will run...so I save and all is good. But the next day I change just the table name...try to run it...and it fails...I don't get it??? Then I just start modifying until I get back to where it started....I am confused. Thanks, Mark A. Matte >From: artful at rogers.com >Reply-To: dba-sqlserver at databaseadvisors.com >To: dba-sqlserver at databaseadvisors.com >Subject: Re: [dba-SQLServer] SQL in SP failing >Date: Mon, 5 Feb 2007 14:59:04 -0800 (PST) > >Missed this earlier. The double quotes are your problem. > >Arthur Fuller >Technical Writer, Data Modeler, SQL Sensei Artful Databases >Organization www.artfulsoftware.com > > > > >----- Original Message ---- >From: Mark A Matte >To: dba-sqlserver at databaseadvisors.com >Sent: Thursday, November 30, 2006 2:13:44 PM >Subject: [dba-SQLServer] SQL in SP failing > > >Hello All, > >Any idea why the following SQL will fail in an SP? > >'insert into tblBrita_ID(case_id,Criteria) SELECT case_id, "test" As >Criteria FROM tblCase where case_id=1' > >The error is "Invalid column name 'test'." It doesn't always >fail...normally 'test' is a parameter passed to the SP...I have >modified it to the above for demo purposes...but using just the word >'test' as above still gives the same error. > >Thanks, > >Mark A. Matte >_______________________________________________ >dba-SQLServer mailing list >dba-SQLServer at databaseadvisors.com >http://databaseadvisors.com/mailman/listinfo/dba-sqlserver >http://www.databaseadvisors.com > _________________________________________________________________ Search for grocery stores. Find gratitude. Turn a simple search into something more. http://click4thecause.live.com/search/charity/default.aspx?source=hmemtaglin e_gratitude&FORM=WLMTAG _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com -- No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.1.411 / Virus Database: 268.17.28/672 - Release Date: 2/6/2007 From markamatte at hotmail.com Tue Feb 6 12:11:59 2007 From: markamatte at hotmail.com (Mark A Matte) Date: Tue, 06 Feb 2007 18:11:59 +0000 Subject: [dba-SQLServer] SQL in SP failing In-Reply-To: <0JD100EKJSVSQ8L2@vms046.mailsrvcs.net> Message-ID: Thanks Eric, That almost did the trick...if that were a 'true' representation of what I was doing...it worked fine...but I am passing @ID in place of 'test' and @ID is the criteria used to isolate the record. I really needed double quoates because @ID value contains single quotes. I used Char(34) instead and worked like a charm. Thanks Again, Mark A. Matte P.S...I still don't understand why it would run sometimes? >From: "Eric Barro" >Reply-To: dba-sqlserver at databaseadvisors.com >To: >Subject: Re: [dba-SQLServer] SQL in SP failing >Date: Tue, 06 Feb 2007 07:40:36 -0800 > >Mark, > >You need to use CHAR(39) for the single quotes. > >CREATE PROCEDURE [Select_Records_1] >( > @ID nvarchar(255) >) >AS > >declare @sql as varchar(1000) > >Set @sql ='insert into tblBrita_ID(case_id,Criteria) SELECT case_id, ' + >CHAR(39) + 'test' + CHAR(39) >Set @sql = @sql + ' As Criteria FROM tblCase where case_id=1' > >exec (@sql) > >--Eric > >-----Original Message----- >From: dba-sqlserver-bounces at databaseadvisors.com >[mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Mark A >Matte >Sent: Tuesday, February 06, 2007 7:23 AM >To: dba-sqlserver at databaseadvisors.com >Subject: Re: [dba-SQLServer] SQL in SP failing > >Arthur, > >I've pretty much given up on understanding this one. Below is the SP in >question. This is not the final version I use...but a simplified version >to >show the problem: > >CREATE PROCEDURE [Select_Records_1] @ID nvarchar(255) AS declare @sql as >varchar(1000) declare @nsql as nchar(3000) set @sql='insert into >tblBrita_ID(case_id,Criteria) SELECT case_id, "test" >As Criteria FROM tblCase where case_id=1' >set @nsql=@sql >set nocount on >exec sp_executesql @nsql >set nocount off >********************* >This works...sometimes...I think I need the double quotes because "test" is >just some text I put in. If I don't need the doublequotes how to I show >that test is NOT a field. > >To get this to work...I remove all criteria and the word test(replace with >a >field)...and running the query that calls the SP...if it runs...I add some >criteria back in...and keep doing this until I have rebuilt the SP. >Finally >it will run...so I save and all is good. But the next day I change just >the >table name...try to run it...and it fails...I don't get it??? Then I just >start modifying until I get back to where it started....I am confused. > >Thanks, > >Mark A. Matte > > > >From: artful at rogers.com > >Reply-To: dba-sqlserver at databaseadvisors.com > >To: dba-sqlserver at databaseadvisors.com > >Subject: Re: [dba-SQLServer] SQL in SP failing > >Date: Mon, 5 Feb 2007 14:59:04 -0800 (PST) > > > >Missed this earlier. The double quotes are your problem. > > > >Arthur Fuller > >Technical Writer, Data Modeler, SQL Sensei Artful Databases > >Organization www.artfulsoftware.com > > > > > > > > > >----- Original Message ---- > >From: Mark A Matte > >To: dba-sqlserver at databaseadvisors.com > >Sent: Thursday, November 30, 2006 2:13:44 PM > >Subject: [dba-SQLServer] SQL in SP failing > > > > > >Hello All, > > > >Any idea why the following SQL will fail in an SP? > > > >'insert into tblBrita_ID(case_id,Criteria) SELECT case_id, "test" As > >Criteria FROM tblCase where case_id=1' > > > >The error is "Invalid column name 'test'." It doesn't always > >fail...normally 'test' is a parameter passed to the SP...I have > >modified it to the above for demo purposes...but using just the word > >'test' as above still gives the same error. > > > >Thanks, > > > >Mark A. Matte > >_______________________________________________ > >dba-SQLServer mailing list > >dba-SQLServer at databaseadvisors.com > >http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > >http://www.databaseadvisors.com > > > >_________________________________________________________________ >Search for grocery stores. Find gratitude. Turn a simple search into >something more. >http://click4thecause.live.com/search/charity/default.aspx?source=hmemtaglin >e_gratitude&FORM=WLMTAG > >_______________________________________________ >dba-SQLServer mailing list >dba-SQLServer at databaseadvisors.com >http://databaseadvisors.com/mailman/listinfo/dba-sqlserver >http://www.databaseadvisors.com > >-- >No virus found in this incoming message. >Checked by AVG Free Edition. >Version: 7.1.411 / Virus Database: 268.17.28/672 - Release Date: 2/6/2007 > > >_______________________________________________ >dba-SQLServer mailing list >dba-SQLServer at databaseadvisors.com >http://databaseadvisors.com/mailman/listinfo/dba-sqlserver >http://www.databaseadvisors.com > _________________________________________________________________ >From predictions to trailers, check out the MSN Entertainment Guide to the Academy Awards? http://movies.msn.com/movies/oscars2007/?icid=ncoscartagline1 From fhtapia at gmail.com Tue Feb 6 12:31:14 2007 From: fhtapia at gmail.com (Francisco Tapia) Date: Tue, 6 Feb 2007 10:31:14 -0800 Subject: [dba-SQLServer] SQL in SP failing In-Reply-To: References: <0JD100EKJSVSQ8L2@vms046.mailsrvcs.net> Message-ID: You can debug your stored procedures in Query Analyzer by right clicking on the procedure in the object explorer and selecting debug. This will allow you to see what the variable's value is and why it worked sometimes. -- Francisco On 2/6/07, Mark A Matte wrote: > Thanks Eric, > > That almost did the trick...if that were a 'true' representation of what I > was doing...it worked fine...but I am passing @ID in place of 'test' and @ID > is the criteria used to isolate the record. I really needed double quoates > because @ID value contains single quotes. I used Char(34) instead and > worked like a charm. > > Thanks Again, > > Mark A. Matte > > P.S...I still don't understand why it would run sometimes? > > >From: "Eric Barro" > >Reply-To: dba-sqlserver at databaseadvisors.com > >To: > >Subject: Re: [dba-SQLServer] SQL in SP failing > >Date: Tue, 06 Feb 2007 07:40:36 -0800 > > > >Mark, > > > >You need to use CHAR(39) for the single quotes. > > > >CREATE PROCEDURE [Select_Records_1] > >( > > @ID nvarchar(255) > >) > >AS > > > >declare @sql as varchar(1000) > > > >Set @sql ='insert into tblBrita_ID(case_id,Criteria) SELECT case_id, ' + > >CHAR(39) + 'test' + CHAR(39) > >Set @sql = @sql + ' As Criteria FROM tblCase where case_id=1' > > > >exec (@sql) > > > >--Eric > > > >-----Original Message----- > >From: dba-sqlserver-bounces at databaseadvisors.com > >[mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Mark A > >Matte > >Sent: Tuesday, February 06, 2007 7:23 AM > >To: dba-sqlserver at databaseadvisors.com > >Subject: Re: [dba-SQLServer] SQL in SP failing > > > >Arthur, > > > >I've pretty much given up on understanding this one. Below is the SP in > >question. This is not the final version I use...but a simplified version > >to > >show the problem: > > > >CREATE PROCEDURE [Select_Records_1] @ID nvarchar(255) AS declare @sql as > >varchar(1000) declare @nsql as nchar(3000) set @sql='insert into > >tblBrita_ID(case_id,Criteria) SELECT case_id, "test" > >As Criteria FROM tblCase where case_id=1' > >set @nsql=@sql > >set nocount on > >exec sp_executesql @nsql > >set nocount off > >********************* > >This works...sometimes...I think I need the double quotes because "test" is > >just some text I put in. If I don't need the doublequotes how to I show > >that test is NOT a field. > > > >To get this to work...I remove all criteria and the word test(replace with > >a > >field)...and running the query that calls the SP...if it runs...I add some > >criteria back in...and keep doing this until I have rebuilt the SP. > >Finally > >it will run...so I save and all is good. But the next day I change just > >the > >table name...try to run it...and it fails...I don't get it??? Then I just > >start modifying until I get back to where it started....I am confused. > > > >Thanks, > > > >Mark A. Matte > > > > > > >From: artful at rogers.com > > >Reply-To: dba-sqlserver at databaseadvisors.com > > >To: dba-sqlserver at databaseadvisors.com > > >Subject: Re: [dba-SQLServer] SQL in SP failing > > >Date: Mon, 5 Feb 2007 14:59:04 -0800 (PST) > > > > > >Missed this earlier. The double quotes are your problem. > > > > > >Arthur Fuller > > >Technical Writer, Data Modeler, SQL Sensei Artful Databases > > >Organization www.artfulsoftware.com > > > > > > > > > > > > > > >----- Original Message ---- > > >From: Mark A Matte > > >To: dba-sqlserver at databaseadvisors.com > > >Sent: Thursday, November 30, 2006 2:13:44 PM > > >Subject: [dba-SQLServer] SQL in SP failing > > > > > > > > >Hello All, > > > > > >Any idea why the following SQL will fail in an SP? > > > > > >'insert into tblBrita_ID(case_id,Criteria) SELECT case_id, "test" As > > >Criteria FROM tblCase where case_id=1' > > > > > >The error is "Invalid column name 'test'." It doesn't always > > >fail...normally 'test' is a parameter passed to the SP...I have > > >modified it to the above for demo purposes...but using just the word > > >'test' as above still gives the same error. > > > > > >Thanks, > > > > > >Mark A. Matte > > >_______________________________________________ > > >dba-SQLServer mailing list > > >dba-SQLServer at databaseadvisors.com > > >http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > > >http://www.databaseadvisors.com > > > > > > >_________________________________________________________________ > >Search for grocery stores. Find gratitude. Turn a simple search into > >something more. > >http://click4thecause.live.com/search/charity/default.aspx?source=hmemtaglin > >e_gratitude&FORM=WLMTAG > > > >_______________________________________________ > >dba-SQLServer mailing list > >dba-SQLServer at databaseadvisors.com > >http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > >http://www.databaseadvisors.com > > > >-- > >No virus found in this incoming message. > >Checked by AVG Free Edition. > >Version: 7.1.411 / Virus Database: 268.17.28/672 - Release Date: 2/6/2007 > > > > > >_______________________________________________ > >dba-SQLServer mailing list > >dba-SQLServer at databaseadvisors.com > >http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > >http://www.databaseadvisors.com > > > > _________________________________________________________________ > >From predictions to trailers, check out the MSN Entertainment Guide to the > Academy Awards(r) > http://movies.msn.com/movies/oscars2007/?icid=ncoscartagline1 > > > _______________________________________________ > 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 ebarro at verizon.net Tue Feb 6 12:41:50 2007 From: ebarro at verizon.net (Eric Barro) Date: Tue, 06 Feb 2007 10:41:50 -0800 Subject: [dba-SQLServer] SQL in SP failing In-Reply-To: Message-ID: <0JD2001FN1929OH4@vms048.mailsrvcs.net> Only if you have SP4 installed. :) -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Francisco Tapia Sent: Tuesday, February 06, 2007 10:31 AM To: dba-sqlserver at databaseadvisors.com Subject: Re: [dba-SQLServer] SQL in SP failing You can debug your stored procedures in Query Analyzer by right clicking on the procedure in the object explorer and selecting debug. This will allow you to see what the variable's value is and why it worked sometimes. -- Francisco On 2/6/07, Mark A Matte wrote: > Thanks Eric, > > That almost did the trick...if that were a 'true' representation of > what I was doing...it worked fine...but I am passing @ID in place of > 'test' and @ID is the criteria used to isolate the record. I really > needed double quoates because @ID value contains single quotes. I > used Char(34) instead and worked like a charm. > > Thanks Again, > > Mark A. Matte > > P.S...I still don't understand why it would run sometimes? > > >From: "Eric Barro" > >Reply-To: dba-sqlserver at databaseadvisors.com > >To: > >Subject: Re: [dba-SQLServer] SQL in SP failing > >Date: Tue, 06 Feb 2007 07:40:36 -0800 > > > >Mark, > > > >You need to use CHAR(39) for the single quotes. > > > >CREATE PROCEDURE [Select_Records_1] > >( > > @ID nvarchar(255) > >) > >AS > > > >declare @sql as varchar(1000) > > > >Set @sql ='insert into tblBrita_ID(case_id,Criteria) SELECT case_id, > >' + > >CHAR(39) + 'test' + CHAR(39) > >Set @sql = @sql + ' As Criteria FROM tblCase where case_id=1' > > > >exec (@sql) > > > >--Eric > > > >-----Original Message----- > >From: dba-sqlserver-bounces at databaseadvisors.com > >[mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Mark > >A Matte > >Sent: Tuesday, February 06, 2007 7:23 AM > >To: dba-sqlserver at databaseadvisors.com > >Subject: Re: [dba-SQLServer] SQL in SP failing > > > >Arthur, > > > >I've pretty much given up on understanding this one. Below is the SP > >in question. This is not the final version I use...but a simplified > >version to show the problem: > > > >CREATE PROCEDURE [Select_Records_1] @ID nvarchar(255) AS declare > >@sql as > >varchar(1000) declare @nsql as nchar(3000) set @sql='insert into > >tblBrita_ID(case_id,Criteria) SELECT case_id, "test" > >As Criteria FROM tblCase where case_id=1' > >set @nsql=@sql > >set nocount on > >exec sp_executesql @nsql > >set nocount off > >********************* > >This works...sometimes...I think I need the double quotes because > >"test" is just some text I put in. If I don't need the doublequotes > >how to I show that test is NOT a field. > > > >To get this to work...I remove all criteria and the word test(replace > >with a field)...and running the query that calls the SP...if it > >runs...I add some criteria back in...and keep doing this until I have > >rebuilt the SP. > >Finally > >it will run...so I save and all is good. But the next day I change > >just the table name...try to run it...and it fails...I don't get > >it??? Then I just start modifying until I get back to where it > >started....I am confused. > > > >Thanks, > > > >Mark A. Matte > > > > > > >From: artful at rogers.com > > >Reply-To: dba-sqlserver at databaseadvisors.com > > >To: dba-sqlserver at databaseadvisors.com > > >Subject: Re: [dba-SQLServer] SQL in SP failing > > >Date: Mon, 5 Feb 2007 14:59:04 -0800 (PST) > > > > > >Missed this earlier. The double quotes are your problem. > > > > > >Arthur Fuller > > >Technical Writer, Data Modeler, SQL Sensei Artful Databases > > >Organization www.artfulsoftware.com > > > > > > > > > > > > > > >----- Original Message ---- > > >From: Mark A Matte > > >To: dba-sqlserver at databaseadvisors.com > > >Sent: Thursday, November 30, 2006 2:13:44 PM > > >Subject: [dba-SQLServer] SQL in SP failing > > > > > > > > >Hello All, > > > > > >Any idea why the following SQL will fail in an SP? > > > > > >'insert into tblBrita_ID(case_id,Criteria) SELECT case_id, "test" > > >As Criteria FROM tblCase where case_id=1' > > > > > >The error is "Invalid column name 'test'." It doesn't always > > >fail...normally 'test' is a parameter passed to the SP...I have > > >modified it to the above for demo purposes...but using just the > > >word 'test' as above still gives the same error. > > > > > >Thanks, > > > > > >Mark A. Matte > > >_______________________________________________ > > >dba-SQLServer mailing list > > >dba-SQLServer at databaseadvisors.com > > >http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > > >http://www.databaseadvisors.com > > > > > > >_________________________________________________________________ > >Search for grocery stores. Find gratitude. Turn a simple search into > >something more. > >http://click4thecause.live.com/search/charity/default.aspx?source=hme > >mtaglin > >e_gratitude&FORM=WLMTAG > > > >_______________________________________________ > >dba-SQLServer mailing list > >dba-SQLServer at databaseadvisors.com > >http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > >http://www.databaseadvisors.com > > > >-- > >No virus found in this incoming message. > >Checked by AVG Free Edition. > >Version: 7.1.411 / Virus Database: 268.17.28/672 - Release Date: > >2/6/2007 > > > > > >_______________________________________________ > >dba-SQLServer mailing list > >dba-SQLServer at databaseadvisors.com > >http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > >http://www.databaseadvisors.com > > > > _________________________________________________________________ > >From predictions to trailers, check out the MSN Entertainment Guide > >to the > Academy Awards(r) > http://movies.msn.com/movies/oscars2007/?icid=ncoscartagline1 > > > _______________________________________________ > 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 -- No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.1.411 / Virus Database: 268.17.28/672 - Release Date: 2/6/2007 From Elizabeth.J.Doering at wellsfargo.com Wed Feb 7 17:09:43 2007 From: Elizabeth.J.Doering at wellsfargo.com (Elizabeth.J.Doering at wellsfargo.com) Date: Wed, 7 Feb 2007 17:09:43 -0600 Subject: [dba-SQLServer] Securables in SQL Server 2005 References: Message-ID: <1C2084FD2472124AB1812A5476EA3B7A0104E5E5@msgswbmnmsp04.wellsfargo.com> Dear List, I hope you can rescue the last of my hair--I've been pulling it out today in large handfuls! In SQL Server 2000, setting permissions for specific roles to be able to execute specific sprocs was a simple operation--boring, but simple. You were shown a list of all the objects you might grant or revoke permissions on and you could arrow and space bar through the list. In 2005, setting permissions for securables for specific roles is a nasty mouse intensive project. You're shown a list of available objects, with possible specific permissions in a separate list below. You select one on the top level, then mouse down to the bottom to click a permission there. And when you have done it all and click ok, the list vanishes completely. Will someone please tell me that I am missing something and that there is an easier way? And then, also, what the easier way is? :) Thanks so much! Liz Liz Doering 612.667.2447 "This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose, or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation" From artful at rogers.com Sun Feb 11 13:18:04 2007 From: artful at rogers.com (artful at rogers.com) Date: Sun, 11 Feb 2007 11:18:04 -0800 (PST) Subject: [dba-SQLServer] Outlandish Pricing? Message-ID: <439918.10823.qm@web88205.mail.re2.yahoo.com> This snip (from http://www.byteandswitch.com/document.asp?doc_id=116900&WT.svl=news1_3) Philipines-based wireless service Smart Communications has deployed the appliance to trawl data on its 22 million subscribers and run checks on fraud and billing information. (See Smart Signs Greenplum.) Pricing for Sun's Data Warehouse Appliance starts at around $22,000 per Tbyte for a 20-Tbyte configuration. I am working via a colleague with a small client who has 62M rows in one table in his database. Copy it once and he is past the 1TB boundary. According to the above, you cannot buy this in chunks smaller than 20TB, which translates to $440,000 per installation. Just what Mom 'n' Pop needs! Arthur Fuller Technical Writer, Data Modeler, SQL Sensei www.artfulsoftware.com From martyconnelly at shaw.ca Sun Feb 11 14:38:27 2007 From: martyconnelly at shaw.ca (MartyConnelly) Date: Sun, 11 Feb 2007 12:38:27 -0800 Subject: [dba-SQLServer] Outlandish Pricing? In-Reply-To: <439918.10823.qm@web88205.mail.re2.yahoo.com> References: <439918.10823.qm@web88205.mail.re2.yahoo.com> Message-ID: <45CF7EC3.6060900@shaw.ca> Well then maybe you fall into this niche category Business Objects aims for midmarket Launches new unit, product line for firms with less than $1B in revenue http://www.computerworld.com/action/article.do?command=viewArticleBasic&taxonomyName=analytics&articleId=9010280&taxonomyId=161&intsrc=kc_top artful at rogers.com wrote: >This snip (from http://www.byteandswitch.com/document.asp?doc_id=116900&WT.svl=news1_3) > >Philipines-based wireless service Smart Communications has deployed the appliance to trawl data on its 22 million subscribers and run checks on fraud and billing information. (See Smart Signs Greenplum.) Pricing for Sun's Data Warehouse Appliance starts at around $22,000 per Tbyte for a 20-Tbyte configuration. > >I am working via a colleague with a small client who has 62M rows in one table in his database. Copy it once and he is past the 1TB boundary. According to the above, you cannot buy this in chunks smaller than 20TB, which translates to $440,000 per installation. Just what Mom 'n' Pop needs! > >Arthur Fuller >Technical Writer, Data Modeler, SQL Sensei >www.artfulsoftware.com > > > -- Marty Connelly Victoria, B.C. Canada From jim.moss at jlmoss.net Mon Feb 12 09:30:17 2007 From: jim.moss at jlmoss.net (Jim Moss) Date: Mon, 12 Feb 2007 09:30:17 -0600 (CST) Subject: [dba-SQLServer] Outlandish Pricing? In-Reply-To: <45CF7EC3.6060900@shaw.ca> References: <439918.10823.qm@web88205.mail.re2.yahoo.com> <45CF7EC3.6060900@shaw.ca> Message-ID: <50764.65.196.182.34.1171294217.squirrel@65.196.182.34> My major client has a NAS solution that is pretty reasonable: http://www.newisys.com/core/na1400.html > Well then maybe you fall into this niche category > > Business Objects aims for midmarket > Launches new unit, product line for firms with less than $1B in revenue > > http://www.computerworld.com/action/article.do?command=viewArticleBasic&taxonomyName=analytics&articleId=9010280&taxonomyId=161&intsrc=kc_top > > > artful at rogers.com wrote: > >>This snip (from >> http://www.byteandswitch.com/document.asp?doc_id=116900&WT.svl=news1_3) >> >>Philipines-based wireless service Smart Communications has deployed the >> appliance to trawl data on its 22 million subscribers and run checks on >> fraud and billing information. (See Smart Signs Greenplum.) Pricing for >> Sun's Data Warehouse Appliance starts at around $22,000 per Tbyte for a >> 20-Tbyte configuration. >> >>I am working via a colleague with a small client who has 62M rows in one >> table in his database. Copy it once and he is past the 1TB boundary. >> According to the above, you cannot buy this in chunks smaller than 20TB, >> which translates to $440,000 per installation. Just what Mom 'n' Pop >> needs! >> >>Arthur Fuller >>Technical Writer, Data Modeler, SQL Sensei >>www.artfulsoftware.com >> >> >> > > -- > Marty Connelly > Victoria, B.C. > Canada > > _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com > > From jwcolby at colbyconsulting.com Mon Feb 12 11:44:51 2007 From: jwcolby at colbyconsulting.com (JWColby) Date: Mon, 12 Feb 2007 12:44:51 -0500 Subject: [dba-SQLServer] Outlandish Pricing? In-Reply-To: <50764.65.196.182.34.1171294217.squirrel@65.196.182.34> Message-ID: <002601c74ecd$80988590$657aa8c0@m6805> And what constitutes "pretty reasonable"? 1 terabyte is rapidly approaching unusable small. Given that you can now purchase 750g drives shipped to your door for $350, a terabyte also starts looking a little humorous. I just finished building a system with 1.8gb usable raid 6. The controller and all of the disks cost me $1300. I just purchased another identical raid controller: http://www.newegg.com/Product/Product.asp?Item=N82E16816131004 I am currently building up another Raid 6 system with (8) 500gb drives for roughly $1700, for a total usable space of around 2.8 terabytes. I can get a 16 drive controller for about $930, and 16 750g drives for $5280 which would leave 14 drives for the raid array (assuming that Raid6 takes 2 for parity) which translates to 4.9 terabytes for about $6200 for the controller and disks. Now obviously I am not a big company with a big company budget but the prices you see above are about the best you can get at my level. Likewise, this is not a full NAS solution, only the "controller down" hardware, but I can roll my own for "pretty reasonable". I have never really found a packaged solution that was "pretty reasonable" for my budget. I have no idea what the likes of Dell or HP would try to charge me for a 4.9 tb raid system, and I suspect I don't want to know. 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 Moss Sent: Monday, February 12, 2007 10:30 AM To: dba-sqlserver at databaseadvisors.com Subject: Re: [dba-SQLServer] Outlandish Pricing? My major client has a NAS solution that is pretty reasonable: http://www.newisys.com/core/na1400.html > Well then maybe you fall into this niche category > > Business Objects aims for midmarket > Launches new unit, product line for firms with less than $1B in > revenue > > http://www.computerworld.com/action/article.do?command=viewArticleBasi > c&taxonomyName=analytics&articleId=9010280&taxonomyId=161&intsrc=kc_to > p > > > artful at rogers.com wrote: > >>This snip (from >> >>http://www.byteandswitch.com/document.asp?doc_id=116900&WT.svl=news1_3 >>) >> >>Philipines-based wireless service Smart Communications has deployed >>the appliance to trawl data on its 22 million subscribers and run >>checks on fraud and billing information. (See Smart Signs Greenplum.) >>Pricing for Sun's Data Warehouse Appliance starts at around $22,000 >>per Tbyte for a 20-Tbyte configuration. >> >>I am working via a colleague with a small client who has 62M rows in >>one table in his database. Copy it once and he is past the 1TB boundary. >> According to the above, you cannot buy this in chunks smaller than >>20TB, which translates to $440,000 per installation. Just what Mom >>'n' Pop needs! >> >>Arthur Fuller >>Technical Writer, Data Modeler, SQL Sensei www.artfulsoftware.com >> >> >> > > -- > Marty Connelly > Victoria, B.C. > Canada > > _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com > > _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From jim.moss at jlmoss.net Tue Feb 13 15:52:41 2007 From: jim.moss at jlmoss.net (Jim Moss) Date: Tue, 13 Feb 2007 15:52:41 -0600 (CST) Subject: [dba-SQLServer] Outlandish Pricing? In-Reply-To: <002601c74ecd$80988590$657aa8c0@m6805> References: <50764.65.196.182.34.1171294217.squirrel@65.196.182.34> <002601c74ecd$80988590$657aa8c0@m6805> Message-ID: <54611.65.196.182.34.1171403561.squirrel@65.196.182.34> John, What I remember from the press release from something like last March was 2 tb for under $2000. And I think that it was mentioned that the appliance could be upgraded to 6 tb? for a total cost of of around $6000. I just downloaded a .ppt from the company website and will forward zipped, to your email address. Jim > And what constitutes "pretty reasonable"? 1 terabyte is rapidly > approaching > unusable small. Given that you can now purchase 750g drives shipped to > your > door for $350, a terabyte also starts looking a little humorous. > > I just finished building a system with 1.8gb usable raid 6. The > controller > and all of the disks cost me $1300. I just purchased another identical > raid > controller: > > http://www.newegg.com/Product/Product.asp?Item=N82E16816131004 > > I am currently building up another Raid 6 system with (8) 500gb drives for > roughly $1700, for a total usable space of around 2.8 terabytes. I can > get > a 16 drive controller for about $930, and 16 750g drives for $5280 which > would leave 14 drives for the raid array (assuming that Raid6 takes 2 for > parity) which translates to 4.9 terabytes for about $6200 for the > controller > and disks. > > Now obviously I am not a big company with a big company budget but the > prices you see above are about the best you can get at my level. > Likewise, > this is not a full NAS solution, only the "controller down" hardware, but > I > can roll my own for "pretty reasonable". I have never really found a > packaged solution that was "pretty reasonable" for my budget. I have no > idea what the likes of Dell or HP would try to charge me for a 4.9 tb raid > system, and I suspect I don't want to know. > > 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 Moss > Sent: Monday, February 12, 2007 10:30 AM > To: dba-sqlserver at databaseadvisors.com > Subject: Re: [dba-SQLServer] Outlandish Pricing? > > My major client has a NAS solution that is pretty reasonable: > > > http://www.newisys.com/core/na1400.html > > >> Well then maybe you fall into this niche category >> >> Business Objects aims for midmarket >> Launches new unit, product line for firms with less than $1B in >> revenue >> >> http://www.computerworld.com/action/article.do?command=viewArticleBasi >> c&taxonomyName=analytics&articleId=9010280&taxonomyId=161&intsrc=kc_to >> p >> >> >> artful at rogers.com wrote: >> >>>This snip (from >>> >>>http://www.byteandswitch.com/document.asp?doc_id=116900&WT.svl=news1_3 >>>) >>> >>>Philipines-based wireless service Smart Communications has deployed >>>the appliance to trawl data on its 22 million subscribers and run >>>checks on fraud and billing information. (See Smart Signs Greenplum.) >>>Pricing for Sun's Data Warehouse Appliance starts at around $22,000 >>>per Tbyte for a 20-Tbyte configuration. >>> >>>I am working via a colleague with a small client who has 62M rows in >>>one table in his database. Copy it once and he is past the 1TB >>> boundary. >>> According to the above, you cannot buy this in chunks smaller than >>>20TB, which translates to $440,000 per installation. Just what Mom >>>'n' Pop needs! >>> >>>Arthur Fuller >>>Technical Writer, Data Modeler, SQL Sensei www.artfulsoftware.com >>> >>> >>> >> >> -- >> Marty Connelly >> Victoria, B.C. >> Canada >> >> _______________________________________________ >> dba-SQLServer mailing list >> dba-SQLServer at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/dba-sqlserver >> http://www.databaseadvisors.com >> >> > > > _______________________________________________ > 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 fhtapia at gmail.com Wed Feb 14 11:49:10 2007 From: fhtapia at gmail.com (Francisco Tapia) Date: Wed, 14 Feb 2007 09:49:10 -0800 Subject: [dba-SQLServer] Reporting Services: Data Driven Subscriptions Message-ID: http://www.sqlservercentral.com/columnists/jselburg/datadrivensubscriptions.asp http://www.sqlservercentral.com/columnists/jselburg/2824.asp If you ever wanted a data driven Subscription from RS, this is one way to do it. take note that the code was updated hence read the 2nd article as well. -- -Francisco http://sqlthis.blogspot.com | Tsql and More... From jwcolby at colbyconsulting.com Wed Feb 14 14:29:16 2007 From: jwcolby at colbyconsulting.com (JWColby) Date: Wed, 14 Feb 2007 15:29:16 -0500 Subject: [dba-SQLServer] SQl Server Organization Message-ID: <00ac01c75076$ccc95ca0$657aa8c0@m6805> I'm searching for a strategy for organizing SQL Server (2005 if it makes any difference). The situation is that I have a set of tables holding data. I get "orders" for counts of data, i.e. how many people where... The client wants these counts repeatable, and later to be able to say, "give me records of all the people represented in that count". The client also may come back and say "ok now refine it and give me the same count where..." and the where clause changes slightly. Same order, refining the search. I will potentially, sometime in the future, get a half dozen to a dozen of these orders a week, and each order is completely different from the previous order, so each requires building new views and queries to create the counts. Having done a bunch of these things, I am coming to the conclusion that I perhaps should create a database for each order, the database named by the order. Create all of the views etc required to do the count in its own database. That database then pulls the data itself from another database where the actual data behind the counts resides. Each count does have an "order number" associated with it, so I could of course prefix any objects created in the process of generating these counts with the order number. Thus all the objects would group in the view window (for example) by Order Number. I could also build a "month" database where all of the objects for all the orders for a month get placed in that month's database. The key concept here is that a count order needs to be retained and repeatable, out how long I do not know but at least until the order is completed by my client (with his client) and likely even way beyond that. My client's client may come back and ask for the counts again, or modify the "where" slightly and ask for the counts again. Thus I need a system that groups everything required to get that count, and needs to be easily found (by the order number). To this point I have been placing all of the objects in the same database and it is getting ugly. Does anyone have any thoughts on this matter? John W. Colby Colby Consulting www.ColbyConsulting.com From jwcolby at colbyconsulting.com Wed Feb 14 14:53:53 2007 From: jwcolby at colbyconsulting.com (JWColby) Date: Wed, 14 Feb 2007 15:53:53 -0500 Subject: [dba-SQLServer] SQl Server Organization In-Reply-To: <00ac01c75076$ccc95ca0$657aa8c0@m6805> Message-ID: <00b401c7507a$3d092470$657aa8c0@m6805> On a related note, what makes queries so special that they get stored out on the hard disk as opposed to in a tab in the database? 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 JWColby Sent: Wednesday, February 14, 2007 3:29 PM To: dba-sqlserver at databaseadvisors.com Subject: [dba-SQLServer] SQl Server Organization I'm searching for a strategy for organizing SQL Server (2005 if it makes any difference). The situation is that I have a set of tables holding data. I get "orders" for counts of data, i.e. how many people where... The client wants these counts repeatable, and later to be able to say, "give me records of all the people represented in that count". The client also may come back and say "ok now refine it and give me the same count where..." and the where clause changes slightly. Same order, refining the search. I will potentially, sometime in the future, get a half dozen to a dozen of these orders a week, and each order is completely different from the previous order, so each requires building new views and queries to create the counts. Having done a bunch of these things, I am coming to the conclusion that I perhaps should create a database for each order, the database named by the order. Create all of the views etc required to do the count in its own database. That database then pulls the data itself from another database where the actual data behind the counts resides. Each count does have an "order number" associated with it, so I could of course prefix any objects created in the process of generating these counts with the order number. Thus all the objects would group in the view window (for example) by Order Number. I could also build a "month" database where all of the objects for all the orders for a month get placed in that month's database. The key concept here is that a count order needs to be retained and repeatable, out how long I do not know but at least until the order is completed by my client (with his client) and likely even way beyond that. My client's client may come back and ask for the counts again, or modify the "where" slightly and ask for the counts again. Thus I need a system that groups everything required to get that count, and needs to be easily found (by the order number). To this point I have been placing all of the objects in the same database and it is getting ugly. Does anyone have any thoughts on this matter? 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 artful at rogers.com Wed Feb 14 15:54:52 2007 From: artful at rogers.com (artful at rogers.com) Date: Wed, 14 Feb 2007 13:54:52 -0800 (PST) Subject: [dba-SQLServer] SQl Server Organization Message-ID: <311573.24073.qm@web88211.mail.re2.yahoo.com> You could go that route, JC, but I wouldn't recommend it. I think that you have only one choice, which is to normalize all the columns (the Y/Ns etc.) and to populate the child table with a row for each of these Not-Null (or not Empty) values. Admittedly this will result in a table comprising maybe 500M rows, but it will be searchable by Integer values on a compound index, and thus with a count() and a having() give you the people of interest very quickly. Arthur Fuller Technical Writer, Data Modeler, SQL Sensei Artful Databases Organization www.artfulsoftware.com ----- Original Message ---- From: JWColby To: dba-sqlserver at databaseadvisors.com Sent: Wednesday, February 14, 2007 3:29:16 PM Subject: [dba-SQLServer] SQl Server Organization I'm searching for a strategy for organizing SQL Server (2005 if it makes any difference). The situation is that I have a set of tables holding data. I get "orders" for counts of data, i.e. how many people where... The client wants these counts repeatable, and later to be able to say, "give me records of all the people represented in that count". The client also may come back and say "ok now refine it and give me the same count where..." and the where clause changes slightly. Same order, refining the search. I will potentially, sometime in the future, get a half dozen to a dozen of these orders a week, and each order is completely different from the previous order, so each requires building new views and queries to create the counts. Having done a bunch of these things, I am coming to the conclusion that I perhaps should create a database for each order, the database named by the order. Create all of the views etc required to do the count in its own database. That database then pulls the data itself from another database where the actual data behind the counts resides. Each count does have an "order number" associated with it, so I could of course prefix any objects created in the process of generating these counts with the order number. Thus all the objects would group in the view window (for example) by Order Number. I could also build a "month" database where all of the objects for all the orders for a month get placed in that month's database. The key concept here is that a count order needs to be retained and repeatable, out how long I do not know but at least until the order is completed by my client (with his client) and likely even way beyond that. My client's client may come back and ask for the counts again, or modify the "where" slightly and ask for the counts again. Thus I need a system that groups everything required to get that count, and needs to be easily found (by the order number). To this point I have been placing all of the objects in the same database and it is getting ugly. Does anyone have any thoughts on this matter? 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 14 17:56:30 2007 From: jwcolby at colbyconsulting.com (JWColby) Date: Wed, 14 Feb 2007 18:56:30 -0500 Subject: [dba-SQLServer] SQl Server Organization In-Reply-To: <311573.24073.qm@web88211.mail.re2.yahoo.com> Message-ID: <00c001c75093$bfb3e180$657aa8c0@m6805> Even should I go that route I still need to be able to save whatever queries, views and other objects are used to obtain a count. And I don't have a system in place to do what you mention so there is "the meantime" to deal with. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of artful at rogers.com Sent: Wednesday, February 14, 2007 4:55 PM To: dba-sqlserver at databaseadvisors.com Subject: Re: [dba-SQLServer] SQl Server Organization You could go that route, JC, but I wouldn't recommend it. I think that you have only one choice, which is to normalize all the columns (the Y/Ns etc.) and to populate the child table with a row for each of these Not-Null (or not Empty) values. Admittedly this will result in a table comprising maybe 500M rows, but it will be searchable by Integer values on a compound index, and thus with a count() and a having() give you the people of interest very quickly. Arthur Fuller Technical Writer, Data Modeler, SQL Sensei Artful Databases Organization www.artfulsoftware.com ----- Original Message ---- From: JWColby To: dba-sqlserver at databaseadvisors.com Sent: Wednesday, February 14, 2007 3:29:16 PM Subject: [dba-SQLServer] SQl Server Organization I'm searching for a strategy for organizing SQL Server (2005 if it makes any difference). The situation is that I have a set of tables holding data. I get "orders" for counts of data, i.e. how many people where... The client wants these counts repeatable, and later to be able to say, "give me records of all the people represented in that count". The client also may come back and say "ok now refine it and give me the same count where..." and the where clause changes slightly. Same order, refining the search. I will potentially, sometime in the future, get a half dozen to a dozen of these orders a week, and each order is completely different from the previous order, so each requires building new views and queries to create the counts. Having done a bunch of these things, I am coming to the conclusion that I perhaps should create a database for each order, the database named by the order. Create all of the views etc required to do the count in its own database. That database then pulls the data itself from another database where the actual data behind the counts resides. Each count does have an "order number" associated with it, so I could of course prefix any objects created in the process of generating these counts with the order number. Thus all the objects would group in the view window (for example) by Order Number. I could also build a "month" database where all of the objects for all the orders for a month get placed in that month's database. The key concept here is that a count order needs to be retained and repeatable, out how long I do not know but at least until the order is completed by my client (with his client) and likely even way beyond that. My client's client may come back and ask for the counts again, or modify the "where" slightly and ask for the counts again. Thus I need a system that groups everything required to get that count, and needs to be easily found (by the order number). To this point I have been placing all of the objects in the same database and it is getting ugly. Does anyone have any thoughts on this matter? 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 DavidL at sierranevada.com Thu Feb 15 13:12:29 2007 From: DavidL at sierranevada.com (David Lewis) Date: Thu, 15 Feb 2007 11:12:29 -0800 Subject: [dba-SQLServer] Ordering sql server In-Reply-To: References: Message-ID: <00101736F13D774F88C54058CB2663C8010D232A@celebration.sierranevada.corp> John: Here is what I understand you to be asking. You have a db with static data. Client 1 calls with a request for info on that. You supply it. Client 1 later calls with a new request. You supply that. You would like to be able to reproduce on demand request 1, 2, etc. Assuming the underlying data does not change, it means running the query associated with each request. To that end, perhaps a table structure saving the queries (the text of the queries, that is) is the way to go. HTH. D. Lewis -----Original Message----- ---------------------------------------------------------------------- Message: 1 Date: Wed, 14 Feb 2007 15:29:16 -0500 From: "JWColby" Subject: [dba-SQLServer] SQl Server Organization To: Message-ID: <00ac01c75076$ccc95ca0$657aa8c0 at m6805> Content-Type: text/plain; charset="us-ascii" I'm searching for a strategy for organizing SQL Server (2005 if it makes any difference). The situation is that I have a set of tables holding data. I get "orders" for counts of data, i.e. how many people where... The client wants these counts repeatable, and later to be able to say, "give me records of all the people represented in that count". The client also may come back and say "ok now refine it and give me the same count where..." and the where clause changes slightly. Same order, refining the search. I will potentially, sometime in the future, get a half dozen to a dozen of these orders a week, and each order is completely different from the previous order, so each requires building new views and queries to create the counts. Having done a bunch of these things, I am coming to the conclusion that I perhaps should create a database for each order, the database named by the order. Create all of the views etc required to do the count in its own database. That database then pulls the data itself from another database where the actual data behind the counts resides. Each count does have an "order number" associated with it, so I could of course prefix any objects created in the process of generating these counts with the order number. Thus all the objects would group in the view window (for example) by Order Number. I could also build a "month" database where all of the objects for all the orders for a month get placed in that month's database. The key concept here is that a count order needs to be retained and repeatable, out how long I do not know but at least until the order is completed by my client (with his client) and likely even way beyond that. My client's client may come back and ask for the counts again, or modify the "where" slightly and ask for the counts again. Thus I need a system that groups everything required to get that count, and needs to be easily found (by the order number). To this point I have been placing all of the objects in the same database and it is getting ugly. Does anyone have any thoughts on this matter? John W. Colby Colby Consulting www.ColbyConsulting.com From greg at worthey.com Thu Feb 15 13:27:16 2007 From: greg at worthey.com (Greg Worthey) Date: Thu, 15 Feb 2007 11:27:16 -0800 Subject: [dba-SQLServer] John Colby's problem In-Reply-To: Message-ID: <007a01c75137$4eff3df0$1601a8c0@fb2a618> John, If I understand you correctly, here's what you need to do: Figure out a set of criteria that describe a "count order", then put each order as a record in a table. You say all the orders are different, but after you get enough of them, they all should fit some set of criteria. Then, when there is some demand against that order (give summary of counts, or give all names, etc), you have a SQL query builder that uses the criteria from the order to query the data on demand. It sounds like you're replicating data where all you need to do is query it. If you create a database for each order, you'll have a huge mess on your hands when they start coming in frequently. Generalize the criteria for the orders and keep everything in one database, and it should be tidy. Greg Worthey Worthey Solutions www.worthey.com -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of dba-sqlserver-request at databaseadvisors.com Sent: Thursday, February 15, 2007 10:00 AM To: dba-sqlserver at databaseadvisors.com Subject: dba-SQLServer Digest, Vol 48, Issue 11 Send dba-SQLServer mailing list submissions to dba-sqlserver at databaseadvisors.com To subscribe or unsubscribe via the World Wide Web, visit http://databaseadvisors.com/mailman/listinfo/dba-sqlserver or, via email, send a message with subject or body 'help' to dba-sqlserver-request at databaseadvisors.com You can reach the person managing the list at dba-sqlserver-owner at databaseadvisors.com When replying, please edit your Subject line so it is more specific than "Re: Contents of dba-SQLServer digest..." Today's Topics: 1. SQl Server Organization (JWColby) 2. Re: SQl Server Organization (JWColby) 3. Re: SQl Server Organization (artful at rogers.com) 4. Re: SQl Server Organization (JWColby) ---------------------------------------------------------------------- Message: 1 Date: Wed, 14 Feb 2007 15:29:16 -0500 From: "JWColby" Subject: [dba-SQLServer] SQl Server Organization To: Message-ID: <00ac01c75076$ccc95ca0$657aa8c0 at m6805> Content-Type: text/plain; charset="us-ascii" I'm searching for a strategy for organizing SQL Server (2005 if it makes any difference). The situation is that I have a set of tables holding data. I get "orders" for counts of data, i.e. how many people where... The client wants these counts repeatable, and later to be able to say, "give me records of all the people represented in that count". The client also may come back and say "ok now refine it and give me the same count where..." and the where clause changes slightly. Same order, refining the search. I will potentially, sometime in the future, get a half dozen to a dozen of these orders a week, and each order is completely different from the previous order, so each requires building new views and queries to create the counts. Having done a bunch of these things, I am coming to the conclusion that I perhaps should create a database for each order, the database named by the order. Create all of the views etc required to do the count in its own database. That database then pulls the data itself from another database where the actual data behind the counts resides. Each count does have an "order number" associated with it, so I could of course prefix any objects created in the process of generating these counts with the order number. Thus all the objects would group in the view window (for example) by Order Number. I could also build a "month" database where all of the objects for all the orders for a month get placed in that month's database. The key concept here is that a count order needs to be retained and repeatable, out how long I do not know but at least until the order is completed by my client (with his client) and likely even way beyond that. My client's client may come back and ask for the counts again, or modify the "where" slightly and ask for the counts again. Thus I need a system that groups everything required to get that count, and needs to be easily found (by the order number). To this point I have been placing all of the objects in the same database and it is getting ugly. Does anyone have any thoughts on this matter? John W. Colby Colby Consulting www.ColbyConsulting.com ------------------------------ Message: 2 Date: Wed, 14 Feb 2007 15:53:53 -0500 From: "JWColby" Subject: Re: [dba-SQLServer] SQl Server Organization To: Message-ID: <00b401c7507a$3d092470$657aa8c0 at m6805> Content-Type: text/plain; charset="us-ascii" On a related note, what makes queries so special that they get stored out on the hard disk as opposed to in a tab in the database? 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 JWColby Sent: Wednesday, February 14, 2007 3:29 PM To: dba-sqlserver at databaseadvisors.com Subject: [dba-SQLServer] SQl Server Organization I'm searching for a strategy for organizing SQL Server (2005 if it makes any difference). The situation is that I have a set of tables holding data. I get "orders" for counts of data, i.e. how many people where... The client wants these counts repeatable, and later to be able to say, "give me records of all the people represented in that count". The client also may come back and say "ok now refine it and give me the same count where..." and the where clause changes slightly. Same order, refining the search. I will potentially, sometime in the future, get a half dozen to a dozen of these orders a week, and each order is completely different from the previous order, so each requires building new views and queries to create the counts. Having done a bunch of these things, I am coming to the conclusion that I perhaps should create a database for each order, the database named by the order. Create all of the views etc required to do the count in its own database. That database then pulls the data itself from another database where the actual data behind the counts resides. Each count does have an "order number" associated with it, so I could of course prefix any objects created in the process of generating these counts with the order number. Thus all the objects would group in the view window (for example) by Order Number. I could also build a "month" database where all of the objects for all the orders for a month get placed in that month's database. The key concept here is that a count order needs to be retained and repeatable, out how long I do not know but at least until the order is completed by my client (with his client) and likely even way beyond that. My client's client may come back and ask for the counts again, or modify the "where" slightly and ask for the counts again. Thus I need a system that groups everything required to get that count, and needs to be easily found (by the order number). To this point I have been placing all of the objects in the same database and it is getting ugly. Does anyone have any thoughts on this matter? 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 ------------------------------ Message: 3 Date: Wed, 14 Feb 2007 13:54:52 -0800 (PST) From: artful at rogers.com Subject: Re: [dba-SQLServer] SQl Server Organization To: dba-sqlserver at databaseadvisors.com Message-ID: <311573.24073.qm at web88211.mail.re2.yahoo.com> Content-Type: text/plain; charset=iso-8859-1 You could go that route, JC, but I wouldn't recommend it. I think that you have only one choice, which is to normalize all the columns (the Y/Ns etc.) and to populate the child table with a row for each of these Not-Null (or not Empty) values. Admittedly this will result in a table comprising maybe 500M rows, but it will be searchable by Integer values on a compound index, and thus with a count() and a having() give you the people of interest very quickly. Arthur Fuller Technical Writer, Data Modeler, SQL Sensei Artful Databases Organization www.artfulsoftware.com ----- Original Message ---- From: JWColby To: dba-sqlserver at databaseadvisors.com Sent: Wednesday, February 14, 2007 3:29:16 PM Subject: [dba-SQLServer] SQl Server Organization I'm searching for a strategy for organizing SQL Server (2005 if it makes any difference). The situation is that I have a set of tables holding data. I get "orders" for counts of data, i.e. how many people where... The client wants these counts repeatable, and later to be able to say, "give me records of all the people represented in that count". The client also may come back and say "ok now refine it and give me the same count where..." and the where clause changes slightly. Same order, refining the search. I will potentially, sometime in the future, get a half dozen to a dozen of these orders a week, and each order is completely different from the previous order, so each requires building new views and queries to create the counts. Having done a bunch of these things, I am coming to the conclusion that I perhaps should create a database for each order, the database named by the order. Create all of the views etc required to do the count in its own database. That database then pulls the data itself from another database where the actual data behind the counts resides. Each count does have an "order number" associated with it, so I could of course prefix any objects created in the process of generating these counts with the order number. Thus all the objects would group in the view window (for example) by Order Number. I could also build a "month" database where all of the objects for all the orders for a month get placed in that month's database. The key concept here is that a count order needs to be retained and repeatable, out how long I do not know but at least until the order is completed by my client (with his client) and likely even way beyond that. My client's client may come back and ask for the counts again, or modify the "where" slightly and ask for the counts again. Thus I need a system that groups everything required to get that count, and needs to be easily found (by the order number). To this point I have been placing all of the objects in the same database and it is getting ugly. Does anyone have any thoughts on this matter? 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 ------------------------------ Message: 4 Date: Wed, 14 Feb 2007 18:56:30 -0500 From: "JWColby" Subject: Re: [dba-SQLServer] SQl Server Organization To: Message-ID: <00c001c75093$bfb3e180$657aa8c0 at m6805> Content-Type: text/plain; charset="us-ascii" Even should I go that route I still need to be able to save whatever queries, views and other objects are used to obtain a count. And I don't have a system in place to do what you mention so there is "the meantime" to deal with. John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of artful at rogers.com Sent: Wednesday, February 14, 2007 4:55 PM To: dba-sqlserver at databaseadvisors.com Subject: Re: [dba-SQLServer] SQl Server Organization You could go that route, JC, but I wouldn't recommend it. I think that you have only one choice, which is to normalize all the columns (the Y/Ns etc.) and to populate the child table with a row for each of these Not-Null (or not Empty) values. Admittedly this will result in a table comprising maybe 500M rows, but it will be searchable by Integer values on a compound index, and thus with a count() and a having() give you the people of interest very quickly. Arthur Fuller Technical Writer, Data Modeler, SQL Sensei Artful Databases Organization www.artfulsoftware.com ----- Original Message ---- From: JWColby To: dba-sqlserver at databaseadvisors.com Sent: Wednesday, February 14, 2007 3:29:16 PM Subject: [dba-SQLServer] SQl Server Organization I'm searching for a strategy for organizing SQL Server (2005 if it makes any difference). The situation is that I have a set of tables holding data. I get "orders" for counts of data, i.e. how many people where... The client wants these counts repeatable, and later to be able to say, "give me records of all the people represented in that count". The client also may come back and say "ok now refine it and give me the same count where..." and the where clause changes slightly. Same order, refining the search. I will potentially, sometime in the future, get a half dozen to a dozen of these orders a week, and each order is completely different from the previous order, so each requires building new views and queries to create the counts. Having done a bunch of these things, I am coming to the conclusion that I perhaps should create a database for each order, the database named by the order. Create all of the views etc required to do the count in its own database. That database then pulls the data itself from another database where the actual data behind the counts resides. Each count does have an "order number" associated with it, so I could of course prefix any objects created in the process of generating these counts with the order number. Thus all the objects would group in the view window (for example) by Order Number. I could also build a "month" database where all of the objects for all the orders for a month get placed in that month's database. The key concept here is that a count order needs to be retained and repeatable, out how long I do not know but at least until the order is completed by my client (with his client) and likely even way beyond that. My client's client may come back and ask for the counts again, or modify the "where" slightly and ask for the counts again. Thus I need a system that groups everything required to get that count, and needs to be easily found (by the order number). To this point I have been placing all of the objects in the same database and it is getting ugly. Does anyone have any thoughts on this matter? 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 End of dba-SQLServer Digest, Vol 48, Issue 11 ********************************************* From jwcolby at colbyconsulting.com Thu Feb 15 14:04:55 2007 From: jwcolby at colbyconsulting.com (JWColby) Date: Thu, 15 Feb 2007 15:04:55 -0500 Subject: [dba-SQLServer] John Colby's problem In-Reply-To: <007a01c75137$4eff3df0$1601a8c0@fb2a618> Message-ID: <011c01c7513c$903c7f80$657aa8c0@m6805> OK, a little background. The client sells lists of names to bulk mailers (paper bulk mail). The client gets list (what I call surveys, because that is a more accurate description), which contain name / address information and then (usually) survey information such as "what brand of cigarette do you smoke, or what types of computers do you use etc. These surveys can be about ANYTHING that my client finds useful to purchase the lists for. My job is to somehow make sense of these. I take the lists and pull them into SQL Server. I then immediately send the lists out for address validation processing. "Sending out" really means that I process the names and send them through a address processing system running on my system, which can reach out over the internet to get certain parts of the processing done (NCOA specifically). At the end of the day, I then have a list of names which have been validated. Some of the names / addresses fail validation and I purge them. All the names which pass validation I keep. Passing means that the ADDRESS is actually deliverable, and MAYBE the person actually lives at that address. They PROBABLY lived at that address at some time in the past (when was the survey taken?). I then have to build a master table of addresses, people, and people who live at addresses. I also have to tie the SURVEY (remember the survey questions) back in to the names / addresses. Let's take an example. My client buys a list of 80 million names / addresses from a mortgage bank. It has names / addresses / income information / property information (info about the property purchased). I import into SQL Server, export back out for address validation. In THIS case, likely an EXTREMELY high percentage of the names / addresses are valid since a mortgage company used the info to process mortgage applications. Anyway, as you can see, I now have two distinct "sets" of data, the person / address / PersonAddress set, and the information about the property and of course also about the person's income etc. Now, my job is to tie all this back in to a master database of names and addresses. For example, if a person purchased a property, they now live there, I know their income, I know the property price, I know the number of rooms, bathrooms, has a pool etc. That ADDRESS info has to be "matched" against addresses already in my database from other lists that I have processed in the past. The PERSON information also needs to be tied in to information I have about PEOPLE that I obtained from other lists. I might get an NCOA that shows that person MOVING TO the new house they just purchased ALREADY IN MY TABLES from some other list. Furthermore I have to create a brand new table (and yes, Arthur has other ideas as yet unimplemented) that contains the PROPERTY information and links that to a table of deliverable addresses I have built up. So I end up with a system of tables - people / address / survey1 / survey2 / survey3 / survey4. Survey1/2/3/4... All end up with pointers to a specific PERSON since that information is about their personal preferences (brands of soap, soft drinks, computers etc.) NOW... (are you still with me?) I get a request from my client (who got a request from HIS client) for a COUNT all the people in age bracket XXX, income bracket YYY, zip codes AAA, that own a pool and drive a Mercedes or a BMW. I create a system of views / queries to pull all of the pieces together, and count those people. I then get another order from my client (for a different client of theirs) for a count of all the people in zip code BBB who use detergent X, they really don't care about the age or income. Next count order, next count order, modify count order 1, modify count order 2, new count order, etc. I end up with a single list of addresses, a single list of people, a m-m table of what addresses people lived at when, and 47 different SURVEY tables, until tomorrow of course when my client buys surveys number 49, 50 and 51 and I start the process of integrating that data into the system. Arthur in the meantime espouses a system where each answer in each survey table is merged into one big SurveyAnswer table with FKs back to people / survey fields. Which is almost assuredly the correct answer however that method requires a huge programming effort (and immense crunching on my computer) to get the data normalized in this manner, and then to allow extraction of the data in order to do the counts. And if I use this metaphor, what happens when I get another list from another mortgage company where the same basic information (property size, number of rooms, has a pool) is purchased? I do NOT want this stored as two different "surveys" but rather merged into one. Well anyway, there ya go. I need organization. I need organization on the front end when I turn these lists into data, and I need organization on the back end when I process orders for counts against the data, and someday when I process orders for name/address lists to be sold. Some day soon (assuming you live in the USA) I will know EVERYTHING about YOU! Bwaaahaaaaahaaa. Kinda scary really. Enough to make you think twice about taking surveys. 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 Greg Worthey Sent: Thursday, February 15, 2007 2:27 PM To: dba-sqlserver at databaseadvisors.com Subject: [dba-SQLServer] John Colby's problem John, If I understand you correctly, here's what you need to do: Figure out a set of criteria that describe a "count order", then put each order as a record in a table. You say all the orders are different, but after you get enough of them, they all should fit some set of criteria. Then, when there is some demand against that order (give summary of counts, or give all names, etc), you have a SQL query builder that uses the criteria from the order to query the data on demand. It sounds like you're replicating data where all you need to do is query it. If you create a database for each order, you'll have a huge mess on your hands when they start coming in frequently. Generalize the criteria for the orders and keep everything in one database, and it should be tidy. Greg Worthey Worthey Solutions www.worthey.com From artful at rogers.com Thu Feb 15 21:21:26 2007 From: artful at rogers.com (artful at rogers.com) Date: Thu, 15 Feb 2007 19:21:26 -0800 (PST) Subject: [dba-SQLServer] John Colby's problem Message-ID: <239084.30978.qm@web88207.mail.re2.yahoo.com> Blame it all on me, JC. I told you how to do it and you resist. That's ok. I have been resisted before LOL. But I'm right. You normalize the columns and admittedly you end up with 600M rows but they are indexable and your speed goes up 1000 times. Your queries reduce to something like "Smoker = Y and Cailis = Y and Divorced = Soon". Add to that the fact that the retrieved rows all automatically point to the people in question. I don't see the point of your objection. This seems to me entirely straightforward, and 600M rows is child's play, assuming that everything is stored and indexed correctly. I can do 600M rows in an indexed search in less than a second. I've got the data to prove it. Arthur Fuller Technical Writer, Data Modeler, SQL Sensei Artful Databases Organization www.artfulsoftware.com ----- Original Message ---- From: JWColby To: dba-sqlserver at databaseadvisors.com Sent: Thursday, February 15, 2007 3:04:55 PM Subject: Re: [dba-SQLServer] John Colby's problem OK, a little background. The client sells lists of names to bulk mailers (paper bulk mail). The client gets list (what I call surveys, because that is a more accurate description), which contain name / address information and then (usually) survey information such as "what brand of cigarette do you smoke, or what types of computers do you use etc. These surveys can be about ANYTHING that my client finds useful to purchase the lists for. My job is to somehow make sense of these. I take the lists and pull them into SQL Server. I then immediately send the lists out for address validation processing. "Sending out" really means that I process the names and send them through a address processing system running on my system, which can reach out over the internet to get certain parts of the processing done (NCOA specifically). At the end of the day, I then have a list of names which have been validated. Some of the names / addresses fail validation and I purge them. All the names which pass validation I keep. Passing means that the ADDRESS is actually deliverable, and MAYBE the person actually lives at that address. They PROBABLY lived at that address at some time in the past (when was the survey taken?). I then have to build a master table of addresses, people, and people who live at addresses. I also have to tie the SURVEY (remember the survey questions) back in to the names / addresses. Let's take an example. My client buys a list of 80 million names / addresses from a mortgage bank. It has names / addresses / income information / property information (info about the property purchased). I import into SQL Server, export back out for address validation. In THIS case, likely an EXTREMELY high percentage of the names / addresses are valid since a mortgage company used the info to process mortgage applications. Anyway, as you can see, I now have two distinct "sets" of data, the person / address / PersonAddress set, and the information about the property and of course also about the person's income etc. Now, my job is to tie all this back in to a master database of names and addresses. For example, if a person purchased a property, they now live there, I know their income, I know the property price, I know the number of rooms, bathrooms, has a pool etc. That ADDRESS info has to be "matched" against addresses already in my database from other lists that I have processed in the past. The PERSON information also needs to be tied in to information I have about PEOPLE that I obtained from other lists. I might get an NCOA that shows that person MOVING TO the new house they just purchased ALREADY IN MY TABLES from some other list. Furthermore I have to create a brand new table (and yes, Arthur has other ideas as yet unimplemented) that contains the PROPERTY information and links that to a table of deliverable addresses I have built up. So I end up with a system of tables - people / address / survey1 / survey2 / survey3 / survey4. Survey1/2/3/4... All end up with pointers to a specific PERSON since that information is about their personal preferences (brands of soap, soft drinks, computers etc.) NOW... (are you still with me?) I get a request from my client (who got a request from HIS client) for a COUNT all the people in age bracket XXX, income bracket YYY, zip codes AAA, that own a pool and drive a Mercedes or a BMW. I create a system of views / queries to pull all of the pieces together, and count those people. I then get another order from my client (for a different client of theirs) for a count of all the people in zip code BBB who use detergent X, they really don't care about the age or income. Next count order, next count order, modify count order 1, modify count order 2, new count order, etc. I end up with a single list of addresses, a single list of people, a m-m table of what addresses people lived at when, and 47 different SURVEY tables, until tomorrow of course when my client buys surveys number 49, 50 and 51 and I start the process of integrating that data into the system. Arthur in the meantime espouses a system where each answer in each survey table is merged into one big SurveyAnswer table with FKs back to people / survey fields. Which is almost assuredly the correct answer however that method requires a huge programming effort (and immense crunching on my computer) to get the data normalized in this manner, and then to allow extraction of the data in order to do the counts. And if I use this metaphor, what happens when I get another list from another mortgage company where the same basic information (property size, number of rooms, has a pool) is purchased? I do NOT want this stored as two different "surveys" but rather merged into one. Well anyway, there ya go. I need organization. I need organization on the front end when I turn these lists into data, and I need organization on the back end when I process orders for counts against the data, and someday when I process orders for name/address lists to be sold. Some day soon (assuming you live in the USA) I will know EVERYTHING about YOU! Bwaaahaaaaahaaa. Kinda scary really. Enough to make you think twice about taking surveys. 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 Greg Worthey Sent: Thursday, February 15, 2007 2:27 PM To: dba-sqlserver at databaseadvisors.com Subject: [dba-SQLServer] John Colby's problem John, If I understand you correctly, here's what you need to do: Figure out a set of criteria that describe a "count order", then put each order as a record in a table. You say all the orders are different, but after you get enough of them, they all should fit some set of criteria. Then, when there is some demand against that order (give summary of counts, or give all names, etc), you have a SQL query builder that uses the criteria from the order to query the data on demand. It sounds like you're replicating data where all you need to do is query it. If you create a database for each order, you'll have a huge mess on your hands when they start coming in frequently. Generalize the criteria for the orders and keep everything in one database, and it should be tidy. Greg Worthey Worthey Solutions www.worthey.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 16 05:02:45 2007 From: jwcolby at colbyconsulting.com (JWColby) Date: Fri, 16 Feb 2007 06:02:45 -0500 Subject: [dba-SQLServer] John Colby's problem In-Reply-To: <239084.30978.qm@web88207.mail.re2.yahoo.com> Message-ID: <000401c751b9$fd743700$6c7aa8c0@m6805> LOL. I don't blame anything on you Arthur. In fact I believe you are right, and I have told you that. What you haven't provided is the "how". Doing what you propose requires an entire system to perform the denormalization. In fact in order to get to where I need to be I have to have a "tblSurvey" to hold the names of the survey lists as they come in. My client does not refer to a specific field, he says "the smoker list". The survey list has to be parent to a "tblSurveyField" which holds all of the field names of the various lists, with a FK back to the survey table. Then the survey field DATA has to be held in a table child to tblSurveyField with a fk back to tblSurveyField and tblPeople. So there is this entire process, that has to be done automagically, which disassembles the surveys, adds the survey names to tblSurvey, survey fields to tblSurveyField, people to tblPeople, and data to tblSurveyData. You know (because you have seen it) that the very first table has 700 fields. This is not a job for "manual labor". I would spend a month just normalizing that one table. You are long on "this is what you need to do" and entirely absent on "this is the how of doing it". Your "this is what you need to do" is not news to me or anyone else. Of course that is what is needed, I have never denied that and you know it. OTOH, I am actually fill orders the way I am doing it now. What we both know NEEDS to be done is "someday when the system is working". My client needs (and I am giving him) answers now. >assuming that everything is stored and indexed correctly And there ya go - "assuming that everything is stored and indexed correctly" is your entire answer to "this is how to do 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 artful at rogers.com Sent: Thursday, February 15, 2007 10:21 PM To: dba-sqlserver at databaseadvisors.com Subject: Re: [dba-SQLServer] John Colby's problem Blame it all on me, JC. I told you how to do it and you resist. That's ok. I have been resisted before LOL. But I'm right. You normalize the columns and admittedly you end up with 600M rows but they are indexable and your speed goes up 1000 times. Your queries reduce to something like "Smoker = Y and Cailis = Y and Divorced = Soon". Add to that the fact that the retrieved rows all automatically point to the people in question. I don't see the point of your objection. This seems to me entirely straightforward, and 600M rows is child's play, assuming that everything is stored and indexed correctly. I can do 600M rows in an indexed search in less than a second. I've got the data to prove it. Arthur Fuller Technical Writer, Data Modeler, SQL Sensei Artful Databases Organization www.artfulsoftware.com ----- Original Message ---- From: JWColby To: dba-sqlserver at databaseadvisors.com Sent: Thursday, February 15, 2007 3:04:55 PM Subject: Re: [dba-SQLServer] John Colby's problem OK, a little background. The client sells lists of names to bulk mailers (paper bulk mail). The client gets list (what I call surveys, because that is a more accurate description), which contain name / address information and then (usually) survey information such as "what brand of cigarette do you smoke, or what types of computers do you use etc. These surveys can be about ANYTHING that my client finds useful to purchase the lists for. My job is to somehow make sense of these. I take the lists and pull them into SQL Server. I then immediately send the lists out for address validation processing. "Sending out" really means that I process the names and send them through a address processing system running on my system, which can reach out over the internet to get certain parts of the processing done (NCOA specifically). At the end of the day, I then have a list of names which have been validated. Some of the names / addresses fail validation and I purge them. All the names which pass validation I keep. Passing means that the ADDRESS is actually deliverable, and MAYBE the person actually lives at that address. They PROBABLY lived at that address at some time in the past (when was the survey taken?). I then have to build a master table of addresses, people, and people who live at addresses. I also have to tie the SURVEY (remember the survey questions) back in to the names / addresses. Let's take an example. My client buys a list of 80 million names / addresses from a mortgage bank. It has names / addresses / income information / property information (info about the property purchased). I import into SQL Server, export back out for address validation. In THIS case, likely an EXTREMELY high percentage of the names / addresses are valid since a mortgage company used the info to process mortgage applications. Anyway, as you can see, I now have two distinct "sets" of data, the person / address / PersonAddress set, and the information about the property and of course also about the person's income etc. Now, my job is to tie all this back in to a master database of names and addresses. For example, if a person purchased a property, they now live there, I know their income, I know the property price, I know the number of rooms, bathrooms, has a pool etc. That ADDRESS info has to be "matched" against addresses already in my database from other lists that I have processed in the past. The PERSON information also needs to be tied in to information I have about PEOPLE that I obtained from other lists. I might get an NCOA that shows that person MOVING TO the new house they just purchased ALREADY IN MY TABLES from some other list. Furthermore I have to create a brand new table (and yes, Arthur has other ideas as yet unimplemented) that contains the PROPERTY information and links that to a table of deliverable addresses I have built up. So I end up with a system of tables - people / address / survey1 / survey2 / survey3 / survey4. Survey1/2/3/4... All end up with pointers to a specific PERSON since that information is about their personal preferences (brands of soap, soft drinks, computers etc.) NOW... (are you still with me?) I get a request from my client (who got a request from HIS client) for a COUNT all the people in age bracket XXX, income bracket YYY, zip codes AAA, that own a pool and drive a Mercedes or a BMW. I create a system of views / queries to pull all of the pieces together, and count those people. I then get another order from my client (for a different client of theirs) for a count of all the people in zip code BBB who use detergent X, they really don't care about the age or income. Next count order, next count order, modify count order 1, modify count order 2, new count order, etc. I end up with a single list of addresses, a single list of people, a m-m table of what addresses people lived at when, and 47 different SURVEY tables, until tomorrow of course when my client buys surveys number 49, 50 and 51 and I start the process of integrating that data into the system. Arthur in the meantime espouses a system where each answer in each survey table is merged into one big SurveyAnswer table with FKs back to people / survey fields. Which is almost assuredly the correct answer however that method requires a huge programming effort (and immense crunching on my computer) to get the data normalized in this manner, and then to allow extraction of the data in order to do the counts. And if I use this metaphor, what happens when I get another list from another mortgage company where the same basic information (property size, number of rooms, has a pool) is purchased? I do NOT want this stored as two different "surveys" but rather merged into one. Well anyway, there ya go. I need organization. I need organization on the front end when I turn these lists into data, and I need organization on the back end when I process orders for counts against the data, and someday when I process orders for name/address lists to be sold. Some day soon (assuming you live in the USA) I will know EVERYTHING about YOU! Bwaaahaaaaahaaa. Kinda scary really. Enough to make you think twice about taking surveys. 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 Greg Worthey Sent: Thursday, February 15, 2007 2:27 PM To: dba-sqlserver at databaseadvisors.com Subject: [dba-SQLServer] John Colby's problem John, If I understand you correctly, here's what you need to do: Figure out a set of criteria that describe a "count order", then put each order as a record in a table. You say all the orders are different, but after you get enough of them, they all should fit some set of criteria. Then, when there is some demand against that order (give summary of counts, or give all names, etc), you have a SQL query builder that uses the criteria from the order to query the data on demand. It sounds like you're replicating data where all you need to do is query it. If you create a database for each order, you'll have a huge mess on your hands when they start coming in frequently. Generalize the criteria for the orders and keep everything in one database, and it should be tidy. Greg Worthey Worthey Solutions www.worthey.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 greg at worthey.com Fri Feb 16 06:12:01 2007 From: greg at worthey.com (Greg Worthey) Date: Fri, 16 Feb 2007 04:12:01 -0800 Subject: [dba-SQLServer] dba-SQLServer Digest, Vol 48, Issue 12 In-Reply-To: Message-ID: <002501c751c3$adcc7a00$1601a8c0@fb2a618> Ok, all this echoing of the same post over and over is annoying! John, It sounds like you're helping the scum of the earth--spammers (snailspammers are spammers too). But I'll help you anyway and hope you find better work. You just need to generalize your surveys: SurveyDef: SurveyDefID int Question varchar(50) QuestionType varchar(10) (multiple choice, fill-in, choose one, etc) SurveyAnswers: SurveyDefID int SpamTargetID int Answer2 varchar(10) And then for the "count order", you just have rows in another table specifying the data needed to build the query. You only need a few tables in total. Greg Worthey Worthey Solutions www.worthey.com From artful at rogers.com Fri Feb 16 07:14:35 2007 From: artful at rogers.com (artful at rogers.com) Date: Fri, 16 Feb 2007 05:14:35 -0800 (PST) Subject: [dba-SQLServer] John Colby's problem Message-ID: <20070216131435.53921.qmail@web88205.mail.re2.yahoo.com> That's why they pay me the big bucks LOL. Somewhat more seriously, it's not that difficult to write the code to normalize your giant table, but as I recall quite a few columns were ambiguous in their contents. That part of the problem remains troublesome. And I also detect the need for a bridge table between Surveys and Question/Answers, such that Surveys One and Two might both contain the list of Questions applying to Smokers. A. ----- Original Message ---- From: JWColby To: dba-sqlserver at databaseadvisors.com Sent: Friday, February 16, 2007 6:02:45 AM Subject: Re: [dba-SQLServer] John Colby's problem LOL. I don't blame anything on you Arthur. In fact I believe you are right, and I have told you that. What you haven't provided is the "how". Doing what you propose requires an entire system to perform the denormalization. In fact in order to get to where I need to be I have to have a "tblSurvey" to hold the names of the survey lists as they come in. My client does not refer to a specific field, he says "the smoker list". The survey list has to be parent to a "tblSurveyField" which holds all of the field names of the various lists, with a FK back to the survey table. Then the survey field DATA has to be held in a table child to tblSurveyField with a fk back to tblSurveyField and tblPeople. So there is this entire process, that has to be done automagically, which disassembles the surveys, adds the survey names to tblSurvey, survey fields to tblSurveyField, people to tblPeople, and data to tblSurveyData. You know (because you have seen it) that the very first table has 700 fields. This is not a job for "manual labor". I would spend a month just normalizing that one table. You are long on "this is what you need to do" and entirely absent on "this is the how of doing it". Your "this is what you need to do" is not news to me or anyone else. Of course that is what is needed, I have never denied that and you know it. OTOH, I am actually fill orders the way I am doing it now. What we both know NEEDS to be done is "someday when the system is working". My client needs (and I am giving him) answers now. >assuming that everything is stored and indexed correctly And there ya go - "assuming that everything is stored and indexed correctly" is your entire answer to "this is how to do it". John W. Colby Colby Consulting www.ColbyConsulting.com From jwcolby at colbyconsulting.com Fri Feb 16 08:19:40 2007 From: jwcolby at colbyconsulting.com (JWColby) Date: Fri, 16 Feb 2007 09:19:40 -0500 Subject: [dba-SQLServer] dba-SQLServer Digest, Vol 48, Issue 12 In-Reply-To: <002501c751c3$adcc7a00$1601a8c0@fb2a618> Message-ID: <001201c751d5$7f95b4f0$6c7aa8c0@m6805> >It sounds like you're helping the scum of the earth--spammers (snailspammers are spammers too). But I'll help you anyway and hope you find better work. LOL. Everyone has a perspective. My perspective is that there are multi-billion dollar companies that specialize in selling mailing lists. I don't control it, my turning down this job would be spitting in the wind to the industry but a ton of money lost to me. The thing to understand is that my client BUYS these lists. They do not commission the surveys. I have no control whatsoever over the survey, content, method, field names, data type, multiple choice. No control. Not even over whether my client buys the list. No control. My client buys a list and sends it to me. It contains name / address / and a bunch of fields, ALWAYS text when it gets to me, which may represent any data type known to man. It is almost always a fixed width file with trailing spaces. Once in a blue moon, it is comma delimited with field headers. Usually it has another file which contains what the field names are, often what the answers can be, never what the data type is. What I need is not rocket science. I could do it in one day's programming if it were in Access with VBA and DAO available as tools. Unfortunately, due to the size of the lists (millions of records, often tens of millions) doing it in Access is a non-starter. And I am a nubee at SQL Server. And I apologize if I annoy you, but I thought this list was for learning. It does appear though that nobody here knows how to approach this problem so I will drop it. Thanks for your time and understanding. 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 Greg Worthey Sent: Friday, February 16, 2007 7:12 AM To: dba-sqlserver at databaseadvisors.com Subject: Re: [dba-SQLServer] dba-SQLServer Digest, Vol 48, Issue 12 Ok, all this echoing of the same post over and over is annoying! John, It sounds like you're helping the scum of the earth--spammers (snailspammers are spammers too). But I'll help you anyway and hope you find better work. You just need to generalize your surveys: SurveyDef: SurveyDefID int Question varchar(50) QuestionType varchar(10) (multiple choice, fill-in, choose one, etc) SurveyAnswers: SurveyDefID int SpamTargetID int Answer2 varchar(10) And then for the "count order", you just have rows in another table specifying the data needed to build the query. You only need a few tables in total. Greg Worthey Worthey Solutions www.worthey.com _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From artful at rogers.com Fri Feb 16 09:11:09 2007 From: artful at rogers.com (artful at rogers.com) Date: Fri, 16 Feb 2007 07:11:09 -0800 (PST) Subject: [dba-SQLServer] dba-SQLServer Digest, Vol 48, Issue 12 Message-ID: <20070216151109.25770.qmail@web88204.mail.re2.yahoo.com> Since the lists are acquired and thus their column-names are out of your control, then you really have no choice but to create a one-off DTS or SSIS package for each new input. There is no alternative that I can see. OTOH, once you get a handle on how to create such packages, it's quite easy. But as you say, you are currently delivering the goods to the client, so what else matters. We can discuss the inelegance of the solution until the cows come home, but you are currently buttering your bread with a solution that works, so all the rest is just another quantum-computer story. If it works, stick with it! A. ----- Original Message ---- From: JWColby To: dba-sqlserver at databaseadvisors.com Sent: Friday, February 16, 2007 9:19:40 AM Subject: Re: [dba-SQLServer] dba-SQLServer Digest, Vol 48, Issue 12 >It sounds like you're helping the scum of the earth--spammers (snailspammers are spammers too). But I'll help you anyway and hope you find better work. LOL. Everyone has a perspective. My perspective is that there are multi-billion dollar companies that specialize in selling mailing lists. I don't control it, my turning down this job would be spitting in the wind to the industry but a ton of money lost to me. The thing to understand is that my client BUYS these lists. They do not commission the surveys. I have no control whatsoever over the survey, content, method, field names, data type, multiple choice. No control. Not even over whether my client buys the list. No control. My client buys a list and sends it to me. It contains name / address / and a bunch of fields, ALWAYS text when it gets to me, which may represent any data type known to man. It is almost always a fixed width file with trailing spaces. Once in a blue moon, it is comma delimited with field headers. Usually it has another file which contains what the field names are, often what the answers can be, never what the data type is. What I need is not rocket science. I could do it in one day's programming if it were in Access with VBA and DAO available as tools. Unfortunately, due to the size of the lists (millions of records, often tens of millions) doing it in Access is a non-starter. And I am a nubee at SQL Server. And I apologize if I annoy you, but I thought this list was for learning. It does appear though that nobody here knows how to approach this problem so I will drop it. Thanks for your time and understanding. 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 Greg Worthey Sent: Friday, February 16, 2007 7:12 AM To: dba-sqlserver at databaseadvisors.com Subject: Re: [dba-SQLServer] dba-SQLServer Digest, Vol 48, Issue 12 Ok, all this echoing of the same post over and over is annoying! John, It sounds like you're helping the scum of the earth--spammers (snailspammers are spammers too). But I'll help you anyway and hope you find better work. You just need to generalize your surveys: SurveyDef: SurveyDefID int Question varchar(50) QuestionType varchar(10) (multiple choice, fill-in, choose one, etc) SurveyAnswers: SurveyDefID int SpamTargetID int Answer2 varchar(10) And then for the "count order", you just have rows in another table specifying the data needed to build the query. You only need a few tables in total. Greg Worthey Worthey Solutions www.worthey.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 ebarro at verizon.net Fri Feb 16 09:31:41 2007 From: ebarro at verizon.net (Eric Barro) Date: Fri, 16 Feb 2007 07:31:41 -0800 Subject: [dba-SQLServer] dba-SQLServer Digest, Vol 48, Issue 12 In-Reply-To: <001201c751d5$7f95b4f0$6c7aa8c0@m6805> Message-ID: <0JDK00AAOB4WP1S8@vms044.mailsrvcs.net> John, If you already have VBA code that utilizes DAO to pull in comma-delimited or fixed width records you just need to revise it and use ADO and then when you create your DTS process you can run the VB script on those records. This method allows you to maintain your base code in VB and drop it into a DTS package. Eric -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of JWColby Sent: Friday, February 16, 2007 6:20 AM To: dba-sqlserver at databaseadvisors.com Subject: Re: [dba-SQLServer] dba-SQLServer Digest, Vol 48, Issue 12 >It sounds like you're helping the scum of the earth--spammers (snailspammers are spammers too). But I'll help you anyway and hope you find better work. LOL. Everyone has a perspective. My perspective is that there are multi-billion dollar companies that specialize in selling mailing lists. I don't control it, my turning down this job would be spitting in the wind to the industry but a ton of money lost to me. The thing to understand is that my client BUYS these lists. They do not commission the surveys. I have no control whatsoever over the survey, content, method, field names, data type, multiple choice. No control. Not even over whether my client buys the list. No control. My client buys a list and sends it to me. It contains name / address / and a bunch of fields, ALWAYS text when it gets to me, which may represent any data type known to man. It is almost always a fixed width file with trailing spaces. Once in a blue moon, it is comma delimited with field headers. Usually it has another file which contains what the field names are, often what the answers can be, never what the data type is. What I need is not rocket science. I could do it in one day's programming if it were in Access with VBA and DAO available as tools. Unfortunately, due to the size of the lists (millions of records, often tens of millions) doing it in Access is a non-starter. And I am a nubee at SQL Server. And I apologize if I annoy you, but I thought this list was for learning. It does appear though that nobody here knows how to approach this problem so I will drop it. Thanks for your time and understanding. 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 Greg Worthey Sent: Friday, February 16, 2007 7:12 AM To: dba-sqlserver at databaseadvisors.com Subject: Re: [dba-SQLServer] dba-SQLServer Digest, Vol 48, Issue 12 Ok, all this echoing of the same post over and over is annoying! John, It sounds like you're helping the scum of the earth--spammers (snailspammers are spammers too). But I'll help you anyway and hope you find better work. You just need to generalize your surveys: SurveyDef: SurveyDefID int Question varchar(50) QuestionType varchar(10) (multiple choice, fill-in, choose one, etc) SurveyAnswers: SurveyDefID int SpamTargetID int Answer2 varchar(10) And then for the "count order", you just have rows in another table specifying the data needed to build the query. You only need a few tables in total. Greg Worthey Worthey Solutions www.worthey.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 -- No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.1.411 / Virus Database: 268.17.39/687 - Release Date: 2/14/2007 From Elizabeth.J.Doering at wellsfargo.com Fri Feb 16 11:05:27 2007 From: Elizabeth.J.Doering at wellsfargo.com (Elizabeth.J.Doering at wellsfargo.com) Date: Fri, 16 Feb 2007 11:05:27 -0600 Subject: [dba-SQLServer] Indexing References: <0JDK00AAOB4WP1S8@vms044.mailsrvcs.net> Message-ID: <1C2084FD2472124AB1812A5476EA3B7A0104E5F8@msgswbmnmsp04.wellsfargo.com> Dear List, Is there a short treatise on indexing that any of you experts would recommend? Thanks, Liz Liz Doering 612.667.2447 "This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose, or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation" From fhtapia at gmail.com Fri Feb 16 11:25:36 2007 From: fhtapia at gmail.com (Francisco Tapia) Date: Fri, 16 Feb 2007 09:25:36 -0800 Subject: [dba-SQLServer] Indexing In-Reply-To: <1C2084FD2472124AB1812A5476EA3B7A0104E5F8@msgswbmnmsp04.wellsfargo.com> References: <0JDK00AAOB4WP1S8@vms044.mailsrvcs.net> <1C2084FD2472124AB1812A5476EA3B7A0104E5F8@msgswbmnmsp04.wellsfargo.com> Message-ID: This article is a simple description on indexes http://databases.about.com/od/sqlserver/a/indextuning.htm For performance, and defragmentation of indexes, you can check this article that is very very good. http://www.sql-server-performance.com/rd_index_fragmentation.asp Hope this helps, -- Francisco On 2/16/07, Elizabeth.J.Doering at wellsfargo.com wrote: > > Dear List, > > Is there a short treatise on indexing that any of you experts would > recommend? > > > Thanks, > > Liz > > > > > > > Liz Doering > 612.667.2447 > > "This message may contain confidential and/or privileged information. If > you are not the addressee or authorized to receive this for the > addressee, you must not use, copy, disclose, or take any action based on > this message or any information herein. If you have received this > message in error, please advise the sender immediately by reply e-mail > and delete this message. Thank you for your cooperation" > > > _______________________________________________ > 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 artful at rogers.com Fri Feb 16 11:56:59 2007 From: artful at rogers.com (artful at rogers.com) Date: Fri, 16 Feb 2007 09:56:59 -0800 (PST) Subject: [dba-SQLServer] Indexing Message-ID: <20070216175659.99708.qmail@web88204.mail.re2.yahoo.com> Doubtless there is. In the meantime, here are a few guidelines: An index is almost identical to a table. It contains a minimum of two columns, one containing the Primary Key (PK) of every row, and the other(s) containing the keys expressed in your index expression. Every Foreign Key (FK) should be indexed. Every PK will be indexed automatically. Your choice is whether to cluster the keys or not. Data-modeling tools such as ERwin and PowerDesigner and DeZign often err in their creation of indexes, because they are unable to perceive the value of "covering" indexes. A covering index is an index on multiple columns, and is most useful when you always retrieve data in a certain pattern. For example, suppose two tables, Orders and OrderDetails. You would typically not interrogate this table by OrderDetailID. You would interrogate it by OrderID + OrderDetailID, most frequently, and occasionally by ProductID. But even in the last case, why would you do this except to discover who purchased a fan belt for a Bronco within the past two years? In that case, create a covering index consisting of ProductID + OrderID, which index could semi-immediately point you to Orders.CustomerID, thus identifying very quickly those customers who purchased Product 12345. Arthur Fuller Technical Writer, Data Modeler, SQL Sensei Artful Databases Organization www.artfulsoftware.com ----- Original Message ---- From: "Elizabeth.J.Doering at wellsfargo.com" To: dba-sqlserver at databaseadvisors.com Sent: Friday, February 16, 2007 12:05:27 PM Subject: [dba-SQLServer] Indexing Dear List, Is there a short treatise on indexing that any of you experts would recommend? Thanks, Liz Liz Doering 612.667.2447 "This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose, or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation" _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From martyconnelly at shaw.ca Fri Feb 16 13:35:52 2007 From: martyconnelly at shaw.ca (MartyConnelly) Date: Fri, 16 Feb 2007 11:35:52 -0800 Subject: [dba-SQLServer] John Colby's problem In-Reply-To: <20070216131435.53921.qmail@web88205.mail.re2.yahoo.com> References: <20070216131435.53921.qmail@web88205.mail.re2.yahoo.com> Message-ID: <45D60798.8020805@shaw.ca> How about doing something like this utility to parse fixed length flat files in C# using XML templates http://builder.com.com/5100-6370_14-6156780.html?tag=nl.e601 artful at rogers.com wrote: >That's why they pay me the big bucks LOL. > >Somewhat more seriously, it's not that difficult to write the code to normalize your giant table, but as I recall quite a few columns were ambiguous in their contents. That part of the problem remains troublesome. And I also detect the need for a bridge table between Surveys and Question/Answers, such that Surveys One and Two might both contain the list of Questions applying to Smokers. > >A. > > >----- Original Message ---- >From: JWColby >To: dba-sqlserver at databaseadvisors.com >Sent: Friday, February 16, 2007 6:02:45 AM >Subject: Re: [dba-SQLServer] John Colby's problem > > >LOL. I don't blame anything on you Arthur. In fact I believe you are right, >and I have told you that. What you haven't provided is the "how". Doing >what you propose requires an entire system to perform the denormalization. >In fact in order to get to where I need to be I have to have a "tblSurvey" >to hold the names of the survey lists as they come in. My client does not >refer to a specific field, he says "the smoker list". The survey list has >to be parent to a "tblSurveyField" which holds all of the field names of the >various lists, with a FK back to the survey table. Then the survey field >DATA has to be held in a table child to tblSurveyField with a fk back to >tblSurveyField and tblPeople. > >So there is this entire process, that has to be done automagically, which >disassembles the surveys, adds the survey names to tblSurvey, survey fields >to tblSurveyField, people to tblPeople, and data to tblSurveyData. You know >(because you have seen it) that the very first table has 700 fields. This >is not a job for "manual labor". I would spend a month just normalizing >that one table. > >You are long on "this is what you need to do" and entirely absent on "this >is the how of doing it". Your "this is what you need to do" is not news to >me or anyone else. Of course that is what is needed, I have never denied >that and you know it. OTOH, I am actually fill orders the way I am doing it >now. What we both know NEEDS to be done is "someday when the system is >working". My client needs (and I am giving him) answers now. > > > >>assuming that everything is stored and indexed correctly >> >> > >And there ya go - "assuming that everything is stored and indexed correctly" >is your entire answer to "this is how to do it". > >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 > > > > > -- Marty Connelly Victoria, B.C. Canada From jwcolby at colbyconsulting.com Sat Feb 17 13:45:42 2007 From: jwcolby at colbyconsulting.com (JWColby) Date: Sat, 17 Feb 2007 14:45:42 -0500 Subject: [dba-SQLServer] John Colby's problem In-Reply-To: <45D60798.8020805@shaw.ca> Message-ID: <000001c752cc$35df6f70$6c7aa8c0@m6805> I just discovered SQL_Variant data type. I haven't tried using it yet, but it does seem to solve the "can be any data type" issue for my data store issue. The tables now look like: tblPeople PE_ID PE_Fname . . tblSurvey SV_ID 'Survey ID SV_Name 'Survey Name tblSurveyField SVFLD_ID 'Survey Field ID SVFLD_IDSV 'Survey ID SVFLD_Name 'Survey Name SVFLD_DataType 'Survey Data Type tblSurveyData SVDAT_ID 'Survey Data ID SVDAT_IDSVFLD 'Survey Field ID SVDAT_IDPE 'Person ID SVDAT_Data Type SQL_Variant Thus the process that normalizes the data "discovers" the data type at the field level and stores the data type in the field table. The data is stored in the data field, apparently converted to the correct type (from the text that I receive in a survey flat file). On the way back out, the SVFLD_DataType is used to cast the data back to the correct type for compares etc. Thoughts on the matter? John W. Colby Colby Consulting www.ColbyConsulting.com From artful at rogers.com Sat Feb 17 15:42:56 2007 From: artful at rogers.com (artful at rogers.com) Date: Sat, 17 Feb 2007 13:42:56 -0800 (PST) Subject: [dba-SQLServer] John Colby's problem Message-ID: <414158.79176.qm@web88208.mail.re2.yahoo.com> I think that I mentioned this some time ago, JC. In the context of normalizing those hundreds of columns. But it's all right. A. ----- Original Message ---- From: JWColby To: dba-sqlserver at databaseadvisors.com Sent: Saturday, February 17, 2007 2:45:42 PM Subject: Re: [dba-SQLServer] John Colby's problem I just discovered SQL_Variant data type. I haven't tried using it yet, but it does seem to solve the "can be any data type" issue for my data store issue. The tables now look like: tblPeople PE_ID PE_Fname From dbasqlserver at vftt.co.uk Tue Feb 20 23:12:04 2007 From: dbasqlserver at vftt.co.uk (Pete Phillipps) Date: Wed, 21 Feb 2007 05:12:04 -0000 Subject: [dba-SQLServer] MS TechNet sub Message-ID: <039401c75576$d838ee20$0201a8c0@HOLTS> Hello Everyone, I'm a UK-based MCP, and I'm looking at taking out a MS TechNet Plus Direct subscription. Before I spend my money I was just wanting to see what others here who have a TechNet sub think about it. Pete "Many [wargame] battles have been fought and won by soldiers nourished on beer" - Frederick the Great, 1777 Download VIEW FROM THE TRENCHES (Britain's Premier ASL Journal) free from http://www.vftt.co.uk Get the latest news about HEROES(ASL in Blackpool) at http://www.vftt.co.uk/heroesdetails.asp Get the latest news about INTENSIVE FIRE (Britain's biggest ASL tournament) at http://www.vftt.co.uk/ifdetails.asp Get the latest UK ASL Tournament news at http://www.asltourneys.co.uk Support the best at http://www.manutd.com/ -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.5.441 / Virus Database: 268.18.3/694 - Release Date: 20/02/2007 13:44 From paul.hartland at fsmail.net Thu Feb 22 06:06:40 2007 From: paul.hartland at fsmail.net (paul.hartland at fsmail.net) Date: Thu, 22 Feb 2007 13:06:40 +0100 (CET) Subject: [dba-SQLServer] Advancing in SQL Server Message-ID: <12660593.1538681172146000895.JavaMail.www@wwinf3004.me-wanadoo.net> To all, I know how to write basic stored procedures etc, but I want to know if the following is possible. I have the code below in Visual Basic: Dim rsOnJob As ADODB.Recordset Dim rsNew As ADODB.Recordset Dim rsDupe As ADODB.Recordset Set rsOnJob = New ADODB.Recordset rsOnJob.CursorLocation = adUseClient rsOnJob.Open ("SELECT PayrollNo FROM tblAvailabilityAll WHERE JobNo = '" & PublicJobNumber & "'"), DESQLGenesis.SQLConn, adOpenDynamic, adLockReadOnly If (rsOnJob.RecordCount > 0) Then With rsOnJob .MoveFirst Do Until (.EOF) Set rsNew = DESQLGenesis.SQLConn.Execute("genesis_select_NewStarterNotification '" & .Fields("PayrollNo") & "'") If (rsNew.RecordCount > 0) Then Set rsDupe = DESQLGenesis.SQLConn.Execute("genesis_select_DupeInNewStarter '" & rsNew.Fields("PayrollNo") & "'") If (rsDupe.RecordCount < 1) Then DESQLGenesis.SQLConn.Execute ("genesis_insert_NewStarters '" & rsNew.Fields("PayrollNo") & "', '" & rsNew.Fields("Fullname") & "', '" & Format(rsNew.Fields("StartDate"), "MM/DD/YY") & "', '" & rsNew.Fields("JN") & "', '" & Format(rsNew.Fields("JD"), "MM/DD/YY") & "'") End If rsDupe.Close Set rsDupe = Nothing End If rsNew.Close Set rsNew = Nothing .MoveNext Loop End With End If rsOnJob.Close Set rsOnJob = Nothing Does anyone know if it is possible to put this into either a stored procedure or a user defined function enabling me to just make a call to the one stored procedure of function ? Thanks in advance for any help on this. Paul Hartland paul.hartland at fsmail.net 07730 523179 From DavidL at sierranevada.com Thu Feb 22 12:32:51 2007 From: DavidL at sierranevada.com (David Lewis) Date: Thu, 22 Feb 2007 10:32:51 -0800 Subject: [dba-SQLServer] Advancing in SQL Server In-Reply-To: References: Message-ID: <00101736F13D774F88C54058CB2663C80111BC35@celebration.sierranevada.corp> Paul: Yes, it looks to me like you need a cursor. You can run the sql statements within the cursors, or you can call sp's. Below is some quickie sample code: DECLARE CurB CURSOR FOR SELECT DISTINCT m.fldDate, m.Brand, m.Type FROM tblRptLiaDaily M WHERE m.packageid is null DECLARE @BlDate datetime DECLARE @BlBrand char(3) DECLARE @BlType char(1) OPEN CurB FETCH NEXT FROM CurB INTO @BlDate, @BlBrand, @BlType WHILE @@FETCH_STATUS=0 BEGIN EXEC usp_xyz @BlDate=@BlDate, @BlBrand=@BlBrand, at BlType=@BlType --OR do any number of other things. FETCH NEXT FROM CurB INTO @BlDate, @BlBrand, @BlType END CLOSE CurB DEALLOCATE CurB ---------------------------------------------------------------------- Message: 1 Date: Thu, 22 Feb 2007 13:06:40 +0100 (CET) From: paul.hartland at fsmail.net Subject: [dba-SQLServer] Advancing in SQL Server To: accessd , SQL Group Message-ID: <12660593.1538681172146000895.JavaMail.www at wwinf3004.me-wanadoo.net> Content-Type: text/plain; charset=UTF-8 To all, I know how to write basic stored procedures etc, but I want to know if the following is possible. I have the code below in Visual Basic: Dim rsOnJob As ADODB.Recordset Dim rsNew As ADODB.Recordset Dim rsDupe As ADODB.Recordset Set rsOnJob = New ADODB.Recordset rsOnJob.CursorLocation = adUseClient rsOnJob.Open ("SELECT PayrollNo FROM tblAvailabilityAll WHERE JobNo = '" & PublicJobNumber & "'"), DESQLGenesis.SQLConn, adOpenDynamic, adLockReadOnly If (rsOnJob.RecordCount > 0) Then With rsOnJob .MoveFirst Do Until (.EOF) Set rsNew = DESQLGenesis.SQLConn.Execute("genesis_select_NewStarterNotification '" & .Fields("PayrollNo") & "'") If (rsNew.RecordCount > 0) Then Set rsDupe = DESQLGenesis.SQLConn.Execute("genesis_select_DupeInNewStarter '" & rsNew.Fields("PayrollNo") & "'") If (rsDupe.RecordCount < 1) Then DESQLGenesis.SQLConn.Execute ("genesis_insert_NewStarters '" & rsNew.Fields("PayrollNo") & "', '" & rsNew.Fields("Fullname") & "', '" & Format(rsNew.Fields("StartDate"), "MM/DD/YY") & "', '" & rsNew.Fields("JN") & "', '" & Format(rsNew.Fields("JD"), "MM/DD/YY") & "'") End If rsDupe.Close Set rsDupe = Nothing End If rsNew.Close Set rsNew = Nothing .MoveNext Loop End With End If rsOnJob.Close Set rsOnJob = Nothing Does anyone know if it is possible to put this into either a stored procedure or a user defined function enabling me to just make a call to the one stored procedure of function ? Thanks in advance for any help on this. Paul Hartland paul.hartland at fsmail.net 07730 523179 ------------------------------ _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver End of dba-SQLServer Digest, Vol 48, Issue 18 ********************************************* From ebarro at verizon.net Thu Feb 22 12:51:55 2007 From: ebarro at verizon.net (Eric Barro) Date: Thu, 22 Feb 2007 10:51:55 -0800 Subject: [dba-SQLServer] Advancing in SQL Server In-Reply-To: <00101736F13D774F88C54058CB2663C80111BC35@celebration.sierranevada.corp> Message-ID: <0JDV00G46OETIDK6@vms042.mailsrvcs.net> Cursors are really slow and you should generally avoid them. If for some reason you need to use cursors they need to be FAST FORWARD cursors. I use a variation of this code fragment to get around cursors. You basicaly create a temp table (in the example below it's a table variable instead of a temp table) and insert the primary key of the table you want to process. You then determine how many records you processed and then you loop thru those records and run your main sql process inside of that loop. /*Prepare TABLE variable to take resultset it's important to declare an identity field since we will use this as part of our criteria later on */ DECLARE @tbl TABLE ( tbl_RowID INT IDENTITY(1, 1), tbl_ObjectID INT ) /*Local variables */ DECLARE @ObjectID INT, @count int, /*create local @@fetch_status*/ @iRow int /*row pointer (index)*/ /* create array simulator */ INSERT @tbl (tbl_ObjectID) /* get the recordset and stuff the values into the array */ SELECT ObjectID FROM MySQLTable /*get array Upper Bound (highest ID number)*/ SET @count = @@ROWCOUNT /*initialize index counter*/ SET @iRow = 1 /*establish loop structure*/ WHILE @iRow <= @count BEGIN /*get row values*/ SELECT @ObjectID = tbl_ObjectID FROM @tbl WHERE tbl_RowID = @iRow /* INSERT MAIN SQL CODE HERE */ /*uncomment line below for debugging*/ --PRINT 'Retreiving record #' + RTRIM(CAST(@iRow as char)) /*go to next row*/ SET @iRow = @iRow + 1 END -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of David Lewis Sent: Thursday, February 22, 2007 10:33 AM To: dba-sqlserver at databaseadvisors.com Subject: Re: [dba-SQLServer] Advancing in SQL Server Paul: Yes, it looks to me like you need a cursor. You can run the sql statements within the cursors, or you can call sp's. Below is some quickie sample code: DECLARE CurB CURSOR FOR SELECT DISTINCT m.fldDate, m.Brand, m.Type FROM tblRptLiaDaily M WHERE m.packageid is null DECLARE @BlDate datetime DECLARE @BlBrand char(3) DECLARE @BlType char(1) OPEN CurB FETCH NEXT FROM CurB INTO @BlDate, @BlBrand, @BlType WHILE @@FETCH_STATUS=0 BEGIN EXEC usp_xyz @BlDate=@BlDate, @BlBrand=@BlBrand, at BlType=@BlType --OR do any number of other things. FETCH NEXT FROM CurB INTO @BlDate, @BlBrand, @BlType END CLOSE CurB DEALLOCATE CurB ---------------------------------------------------------------------- Message: 1 Date: Thu, 22 Feb 2007 13:06:40 +0100 (CET) From: paul.hartland at fsmail.net Subject: [dba-SQLServer] Advancing in SQL Server To: accessd , SQL Group Message-ID: <12660593.1538681172146000895.JavaMail.www at wwinf3004.me-wanadoo.net> Content-Type: text/plain; charset=UTF-8 To all, I know how to write basic stored procedures etc, but I want to know if the following is possible. I have the code below in Visual Basic: Dim rsOnJob As ADODB.Recordset Dim rsNew As ADODB.Recordset Dim rsDupe As ADODB.Recordset Set rsOnJob = New ADODB.Recordset rsOnJob.CursorLocation = adUseClient rsOnJob.Open ("SELECT PayrollNo FROM tblAvailabilityAll WHERE JobNo = '" & PublicJobNumber & "'"), DESQLGenesis.SQLConn, adOpenDynamic, adLockReadOnly If (rsOnJob.RecordCount > 0) Then With rsOnJob .MoveFirst Do Until (.EOF) Set rsNew = DESQLGenesis.SQLConn.Execute("genesis_select_NewStarterNotification '" & .Fields("PayrollNo") & "'") If (rsNew.RecordCount > 0) Then Set rsDupe = DESQLGenesis.SQLConn.Execute("genesis_select_DupeInNewStarter '" & rsNew.Fields("PayrollNo") & "'") If (rsDupe.RecordCount < 1) Then DESQLGenesis.SQLConn.Execute ("genesis_insert_NewStarters '" & rsNew.Fields("PayrollNo") & "', '" & rsNew.Fields("Fullname") & "', '" & Format(rsNew.Fields("StartDate"), "MM/DD/YY") & "', '" & rsNew.Fields("JN") & "', '" & Format(rsNew.Fields("JD"), "MM/DD/YY") & "'") End If rsDupe.Close Set rsDupe = Nothing End If rsNew.Close Set rsNew = Nothing .MoveNext Loop End With End If rsOnJob.Close Set rsOnJob = Nothing Does anyone know if it is possible to put this into either a stored procedure or a user defined function enabling me to just make a call to the one stored procedure of function ? Thanks in advance for any help on this. Paul Hartland paul.hartland at fsmail.net 07730 523179 ------------------------------ _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver End of dba-SQLServer Digest, Vol 48, Issue 18 ********************************************* _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com -- No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.5.441 / Virus Database: 268.18.3/697 - Release Date: 2/22/2007 11:55 AM From rl_stewart at highstream.net Thu Feb 22 15:44:41 2007 From: rl_stewart at highstream.net (Robert L. Stewart) Date: Thu, 22 Feb 2007 15:44:41 -0600 Subject: [dba-SQLServer] Advancing in SQL Server In-Reply-To: References: Message-ID: <200702222147.l1MLlCi12264@databaseadvisors.com> Paul, Yes, it is possible. You will need to look up CURSOR in the BOL. A cursor is the same as a recordset that you can scroll through forward. Robert At 12:00 PM 2/22/2007, you wrote: >Date: Thu, 22 Feb 2007 13:06:40 +0100 (CET) >From: paul.hartland at fsmail.net >Subject: [dba-SQLServer] Advancing in SQL Server >To: accessd , SQL Group > >Message-ID: > <12660593.1538681172146000895.JavaMail.www at wwinf3004.me-wanadoo.net> >Content-Type: text/plain; charset=UTF-8 > >To all, > >I know how to write basic stored procedures etc, but I want to know >if the following is possible. I have the code below in Visual Basic: >Dim rsOnJob As ADODB.Recordset > Dim rsNew As ADODB.Recordset > Dim rsDupe As ADODB.Recordset > > Set rsOnJob = New ADODB.Recordset > rsOnJob.CursorLocation = adUseClient > rsOnJob.Open ("SELECT PayrollNo FROM > tblAvailabilityAll WHERE JobNo = '" & PublicJobNumber & "'"), > DESQLGenesis.SQLConn, adOpenDynamic, adLockReadOnly > > If (rsOnJob.RecordCount > 0) Then > With rsOnJob > .MoveFirst > Do Until (.EOF) > Set rsNew = > DESQLGenesis.SQLConn.Execute("genesis_select_NewStarterNotification > '" & .Fields("PayrollNo") & "'") > If (rsNew.RecordCount > 0) Then > Set rsDupe = > DESQLGenesis.SQLConn.Execute("genesis_select_DupeInNewStarter '" & > rsNew.Fields("PayrollNo") & "'") > If (rsDupe.RecordCount < 1) Then > DESQLGenesis.SQLConn.Execute > ("genesis_insert_NewStarters '" & rsNew.Fields("PayrollNo") & "', > '" & rsNew.Fields("Fullname") & "', '" & > Format(rsNew.Fields("StartDate"), "MM/DD/YY") & "', '" & > rsNew.Fields("JN") & "', '" & Format(rsNew.Fields("JD"), "MM/DD/YY") & "'") > End If > rsDupe.Close > Set rsDupe = Nothing > End If > > rsNew.Close > Set rsNew = Nothing > > .MoveNext > Loop > End With > End If > > rsOnJob.Close > Set rsOnJob = Nothing > >Does anyone know if it is possible to put this into either a stored >procedure or a user defined function enabling me to just make a call >to the one stored procedure of function ? > >Thanks in advance for any help on this. > > > > > >Paul Hartland >paul.hartland at fsmail.net >07730 523179 From rl_stewart at highstream.net Thu Feb 22 15:50:15 2007 From: rl_stewart at highstream.net (Robert L. Stewart) Date: Thu, 22 Feb 2007 15:50:15 -0600 Subject: [dba-SQLServer] MS TechNet sub In-Reply-To: References: Message-ID: <200702222152.l1MLqBi16754@databaseadvisors.com> I have the highest level MSDN subscription. It is well worth the money. I am not sure about just a TechNet subscription. At 12:00 PM 2/21/2007, you wrote: >Date: Wed, 21 Feb 2007 05:12:04 -0000 >From: "Pete Phillipps" >Subject: [dba-SQLServer] MS TechNet sub >To: >Message-ID: <039401c75576$d838ee20$0201a8c0 at HOLTS> >Content-Type: text/plain; charset="windows-1250" > >Hello Everyone, > > I'm a UK-based MCP, and I'm looking at taking out a MS TechNet Plus >Direct subscription. Before I spend my money I was just wanting to see what >others here who have a TechNet sub think about it. > > >Pete