From newsgrps at dalyn.co.nz Sun Aug 2 16:32:42 2009 From: newsgrps at dalyn.co.nz (David Emerson) Date: Mon, 03 Aug 2009 09:32:42 +1200 Subject: [dba-SQLServer] Assign Select to local variable Message-ID: <20090802213122.OQXH10033.mta01.xtra.co.nz@Dalyn.dalyn.co.nz> I have a table full of field names. Having selected a field name I would like to put the value of the field into a local variable. Here is my code so far: SELECT @FieldName = FieldName FROM @tblFieldList WHERE ID = @FieldListID SET @qry = 'SELECT ' + @FieldName + ' FROM dbo.tblBWSClient WHERE BWSClientID = ' + CAST(@BaseLineRevisionID AS varchar(20)) EXEC @qry This gives me the value of the @FieldName field. How can I store this value in a variable called @OldValue? From bheid at sc.rr.com Sun Aug 2 16:42:51 2009 From: bheid at sc.rr.com (Bobby Heid) Date: Sun, 2 Aug 2009 17:42:51 -0400 Subject: [dba-SQLServer] Assign Select to local variable In-Reply-To: <20090802213122.OQXH10033.mta01.xtra.co.nz@Dalyn.dalyn.co.nz> References: <20090802213122.OQXH10033.mta01.xtra.co.nz@Dalyn.dalyn.co.nz> Message-ID: <000901ca13ba$2ffb17b0$8ff14710$@rr.com> David, If I understand your question correctly, after running the exec, all you have to do is: SET @OldValue = @FieldName Bobby -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of David Emerson Sent: Sunday, August 02, 2009 5:33 PM To: dba-SQLServer at databaseadvisors.com Subject: [dba-SQLServer] Assign Select to local variable I have a table full of field names. Having selected a field name I would like to put the value of the field into a local variable. Here is my code so far: SELECT @FieldName = FieldName FROM @tblFieldList WHERE ID = @FieldListID SET @qry = 'SELECT ' + @FieldName + ' FROM dbo.tblBWSClient WHERE BWSClientID = ' + CAST(@BaseLineRevisionID AS varchar(20)) EXEC @qry This gives me the value of the @FieldName field. How can I store this value in a variable called @OldValue? _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From newsgrps at dalyn.co.nz Sun Aug 2 17:02:14 2009 From: newsgrps at dalyn.co.nz (David Emerson) Date: Mon, 03 Aug 2009 10:02:14 +1200 Subject: [dba-SQLServer] Assign Select to local variable In-Reply-To: <000901ca13ba$2ffb17b0$8ff14710$@rr.com> References: <20090802213122.OQXH10033.mta01.xtra.co.nz@Dalyn.dalyn.co.nz> <000901ca13ba$2ffb17b0$8ff14710$@rr.com> Message-ID: <20090802220051.UYFR20271.mta02.xtra.co.nz@Dalyn.dalyn.co.nz> Not quite. When the @qry is run @FieldName has been replaced by the actual field. EG If FieldName = 'ClientAge' then @qry becomes 'SELECT ClientAge FROM dbo.tblBWSClient WHERE BWSClientID = 12345' Now what I need to do is get the value of ClientAge as returned by this query into @OldValue David At 3/08/2009, you wrote: >David, > >If I understand your question correctly, after running the exec, all you >have to do is: > >SET @OldValue = @FieldName > >Bobby > > >-----Original Message----- >From: dba-sqlserver-bounces at databaseadvisors.com >[mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of David >Emerson >Sent: Sunday, August 02, 2009 5:33 PM >To: dba-SQLServer at databaseadvisors.com >Subject: [dba-SQLServer] Assign Select to local variable > >I have a table full of field names. Having selected a field name I >would like to put the value of the field into a local variable. > >Here is my code so far: > >SELECT @FieldName = FieldName FROM @tblFieldList WHERE ID = @FieldListID > >SET @qry = 'SELECT ' + @FieldName + ' FROM dbo.tblBWSClient WHERE >BWSClientID = ' + CAST(@BaseLineRevisionID AS varchar(20)) >EXEC @qry > >This gives me the value of the @FieldName field. How can I store >this value in a variable called @OldValue? From newsgrps at dalyn.co.nz Sun Aug 2 18:36:21 2009 From: newsgrps at dalyn.co.nz (David Emerson) Date: Mon, 03 Aug 2009 11:36:21 +1200 Subject: [dba-SQLServer] Assign Select to local variable In-Reply-To: <20090802220051.UYFR20271.mta02.xtra.co.nz@Dalyn.dalyn.co.n z> References: <20090802213122.OQXH10033.mta01.xtra.co.nz@Dalyn.dalyn.co.nz> <000901ca13ba$2ffb17b0$8ff14710$@rr.com> <20090802220051.UYFR20271.mta02.xtra.co.nz@Dalyn.dalyn.co.nz> Message-ID: <20090802233501.WNWN7162.mta03.xtra.co.nz@Dalyn.dalyn.co.nz> Found the answer - it was using sp_executesql See http://www.sommarskog.se/dynamic_sql.html for interesting information. David. At 3/08/2009, you wrote: >Not quite. When the @qry is run @FieldName has been replaced by the >actual field. EG If FieldName = 'ClientAge' then @qry becomes > >'SELECT ClientAge FROM dbo.tblBWSClient WHERE BWSClientID = 12345' > >Now what I need to do is get the value of ClientAge as returned by >this query into @OldValue > >David > >At 3/08/2009, you wrote: > >David, > > > >If I understand your question correctly, after running the exec, all you > >have to do is: > > > >SET @OldValue = @FieldName > > > >Bobby > > > > > >-----Original Message----- > >From: dba-sqlserver-bounces at databaseadvisors.com > >[mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of David > >Emerson > >Sent: Sunday, August 02, 2009 5:33 PM > >To: dba-SQLServer at databaseadvisors.com > >Subject: [dba-SQLServer] Assign Select to local variable > > > >I have a table full of field names. Having selected a field name I > >would like to put the value of the field into a local variable. > > > >Here is my code so far: > > > >SELECT @FieldName = FieldName FROM @tblFieldList WHERE ID = @FieldListID > > > >SET @qry = 'SELECT ' + @FieldName + ' FROM dbo.tblBWSClient WHERE > >BWSClientID = ' + CAST(@BaseLineRevisionID AS varchar(20)) > >EXEC @qry > > > >This gives me the value of the @FieldName field. How can I store > >this value in a variable called @OldValue? From jwcolby at colbyconsulting.com Wed Aug 5 17:03:59 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 05 Aug 2009 18:03:59 -0400 Subject: [dba-SQLServer] Use a select in an update statement Message-ID: <4A7A01CF.9020407@colbyconsulting.com> I need to update a field based on the top N values in another field kind of thing. IOW Select top 10000 KeyCode From tblOrderData Where NoChildren = '2' OrderBy RandomNumber Now, I need to UPDATE Keycode to 'KeyA' I can save the Select statement to vSelKeyCode and then do an update on that as follows: UPDATE vSelKeyCode SET KeyCode = 'KeyA' I then need to do this many times, changing the TOP() value and NoOfChildren code. It seems logical that I could replace vSelKeyCode with the Select statement contained in vSelKeyCode but I get errors when I attempt this. Is it possible to do this? What I am trying to do in the end is create a stored procedure that allows me to pass in the TOP() value, NoOfChildren code and Key value and build dynamic code to perform this update. In the past I have just created N stored views with the correct TOP() value and NoOfChildren code hard coded, then performed an Update to each of those stored views. While that works it is a PITA and subject to all kinds of errors. There has to be a better way, and I don't know what it is. The dynamic SQL statement in a stored procedure is my answer, and lead me to the damned gallows! -- John W. Colby www.ColbyConsulting.com From michael at ddisolutions.com.au Wed Aug 5 18:28:29 2009 From: michael at ddisolutions.com.au (Michael Maddison) Date: Thu, 6 Aug 2009 09:28:29 +1000 Subject: [dba-SQLServer] Use a select in an update statement References: <4A7A01CF.9020407@colbyconsulting.com> Message-ID: <59A61174B1F5B54B97FD4ADDE71E7D015821E1@ddi-01.DDI.local> Hi John, Probably better ways to do it but what comes to mind first is using a temp table. Select top 10000 KeyCode INTO #Temp From tblOrderData Where NoChildren = '2' OrderBy RandomNumber Join the temp table back into your target table [tblOrderData] and do the Update. Obviously you need a key column to join back on, if its not KeyCode then you will need to adjust to suit. UPDATE tblOrderData SET KeyCode = 'KeyA' FROM tblOrderData INNER JOIN #Temp ON tblOrderData.KeyCode = #Temp.KeyCode To make it Dynamic you end up with something like... SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE PROCEDURE dbo.DynamicUpdateKeyCode @top INT, @NewKeyCode nvarchar(50) AS BEGIN SET NOCOUNT ON; DECLARE @sql nvarchar(4000), @params nvarchar(4000) SELECT @sql = ' Select top @xtop KeyCode INTO #Temp From tblOrderData Where NoChildren = ''2'' Order By RandomNumber ' PRINT @sql SELECT @params = '@xtop INT' EXEC sp_executesql @sql , @params, @top --Join the temp table back into your target table [tblOrderData] and do the Update. SELECT @sql = ' UPDATE tblOrderData SET KeyCode = ''@xNewKeyCode'' FROM tblOrderData INNER JOIN #Temp ON tblOrderData.KeyCode = #Temp.KeyCode' PRINT @sql SELECT @params = '@xNewKeyCode nvarchar(50)' EXEC sp_executesql @sql , @params, @NewKeyCode DROP TABLE #Temp; END GO HTH Michael M I need to update a field based on the top N values in another field kind of thing. IOW Select top 10000 KeyCode From tblOrderData Where NoChildren = '2' OrderBy RandomNumber Now, I need to UPDATE Keycode to 'KeyA' I can save the Select statement to vSelKeyCode and then do an update on that as follows: UPDATE vSelKeyCode SET KeyCode = 'KeyA' I then need to do this many times, changing the TOP() value and NoOfChildren code. It seems logical that I could replace vSelKeyCode with the Select statement contained in vSelKeyCode but I get errors when I attempt this. Is it possible to do this? What I am trying to do in the end is create a stored procedure that allows me to pass in the TOP() value, NoOfChildren code and Key value and build dynamic code to perform this update. In the past I have just created N stored views with the correct TOP() value and NoOfChildren code hard coded, then performed an Update to each of those stored views. While that works it is a PITA and subject to all kinds of errors. There has to be a better way, and I don't know what it is. The dynamic SQL statement in a stored procedure is my answer, and lead me to the damned gallows! -- John W. Colby www.ColbyConsulting.com _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Wed Aug 5 21:46:06 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 05 Aug 2009 22:46:06 -0400 Subject: [dba-SQLServer] SQL Server 2005 - Getting back the records affected Message-ID: <4A7A43EE.8070901@colbyconsulting.com> In SQL Server 2005 when I perform an action query (Update, delete etc) how do I determine how many records were affected? Google is not being my friend on this one. -- John W. Colby www.ColbyConsulting.com From stuart at lexacorp.com.pg Wed Aug 5 22:16:51 2009 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Thu, 06 Aug 2009 13:16:51 +1000 Subject: [dba-SQLServer] SQL Server 2005 - Getting back the records affected In-Reply-To: <4A7A43EE.8070901@colbyconsulting.com> References: <4A7A43EE.8070901@colbyconsulting.com> Message-ID: <4A7A4B23.21622.493FD8D2@stuart.lexacorp.com.pg> If you are using a query in Management Studio, it will tell you. If you are using a stored procedure include the line "SET NOCOUNT OFF" -- Stuart On 5 Aug 2009 at 22:46, jwcolby wrote: > In SQL Server 2005 when I perform an action query (Update, delete etc) how do I determine how many > records were affected? Google is not being my friend on this one. > > -- > John W. Colby > www.ColbyConsulting.com > _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com > From jwcolby at colbyconsulting.com Wed Aug 5 22:27:55 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 05 Aug 2009 23:27:55 -0400 Subject: [dba-SQLServer] SQL Server 2005 - Getting back the records affected In-Reply-To: <4A7A4B23.21622.493FD8D2@stuart.lexacorp.com.pg> References: <4A7A43EE.8070901@colbyconsulting.com> <4A7A4B23.21622.493FD8D2@stuart.lexacorp.com.pg> Message-ID: <4A7A4DBB.4050903@colbyconsulting.com> I needed @@RowCount, which of course I found in the OhNoSecond after posting the message. John W. Colby www.ColbyConsulting.com Stuart McLachlan wrote: > If you are using a query in Management Studio, it will tell you. If you are using a stored > procedure include the line "SET NOCOUNT OFF" > From ssharkins at gmail.com Thu Aug 6 15:25:33 2009 From: ssharkins at gmail.com (Susan Harkins) Date: Thu, 6 Aug 2009 16:25:33 -0400 Subject: [dba-SQLServer] Another good one from Francisco! Message-ID: <21773540E7134031A00AE894D5F7349A@SusanOne> Susan H. From jwcolby at colbyconsulting.com Fri Aug 7 16:13:12 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 07 Aug 2009 17:13:12 -0400 Subject: [dba-SQLServer] Crossposted - Building a table dynamically - SQL Server Message-ID: <4A7C98E8.3020204@colbyconsulting.com> I need to build a table (tblOrderData) to permanently store all of the data from all of the fields for an order. The table consists of two parts: 1) A PK and all of the name address fields. This is fixed and never changes. 2) A dynamic part where the fields come from a query used to select the name / address data, and later to insert said data into this tblOrderData. This part can be anywhere from 1 to N fields from about 600 possible criteria fields (the database from hell for those who have followed my past ramblings). As a little background, I have a template database with all of the queries, tables and stored procedures required to build an order, and then I copy that template to an order name, run the order and end up with a permanent store of all the records that go into an order. The permanent storage and database per order is non-negotiable, so please no "normalize it" suggestions. This template has become overstuffed from trying this that and the other so I am rebuilding it, keeping just what is actually used. So... I have a stored procedure that builds the fields of the base tblOrderData. Just because this is what occurred to me to do for this, I then take the fields of the selection view and subtract the fields from the base tblOrderData, and end up with a field list (and data type - mostly just varchar) for the fields that have to be added on to tblOrderData to store all of the data required to process an order. This subtraction process uses the Information_Schema table to obtain the field name and data type for tblOrderData (the base table) and a specific view which is the actual view used to populate the table later on. Outer join / not in and voila, just the names of the criteria fields. I use that in a dynamic SQL statement to append fields to tblOrderData. tblOrderData plus N various criteria fields makes new tblOrderData with every single field required to process the order. I do this in a set of stored procedures. The process requires (or at least I THINK it requires) creating a handful of views dynamically as well. The process is more complex than I would like however, though it does "just work". I am looking for suggestions for how to build this dynamic tblOrderData. I do not use (not sure what they are called) temporary tables inside of stored procedures, but this certainly seems like a good place to do that. Instead of dynamically creating views and using those views to create lists of fields, and using those lists of fields to append new fields to the base table, just use a single stored procedure and a handful of "temporary tables" to get the field list and append the new fields. Of course I also have to dynamically build indexes over these fields as well... So from this disjointed rambling, does anyone have any cogent suggestions re "a better way" to dynamically build a table with a base part (fields) and a changing part (fields). -- John W. Colby www.ColbyConsulting.com From stuart at lexacorp.com.pg Fri Aug 7 20:32:49 2009 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Sat, 08 Aug 2009 11:32:49 +1000 Subject: [dba-SQLServer] Crossposted - Building a table dynamically - SQL Server In-Reply-To: <4A7C98E8.3020204@colbyconsulting.com> References: <4A7C98E8.3020204@colbyconsulting.com> Message-ID: <4A7CD5C1.12868.5242F25@stuart.lexacorp.com.pg> As I see it, you only need two SQL queries - a "Create Table" which inserts the relevant fields and indexes and an "Insert Into... From Select(.......)" to populate the table. The key is selecting field names and maniplating strings to build the SQL. So you need a tool which is good at both of these. Access would work well because of it's multilselect listbox and VBA's string handling - so I am cross-posting this back to AccessD. :-) Create an Access database with a link to your main data table in SQL Server. Start off with a Form containing a multiselect list Fill the listbox with all the fields from your master database with something like Function GetFields() Dim db As Database Dim tbl As TableDef Dim fd As Field Set db = CurrentDb Set tbl = db.TableDefs("dbo_tblMasterData") For Each fd In tbl.Fields lstFields.Add fd.Name Next End Function Select the fields you want for youe new tblOrderData. Write a function which loops through the selected items and builds an SQL "create table" string to create the table with the appropriate fields and indexes and an "insert into" string to populate the table. You can make these dynamic queries or "Create Procedure" queries. Export the strings to .qry files and then run them in SQL Server Management Studio. (Personally, I'd use PB/WIN and SQL Tools - that way I could do it all in one small .exe file including runnning the "Create Table" and cross database "Insert Into" queries without needing export the strings to file and importing them into SQL Server management Studio) -- Stuart On 7 Aug 2009 at 17:13, jwcolby wrote: > I need to build a table (tblOrderData) to permanently store all of the data from all of the fields > for an order. The table consists of two parts: > > 1) A PK and all of the name address fields. This is fixed and never changes. > 2) A dynamic part where the fields come from a query used to select the name / address data, and > later to insert said data into this tblOrderData. This part can be anywhere from 1 to N fields from > about 600 possible criteria fields (the database from hell for those who have followed my past > ramblings). > > As a little background, I have a template database with all of the queries, tables and stored > procedures required to build an order, and then I copy that template to an order name, run the order > and end up with a permanent store of all the records that go into an order. The permanent storage > and database per order is non-negotiable, so please no "normalize it" suggestions. > > This template has become overstuffed from trying this that and the other so I am rebuilding it, > keeping just what is actually used. > > So... > > I have a stored procedure that builds the fields of the base tblOrderData. Just because this is > what occurred to me to do for this, I then take the fields of the selection view and subtract the > fields from the base tblOrderData, and end up with a field list (and data type - mostly just > varchar) for the fields that have to be added on to tblOrderData to store all of the data required > to process an order. > > This subtraction process uses the Information_Schema table to obtain the field name and data type > for tblOrderData (the base table) and a specific view which is the actual view used to populate the > table later on. Outer join / not in and voila, just the names of the criteria fields. I use that > in a dynamic SQL statement to append fields to tblOrderData. > > tblOrderData plus N various criteria fields makes new tblOrderData with every single field required > to process the order. > > I do this in a set of stored procedures. The process requires (or at least I THINK it requires) > creating a handful of views dynamically as well. The process is more complex than I would like > however, though it does "just work". > > I am looking for suggestions for how to build this dynamic tblOrderData. I do not use (not sure > what they are called) temporary tables inside of stored procedures, but this certainly seems like a > good place to do that. Instead of dynamically creating views and using those views to create lists > of fields, and using those lists of fields to append new fields to the base table, just use a single > stored procedure and a handful of "temporary tables" to get the field list and append the new > fields. Of course I also have to dynamically build indexes over these fields as well... > > So from this disjointed rambling, does anyone have any cogent suggestions re "a better way" to > dynamically build a table with a base part (fields) and a changing part (fields). > > -- > John W. Colby > www.ColbyConsulting.com > _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com > From fuller.artful at gmail.com Tue Aug 11 11:56:39 2009 From: fuller.artful at gmail.com (Arthur Fuller) Date: Tue, 11 Aug 2009 12:56:39 -0400 Subject: [dba-SQLServer] Forcibly Delete SQL Server Message-ID: <29f585dd0908110956p3abdc597vef6889c56633c3d4@mail.gmail.com> My SQL stuff is all botched up. I wanted to uninstall it all (SQL 2008 Developer, SQL 2008 Express and SQL 2005), but even that screws up. So then I thought, to hell with it, I'll just forcibly delete the entire directory. All the databases live outside that tree, so no problem there. Is there anything else I should worry about? Is there any reason why this, followed by starting again from scratch, wouldn't work? Are there a bunch of registry entries to worry about? TIA, Arthur From fhtapia at gmail.com Tue Aug 11 12:05:32 2009 From: fhtapia at gmail.com (Francisco Tapia) Date: Tue, 11 Aug 2009 10:05:32 -0700 Subject: [dba-SQLServer] Forcibly Delete SQL Server In-Reply-To: <29f585dd0908110956p3abdc597vef6889c56633c3d4@mail.gmail.com> References: <29f585dd0908110956p3abdc597vef6889c56633c3d4@mail.gmail.com> Message-ID: There may depending on how many services you enabled, if it's just the agent and the engine, there a few entries, one way to get rid of them since you are uprooting the installed app, is to use a product like ccleaner which scan your drive and registry for invalid file locations, thus killing an app will also remove all their registry references. One thing that you won't be removing are the shared files that are installed into the windows directories :|, such is life ... -Francisco http://sqlthis.blogspot.com | Tsql and More... On Tue, Aug 11, 2009 at 9:56 AM, Arthur Fuller wrote: > My SQL stuff is all botched up. I wanted to uninstall it all (SQL 2008 > Developer, SQL 2008 Express and SQL 2005), but even that screws up. So then > I thought, to hell with it, I'll just forcibly delete the entire directory. > All the databases live outside that tree, so no problem there. Is there > anything else I should worry about? Is there any reason why this, followed > by starting again from scratch, wouldn't work? Are there a bunch of > registry > entries to worry about? > TIA, > Arthur > _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com > > From fuller.artful at gmail.com Tue Aug 11 12:12:07 2009 From: fuller.artful at gmail.com (Arthur Fuller) Date: Tue, 11 Aug 2009 13:12:07 -0400 Subject: [dba-SQLServer] Forcibly Delete SQL Server In-Reply-To: References: <29f585dd0908110956p3abdc597vef6889c56633c3d4@mail.gmail.com> Message-ID: <29f585dd0908111012q6f9e5a41h2058b4974c0ac77f@mail.gmail.com> Thanks, Francisco. The up side of this mess is that installation on my notebook seems fine. It's just the desktop with the nice 22" monitor that's all porked up. On Tue, Aug 11, 2009 at 1:05 PM, Francisco Tapia wrote: > There may depending on how many services you enabled, if it's just the > agent > and the engine, there a few entries, one way to get rid of them since you > are uprooting the installed app, is to use a product like ccleaner which > scan your drive and registry for invalid file locations, thus killing an > app > will also remove all their registry references. One thing that you won't > be > removing are the shared files that are installed into the windows > directories :|, such is life ... > > > > -Francisco > http://sqlthis.blogspot.com | Tsql and More... > > From robert at webedb.com Tue Aug 11 12:34:39 2009 From: robert at webedb.com (Robert Stewart) Date: Tue, 11 Aug 2009 12:34:39 -0500 Subject: [dba-SQLServer] Forcibly Delete SQL Server In-Reply-To: References: Message-ID: <200908111734.n7BHYtAD014143@databaseadvisors.com> Yes, there are a lot of registry entries. You might want to Google "remove SQL Server Manually" At 12:00 PM 8/11/2009, you wrote: >Date: Tue, 11 Aug 2009 12:56:39 -0400 >From: Arthur Fuller >Subject: [dba-SQLServer] Forcibly Delete SQL Server >To: Discussion concerning MS SQL Server > >Message-ID: > <29f585dd0908110956p3abdc597vef6889c56633c3d4 at mail.gmail.com> >Content-Type: text/plain; charset=ISO-8859-1 > >My SQL stuff is all botched up. I wanted to uninstall it all (SQL 2008 >Developer, SQL 2008 Express and SQL 2005), but even that screws up. So then >I thought, to hell with it, I'll just forcibly delete the entire directory. >All the databases live outside that tree, so no problem there. Is there >anything else I should worry about? Is there any reason why this, followed >by starting again from scratch, wouldn't work? Are there a bunch of registry >entries to worry about? >TIA, >Arthur From fuller.artful at gmail.com Tue Aug 11 14:10:06 2009 From: fuller.artful at gmail.com (Arthur Fuller) Date: Tue, 11 Aug 2009 15:10:06 -0400 Subject: [dba-SQLServer] Forcibly Delete SQL Server In-Reply-To: <200908111734.n7BHYtAD014143@databaseadvisors.com> References: <200908111734.n7BHYtAD014143@databaseadvisors.com> Message-ID: <29f585dd0908111210r4876883bteb93c7edf7e2b182@mail.gmail.com> Thanks! That led to some leads. On Tue, Aug 11, 2009 at 1:34 PM, Robert Stewart wrote: > Yes, there are a lot of registry entries. > > You might want to Google "remove SQL Server Manually" > From Robert at webedb.com Thu Aug 13 08:17:29 2009 From: Robert at webedb.com (Robert) Date: Thu, 13 Aug 2009 09:17:29 -0400 Subject: [dba-SQLServer] dba-SQLServer Digest, Vol 78, Issue 6 Message-ID: I have had to do it before also. I found everything I needed through that search. ---------------------------------------- Date: Tue, 11 Aug 2009 15:10:06 -0400 From: Arthur Fuller Subject: Re: [dba-SQLServer] Forcibly Delete SQL Server To: Discussion concerning MS SQL Server Message-ID: <29f585dd0908111210r4876883bteb93c7edf7e2b182 at mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1 Thanks! That led to some leads. On Tue, Aug 11, 2009 at 1:34 PM, Robert Stewart wrote: > Yes, there are a lot of registry entries. > > You might want to Google "remove SQL Server Manually" > ------------------------------ _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver End of dba-SQLServer Digest, Vol 78, Issue 6 ******************************************** From dwaters at usinternet.com Fri Aug 14 17:03:54 2009 From: dwaters at usinternet.com (Dan Waters) Date: Fri, 14 Aug 2009 17:03:54 -0500 Subject: [dba-SQLServer] Creating an Update Package for SQL Server Message-ID: <1BEDD9EBF30E40909F2735835F1EAFD0@danwaters> At one of my customers, we are upsizing to SQL Server. Since I'm connecting with ODBC table links, it's not that big a deal. However, the instance of SS will be on a production server, which I won't have access to. But, I still need to make table design changes from time to time. The IT folks there said that I can make an 'Update Package' to accomplish this. The idea is that I can make this Update Package as a single file, which I can send to the DBA, and she can then 'run' the file which will make all the changes. So, how do I begin to learn how to do this? Thanks! Dan From marklbreen at gmail.com Fri Aug 14 18:10:33 2009 From: marklbreen at gmail.com (Mark Breen) Date: Sat, 15 Aug 2009 00:10:33 +0100 Subject: [dba-SQLServer] Creating an Update Package for SQL Server In-Reply-To: <1BEDD9EBF30E40909F2735835F1EAFD0@danwaters> References: <1BEDD9EBF30E40909F2735835F1EAFD0@danwaters> Message-ID: Hello Dan, They are probably talking about you creating a script that Updates the old database with the changes that you have created on your development environment. There are a number of tools out there that do that for you, AdeptSQL and RedGate are two companies that produce tools to do that. Basically they allow you to point to the live server and the dev server and then they produce a single file with the scripts that you can run. the script can update one column in one table to creating hundreds of sprocs and tables. If you intend to just create minor changes then you will not need these, you many just write the SQL by hand. Have a look at the Edit menu option in SQL Server for a table, then add a column from design view. Then look at edit again. Note the differences for the new column. Then try writing the SQL yourself. It will be something like Alter tblCustomers add column WifesMobile nvarchar(50) it becomes trickier to do it by hand when you modify columns in that case, the tools are great. Does this answer your question? BTW, Redgate can be trialled for 14 days. Best of luck, Mark 2009/8/14 Dan Waters > At one of my customers, we are upsizing to SQL Server. Since I'm > connecting > with ODBC table links, it's not that big a deal. > > However, the instance of SS will be on a production server, which I won't > have access to. But, I still need to make table design changes from time > to > time. The IT folks there said that I can make an 'Update Package' to > accomplish this. The idea is that I can make this Update Package as a > single file, which I can send to the DBA, and she can then 'run' the file > which will make all the changes. > > So, how do I begin to learn how to do this? > > Thanks! > Dan > > _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com > > From dwaters at usinternet.com Fri Aug 14 19:11:59 2009 From: dwaters at usinternet.com (Dan Waters) Date: Fri, 14 Aug 2009 19:11:59 -0500 Subject: [dba-SQLServer] Creating an Update Package for SQL Server In-Reply-To: References: <1BEDD9EBF30E40909F2735835F1EAFD0@danwaters> Message-ID: <3E4B328E2C414D62B1CFC010A38E1341@danwaters> Mark, Your description of what I'm doing is perfect. Mostly I anticipate minor changes, but occasionally there will be a significant addition (I hope!). So, I'll probably do this by hand considering the tools you mentioned are at few hundred dollars each. After I write out code to make the changes I need, how do I deliver this to the DBA at my customer so that she can use it? Thanks! Dan -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Mark Breen Sent: Friday, August 14, 2009 6:11 PM To: Discussion concerning MS SQL Server Subject: Re: [dba-SQLServer] Creating an Update Package for SQL Server Hello Dan, They are probably talking about you creating a script that Updates the old database with the changes that you have created on your development environment. There are a number of tools out there that do that for you, AdeptSQL and RedGate are two companies that produce tools to do that. Basically they allow you to point to the live server and the dev server and then they produce a single file with the scripts that you can run. the script can update one column in one table to creating hundreds of sprocs and tables. If you intend to just create minor changes then you will not need these, you many just write the SQL by hand. Have a look at the Edit menu option in SQL Server for a table, then add a column from design view. Then look at edit again. Note the differences for the new column. Then try writing the SQL yourself. It will be something like Alter tblCustomers add column WifesMobile nvarchar(50) it becomes trickier to do it by hand when you modify columns in that case, the tools are great. Does this answer your question? BTW, Redgate can be trialled for 14 days. Best of luck, Mark 2009/8/14 Dan Waters > At one of my customers, we are upsizing to SQL Server. Since I'm > connecting > with ODBC table links, it's not that big a deal. > > However, the instance of SS will be on a production server, which I won't > have access to. But, I still need to make table design changes from time > to > time. The IT folks there said that I can make an 'Update Package' to > accomplish this. The idea is that I can make this Update Package as a > single file, which I can send to the DBA, and she can then 'run' the file > which will make all the changes. > > So, how do I begin to learn how to do this? > > Thanks! > Dan > > _______________________________________________ > 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 dwaters at usinternet.com Fri Aug 14 19:45:25 2009 From: dwaters at usinternet.com (Dan Waters) Date: Fri, 14 Aug 2009 19:45:25 -0500 Subject: [dba-SQLServer] Creating an Update Package for SQL Server In-Reply-To: References: <1BEDD9EBF30E40909F2735835F1EAFD0@danwaters> Message-ID: <1AFC9DED8CFA4196BD988B91E98D9E99@danwaters> Hi Mark, I have a copy of VS Studio 2008. From the book, it looks like I will be able to automatically generate Change Scripts while making changes to a table. Sounds like recording a macros in Excel. Each script is stored as a file that I can then send to the DBA at my customer. Thanks again! Dan -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Mark Breen Sent: Friday, August 14, 2009 6:11 PM To: Discussion concerning MS SQL Server Subject: Re: [dba-SQLServer] Creating an Update Package for SQL Server Hello Dan, They are probably talking about you creating a script that Updates the old database with the changes that you have created on your development environment. There are a number of tools out there that do that for you, AdeptSQL and RedGate are two companies that produce tools to do that. Basically they allow you to point to the live server and the dev server and then they produce a single file with the scripts that you can run. the script can update one column in one table to creating hundreds of sprocs and tables. If you intend to just create minor changes then you will not need these, you many just write the SQL by hand. Have a look at the Edit menu option in SQL Server for a table, then add a column from design view. Then look at edit again. Note the differences for the new column. Then try writing the SQL yourself. It will be something like Alter tblCustomers add column WifesMobile nvarchar(50) it becomes trickier to do it by hand when you modify columns in that case, the tools are great. Does this answer your question? BTW, Redgate can be trialled for 14 days. Best of luck, Mark 2009/8/14 Dan Waters > At one of my customers, we are upsizing to SQL Server. Since I'm > connecting > with ODBC table links, it's not that big a deal. > > However, the instance of SS will be on a production server, which I won't > have access to. But, I still need to make table design changes from time > to > time. The IT folks there said that I can make an 'Update Package' to > accomplish this. The idea is that I can make this Update Package as a > single file, which I can send to the DBA, and she can then 'run' the file > which will make all the changes. > > So, how do I begin to learn how to do this? > > Thanks! > Dan > > _______________________________________________ > 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 marklbreen at gmail.com Sat Aug 15 09:02:26 2009 From: marklbreen at gmail.com (Mark Breen) Date: Sat, 15 Aug 2009 15:02:26 +0100 Subject: [dba-SQLServer] Creating an Update Package for SQL Server In-Reply-To: <1AFC9DED8CFA4196BD988B91E98D9E99@danwaters> References: <1BEDD9EBF30E40909F2735835F1EAFD0@danwaters> <1AFC9DED8CFA4196BD988B91E98D9E99@danwaters> Message-ID: Hello Dan, I have not used the feature that you are describing although it sounds convienent for some occasions. However, the trial version of SQL Compare is free for the first 14 days. And that might serve you well for the few times you need it. You can always install it on another machine if you need to do major updates again in the future. The nice thing about the comparison is that it allows you to really see the differences in all tables, views sprocs and all other objects in the db. Thanks for letting us know about the change scripts in VS2008. I will have to study that now. Mark 2009/8/15 Dan Waters > Hi Mark, > > I have a copy of VS Studio 2008. From the book, it looks like I will be > able to automatically generate Change Scripts while making changes to a > table. Sounds like recording a macros in Excel. Each script is stored as > a > file that I can then send to the DBA at my customer. > > Thanks again! > Dan > > -----Original Message----- > From: dba-sqlserver-bounces at databaseadvisors.com > [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Mark > Breen > Sent: Friday, August 14, 2009 6:11 PM > To: Discussion concerning MS SQL Server > Subject: Re: [dba-SQLServer] Creating an Update Package for SQL Server > > Hello Dan, > They are probably talking about you creating a script that Updates the old > database with the changes that you have created on your development > environment. > > There are a number of tools out there that do that for you, AdeptSQL and > RedGate are two companies that produce tools to do that. > > Basically they allow you to point to the live server and the dev server and > then they produce a single file with the scripts that you can run. > > the script can update one column in one table to creating hundreds of > sprocs > and tables. > > If you intend to just create minor changes then you will not need these, > you > many just write the SQL by hand. > > Have a look at the Edit menu option in SQL Server for a table, then add a > column from design view. Then look at edit again. Note the differences > for > the new column. > > Then try writing the SQL yourself. > > It will be something like > > Alter tblCustomers add column WifesMobile nvarchar(50) > > it becomes trickier to do it by hand when you modify columns in that case, > the tools are great. > > Does this answer your question? > > BTW, Redgate can be trialled for 14 days. > > Best of luck, > > Mark > > > > 2009/8/14 Dan Waters > > > At one of my customers, we are upsizing to SQL Server. Since I'm > > connecting > > with ODBC table links, it's not that big a deal. > > > > However, the instance of SS will be on a production server, which I won't > > have access to. But, I still need to make table design changes from time > > to > > time. The IT folks there said that I can make an 'Update Package' to > > accomplish this. The idea is that I can make this Update Package as a > > single file, which I can send to the DBA, and she can then 'run' the file > > which will make all the changes. > > > > So, how do I begin to learn how to do this? > > > > Thanks! > > Dan > > > > _______________________________________________ > > 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 Gustav at cactus.dk Sun Aug 16 14:33:06 2009 From: Gustav at cactus.dk (Gustav Brock) Date: Sun, 16 Aug 2009 21:33:06 +0200 Subject: [dba-SQLServer] SQLEXPRESS: SQL Server evaluation period has expired Message-ID: Hi all My local SQL Server 2008 Express would not start - gave the above message in the event log which doesn't make sense. This thread describes the issue: http://social.msdn.microsoft.com/Forums/en-US/sqlexpress/thread/2e6c26df-2155-406f-9388-9b5cdbf97e73 The solution for me was to uninstall it and then reinstall the latest version with SP1. /gustav From pcs.accessd at gmail.com Mon Aug 17 04:45:10 2009 From: pcs.accessd at gmail.com (Borge Hansen) Date: Mon, 17 Aug 2009 19:45:10 +1000 Subject: [dba-SQLServer] Stored Procedures - How can the code be protected? Message-ID: Hi all, How do I protect code in a Stored Procedure from being looked at, messed with, lifted out and used by others - not authorized to do so? I've read you can encrypt SP code - but that there are easy ways to get back the code in a readable form. Then there is the possbility of creating the SP in an CLR assemby: "embedding" the SP in C# code and ending up with the SP in a .dll file - etc... I think they are called "managed stored procedures" Question: Is this the way to fully protect / secure the SP code from the eyes of others?? If so, does anyone know of a few good links that will get me up to speed in writing and presenting Stored Procedures in a SQL db as CLR assemblies - "Managed Stored Procedures" ? I have VS2008 up and running finally ... and SQL2005 ... I should add that I have read about .NET but never really gotten down to writing code using Visual Studio and the .net platform - regards, borge From stuart at lexacorp.com.pg Mon Aug 17 05:45:27 2009 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Mon, 17 Aug 2009 20:45:27 +1000 Subject: [dba-SQLServer] Stored Procedures - How can the code be protected? In-Reply-To: References: Message-ID: <4A8934C7.25969.A68F55C@stuart.lexacorp.com.pg> You use the SQL Server's built in permissions. If they are not authorised to do so, they can't view the definition. As a general rule, users should only have Execute rights on SPs. -- Stuart On 17 Aug 2009 at 19:45, Borge Hansen wrote: > Hi all, > > How do I protect code in a Stored Procedure from being looked at, messed > with, lifted out and used by others - not authorized to do so? > > I've read you can encrypt SP code - but that there are easy ways to get back > the code in a readable form. > > Then there is the possbility of creating the SP in an CLR assemby: > "embedding" the SP in C# code and ending up with the SP in a .dll file - > etc... I think they are called "managed stored procedures" > > Question: > Is this the way to fully protect / secure the SP code from the eyes of > others?? > > If so, does anyone know of a few good links that will get me up to speed in > writing and presenting Stored Procedures in a SQL db as CLR assemblies - > "Managed Stored Procedures" ? > > I have VS2008 up and running finally ... and SQL2005 ... > > I should add that I have read about .NET but never really gotten down to > writing code using Visual Studio and the .net platform - > > regards, > borge > _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com > From pcs.accessd at gmail.com Mon Aug 17 06:35:57 2009 From: pcs.accessd at gmail.com (Borge Hansen) Date: Mon, 17 Aug 2009 21:35:57 +1000 Subject: [dba-SQLServer] Stored Procedures - How can the code be protected? In-Reply-To: <4A8934C7.25969.A68F55C@stuart.lexacorp.com.pg> References: <4A8934C7.25969.A68F55C@stuart.lexacorp.com.pg> Message-ID: Stuart, In the scenario where I am installing an application consisting of an Access/VBA Frontend and a SQL Db backend at a client's site - will that hold? Wouldn't the client's SQL Data Base Administrator and anyone else with sysadmin rights on the SQL Server have access to all the SP code that I have installed? regards, borge On Mon, Aug 17, 2009 at 8:45 PM, Stuart McLachlan wrote: > You use the SQL Server's built in permissions. > If they are not authorised to do so, they can't view the definition. > > As a general rule, users should only have Execute rights on SPs. > > -- > Stuart > > > On 17 Aug 2009 at 19:45, Borge Hansen wrote: > > > Hi all, > > > > How do I protect code in a Stored Procedure from being looked at, messed > > with, lifted out and used by others - not authorized to do so? > > > > I've read you can encrypt SP code - but that there are easy ways to get > back > > the code in a readable form. > > > > Then there is the possbility of creating the SP in an CLR assemby: > > "embedding" the SP in C# code and ending up with the SP in a .dll file - > > etc... I think they are called "managed stored procedures" > > > > Question: > > Is this the way to fully protect / secure the SP code from the eyes of > > others?? > > > > If so, does anyone know of a few good links that will get me up to speed > in > > writing and presenting Stored Procedures in a SQL db as CLR assemblies - > > "Managed Stored Procedures" ? > > > > I have VS2008 up and running finally ... and SQL2005 ... > > > > I should add that I have read about .NET but never really gotten down to > > writing code using Visual Studio and the .net platform - > > > > regards, > > borge > > _______________________________________________ > > dba-SQLServer mailing list > > dba-SQLServer at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > > http://www.databaseadvisors.com > > > > > _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com > > From stuart at lexacorp.com.pg Mon Aug 17 07:01:35 2009 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Mon, 17 Aug 2009 22:01:35 +1000 Subject: [dba-SQLServer] Stored Procedures - How can the code be protected? In-Reply-To: References: , <4A8934C7.25969.A68F55C@stuart.lexacorp.com.pg>, Message-ID: <4A89469F.29756.AAEA970@stuart.lexacorp.com.pg> Yes, the Sysadmin will have access. In this scenario, you can create the SPs on you development system and then script them out. Modify the script to include "WITH ENCRYPTION" ie "CREATE PROCEDURE dbo.myproc WITH ENCRYPTION AS...." Then you can run the scripts on the client installation. -- Stuart On 17 Aug 2009 at 21:35, Borge Hansen wrote: > Stuart, > In the scenario where I am installing an application consisting of an > Access/VBA Frontend and a SQL Db backend at a client's site - will that > hold? > > Wouldn't the client's SQL Data Base Administrator and anyone else with > sysadmin rights on the SQL Server have access to all the SP code that I have > installed? > > regards, > borge > > On Mon, Aug 17, 2009 at 8:45 PM, Stuart McLachlan wrote: > > > You use the SQL Server's built in permissions. > > If they are not authorised to do so, they can't view the definition. > > > > As a general rule, users should only have Execute rights on SPs. > > > > -- > > Stuart > > > > > > On 17 Aug 2009 at 19:45, Borge Hansen wrote: > > > > > Hi all, > > > > > > How do I protect code in a Stored Procedure from being looked at, messed > > > with, lifted out and used by others - not authorized to do so? > > > > > > I've read you can encrypt SP code - but that there are easy ways to get > > back > > > the code in a readable form. > > > > > > Then there is the possbility of creating the SP in an CLR assemby: > > > "embedding" the SP in C# code and ending up with the SP in a .dll file - > > > etc... I think they are called "managed stored procedures" > > > > > > Question: > > > Is this the way to fully protect / secure the SP code from the eyes of > > > others?? > > > > > > If so, does anyone know of a few good links that will get me up to speed > > in > > > writing and presenting Stored Procedures in a SQL db as CLR assemblies - > > > "Managed Stored Procedures" ? > > > > > > I have VS2008 up and running finally ... and SQL2005 ... > > > > > > I should add that I have read about .NET but never really gotten down to > > > writing code using Visual Studio and the .net platform - > > > > > > regards, > > > borge > > > _______________________________________________ > > > 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 marklbreen at gmail.com Mon Aug 17 10:02:27 2009 From: marklbreen at gmail.com (Mark Breen) Date: Mon, 17 Aug 2009 16:02:27 +0100 Subject: [dba-SQLServer] Stored Procedures - How can the code be protected? In-Reply-To: <4A89469F.29756.AAEA970@stuart.lexacorp.com.pg> References: <4A8934C7.25969.A68F55C@stuart.lexacorp.com.pg> <4A89469F.29756.AAEA970@stuart.lexacorp.com.pg> Message-ID: Hello Stuart, thanks for that, never knew you could do that. Here is the text from MSDN. http://msdn.microsoft.com/en-us/library/ms187926.aspx [ ENCRYPTION Indicates that SQL Server will convert the original text of the CREATE PROCEDURE statement to an obfuscated format. The output of the obfuscation is not directly visible in any of the catalog views in SQL Server. Users that have no access to system tables or database files cannot retrieve the obfuscated text. However, the text will be available to privileged users that can either access system tables over the DAC portor directly access database files. Also, users that can attach a debugger to the server process can retrieve the decrypted procedure from memory at runtime. For more information about accessing system metadata, see Metadata Visibility Configuration . This option is not valid for CLR stored procedures. Procedures created by using this option cannot be published as part of SQL Server replication. ] I would hate to have to debug a system that was encrypted like this, but I guess it is an option for some circumstances. Mark 2009/8/17 Stuart McLachlan > Yes, the Sysadmin will have access. > > In this scenario, you can create the SPs on you development system and > then script them > out. Modify the script to include "WITH ENCRYPTION" ie > > "CREATE PROCEDURE dbo.myproc > WITH ENCRYPTION > AS...." > > Then you can run the scripts on the client installation. > > -- > Stuart > > On 17 Aug 2009 at 21:35, Borge Hansen wrote: > > > Stuart, > > In the scenario where I am installing an application consisting of an > > Access/VBA Frontend and a SQL Db backend at a client's site - will that > > hold? > > > > Wouldn't the client's SQL Data Base Administrator and anyone else with > > sysadmin rights on the SQL Server have access to all the SP code that I > have > > installed? > > > > regards, > > borge > > > > On Mon, Aug 17, 2009 at 8:45 PM, Stuart McLachlan < > stuart at lexacorp.com.pg>wrote: > > > > > You use the SQL Server's built in permissions. > > > If they are not authorised to do so, they can't view the definition. > > > > > > As a general rule, users should only have Execute rights on SPs. > > > > > > -- > > > Stuart > > > > > > > > > On 17 Aug 2009 at 19:45, Borge Hansen wrote: > > > > > > > Hi all, > > > > > > > > How do I protect code in a Stored Procedure from being looked at, > messed > > > > with, lifted out and used by others - not authorized to do so? > > > > > > > > I've read you can encrypt SP code - but that there are easy ways to > get > > > back > > > > the code in a readable form. > > > > > > > > Then there is the possbility of creating the SP in an CLR assemby: > > > > "embedding" the SP in C# code and ending up with the SP in a .dll > file - > > > > etc... I think they are called "managed stored procedures" > > > > > > > > Question: > > > > Is this the way to fully protect / secure the SP code from the eyes > of > > > > others?? > > > > > > > > If so, does anyone know of a few good links that will get me up to > speed > > > in > > > > writing and presenting Stored Procedures in a SQL db as CLR > assemblies - > > > > "Managed Stored Procedures" ? > > > > > > > > I have VS2008 up and running finally ... and SQL2005 ... > > > > > > > > I should add that I have read about .NET but never really gotten down > to > > > > writing code using Visual Studio and the .net platform - > > > > > > > > regards, > > > > borge > > > > _______________________________________________ > > > > 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 > > > > > _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com > > From jeff.developer at gmail.com Tue Aug 18 09:00:26 2009 From: jeff.developer at gmail.com (Jeff Barrows) Date: Tue, 18 Aug 2009 09:00:26 -0500 Subject: [dba-SQLServer] Access 2003 to SQL question (cross posted to accessd and sqlserver lists) Message-ID: <2dad32080908180700t760dc54cn3d781bc6e93fea0e@mail.gmail.com> I have an app that has an Access 2003 front end and an SQL 2005 back end. Everything has been going fine, but now I noticed that I cannot update one of my tables through the FE. I am able to update through the Management Studio, but need to be able to do it through the FE. It seems to me that I had this problem before, but I cannot remember how I fixed it. Any suggestions? TIA -- Jeff Barrows From ab-mi at post3.tele.dk Tue Aug 18 09:54:19 2009 From: ab-mi at post3.tele.dk (Asger Blond) Date: Tue, 18 Aug 2009 16:54:19 +0200 Subject: [dba-SQLServer] Access 2003 to SQL question (cross posted toaccessd and sqlserver lists) In-Reply-To: <2dad32080908180700t760dc54cn3d781bc6e93fea0e@mail.gmail.com> References: <2dad32080908180700t760dc54cn3d781bc6e93fea0e@mail.gmail.com> Message-ID: <4E54049B6779408FB9CC8E26182657F0@AB> Has your table a Primary Key? I think a missing PK will make the table un-updatable through the FE. Asger -----Oprindelig meddelelse----- Fra: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] P? vegne af Jeff Barrows Sendt: 18. august 2009 16:00 Til: accessd; SQLServer Emne: [dba-SQLServer] Access 2003 to SQL question (cross posted toaccessd and sqlserver lists) I have an app that has an Access 2003 front end and an SQL 2005 back end. Everything has been going fine, but now I noticed that I cannot update one of my tables through the FE. I am able to update through the Management Studio, but need to be able to do it through the FE. It seems to me that I had this problem before, but I cannot remember how I fixed it. Any suggestions? TIA -- Jeff Barrows _______________________________________________ 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 Tue Aug 18 10:46:33 2009 From: fhtapia at gmail.com (Francisco Tapia) Date: Tue, 18 Aug 2009 08:46:33 -0700 Subject: [dba-SQLServer] Access 2003 to SQL question (cross posted toaccessd and sqlserver lists) In-Reply-To: <4E54049B6779408FB9CC8E26182657F0@AB> References: <2dad32080908180700t760dc54cn3d781bc6e93fea0e@mail.gmail.com> <4E54049B6779408FB9CC8E26182657F0@AB> Message-ID: Agreed, unless you are updating your tables through sprocs, any bound tables to the FE gui will not be updateable until you have a PK with auto-incrementing id. -Francisco http://sqlthis.blogspot.com | Tsql and More... On Tue, Aug 18, 2009 at 7:54 AM, Asger Blond wrote: > Has your table a Primary Key? I think a missing PK will make the table > un-updatable through the FE. > > Asger > > -----Oprindelig meddelelse----- > Fra: dba-sqlserver-bounces at databaseadvisors.com > [mailto:dba-sqlserver-bounces at databaseadvisors.com] P? vegne af Jeff > Barrows > Sendt: 18. august 2009 16:00 > Til: accessd; SQLServer > Emne: [dba-SQLServer] Access 2003 to SQL question (cross posted toaccessd > and sqlserver lists) > > I have an app that has an Access 2003 front end and an SQL 2005 back end. > Everything has been going fine, but now I noticed that I cannot update one > of my tables through the FE. I am able to update through the Management > Studio, but need to be able to do it through the FE. It seems to me that I > had this problem before, but I cannot remember how I fixed it. > > Any suggestions? > TIA > -- > Jeff Barrows > _______________________________________________ > 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 jeff.developer at gmail.com Tue Aug 18 11:15:29 2009 From: jeff.developer at gmail.com (Jeff Barrows) Date: Tue, 18 Aug 2009 11:15:29 -0500 Subject: [dba-SQLServer] Access 2003 to SQL question (cross posted toaccessd and sqlserver lists) In-Reply-To: References: <2dad32080908180700t760dc54cn3d781bc6e93fea0e@mail.gmail.com> <4E54049B6779408FB9CC8E26182657F0@AB> Message-ID: <2dad32080908180915k694ae7e2m6d7ab12e8cb96f9@mail.gmail.com> I found the solution! First of all, yes I did have a PK in the table. What I forgot was, the other guy working on this app added two bit fields and left them with null values. As soon as I made them all = 0, everything works fine. Thanks for the help! On Tue, Aug 18, 2009 at 10:46 AM, Francisco Tapia wrote: > Agreed, unless you are updating your tables through sprocs, any bound > tables > to the FE gui will not be updateable until you have a PK with > auto-incrementing id. > -Francisco > http://sqlthis.blogspot.com | Tsql and More... > > > On Tue, Aug 18, 2009 at 7:54 AM, Asger Blond wrote: > > > Has your table a Primary Key? I think a missing PK will make the table > > un-updatable through the FE. > > > > Asger > > > > -----Oprindelig meddelelse----- > > Fra: dba-sqlserver-bounces at databaseadvisors.com > > [mailto:dba-sqlserver-bounces at databaseadvisors.com] P? vegne af Jeff > > Barrows > > Sendt: 18. august 2009 16:00 > > Til: accessd; SQLServer > > Emne: [dba-SQLServer] Access 2003 to SQL question (cross posted toaccessd > > and sqlserver lists) > > > > I have an app that has an Access 2003 front end and an SQL 2005 back end. > > Everything has been going fine, but now I noticed that I cannot update > one > > of my tables through the FE. I am able to update through the Management > > Studio, but need to be able to do it through the FE. It seems to me that > I > > had this problem before, but I cannot remember how I fixed it. > > > > Any suggestions? > > TIA > > -- > > Jeff Barrows > > _______________________________________________ > > 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 > > -- Jeff Barrows From jwcolby at colbyconsulting.com Tue Aug 18 11:30:42 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Tue, 18 Aug 2009 12:30:42 -0400 Subject: [dba-SQLServer] Access 2003 to SQL question (cross posted toaccessd and sqlserver lists) In-Reply-To: <2dad32080908180915k694ae7e2m6d7ab12e8cb96f9@mail.gmail.com> References: <2dad32080908180700t760dc54cn3d781bc6e93fea0e@mail.gmail.com> <4E54049B6779408FB9CC8E26182657F0@AB> <2dad32080908180915k694ae7e2m6d7ab12e8cb96f9@mail.gmail.com> Message-ID: <4A8AD732.2060004@colbyconsulting.com> I ran into that myself the other day. Bit fields with null values = no update in SQL Server. John W. Colby www.ColbyConsulting.com Jeff Barrows wrote: > I found the solution! > > First of all, yes I did have a PK in the table. What I forgot was, the > other guy working on this app added two bit fields and left them with null > values. As soon as I made them all = 0, everything works fine. > > Thanks for the help! > > On Tue, Aug 18, 2009 at 10:46 AM, Francisco Tapia wrote: > >> Agreed, unless you are updating your tables through sprocs, any bound >> tables >> to the FE gui will not be updateable until you have a PK with >> auto-incrementing id. >> -Francisco >> http://sqlthis.blogspot.com | Tsql and More... >> >> >> On Tue, Aug 18, 2009 at 7:54 AM, Asger Blond wrote: >> >>> Has your table a Primary Key? I think a missing PK will make the table >>> un-updatable through the FE. >>> >>> Asger >>> >>> -----Oprindelig meddelelse----- >>> Fra: dba-sqlserver-bounces at databaseadvisors.com >>> [mailto:dba-sqlserver-bounces at databaseadvisors.com] P? vegne af Jeff >>> Barrows >>> Sendt: 18. august 2009 16:00 >>> Til: accessd; SQLServer >>> Emne: [dba-SQLServer] Access 2003 to SQL question (cross posted toaccessd >>> and sqlserver lists) >>> >>> I have an app that has an Access 2003 front end and an SQL 2005 back end. >>> Everything has been going fine, but now I noticed that I cannot update >> one >>> of my tables through the FE. I am able to update through the Management >>> Studio, but need to be able to do it through the FE. It seems to me that >> I >>> had this problem before, but I cannot remember how I fixed it. >>> >>> Any suggestions? >>> TIA >>> -- >>> Jeff Barrows >>> _______________________________________________ >>> dba-SQLServer mailing list >>> dba-SQLServer at databaseadvisors.com >>> http://databaseadvisors.com/mailman/listinfo/dba-sqlserver >>> http://www.databaseadvisors.com >>> >>> >>> >>> _______________________________________________ >>> dba-SQLServer mailing list >>> dba-SQLServer at databaseadvisors.com >>> http://databaseadvisors.com/mailman/listinfo/dba-sqlserver >>> http://www.databaseadvisors.com >>> >>> >> _______________________________________________ >> dba-SQLServer mailing list >> dba-SQLServer at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/dba-sqlserver >> http://www.databaseadvisors.com >> >> > > From jwcolby at colbyconsulting.com Wed Aug 19 11:28:04 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 19 Aug 2009 12:28:04 -0400 Subject: [dba-SQLServer] SQL Server - (In Recovery) Message-ID: <4A8C2814.8080901@colbyconsulting.com> What does (in recovery) mean when next to a database name in the management studio. I have two databases that show (in recovery). One if them I was actually working in, the other I wasn't. I am not finding anything on Google that explains what it means. -- John W. Colby www.ColbyConsulting.com From dbdoug at gmail.com Sat Aug 22 11:53:10 2009 From: dbdoug at gmail.com (Doug Steele) Date: Sat, 22 Aug 2009 09:53:10 -0700 Subject: [dba-SQLServer] Logging in to remote instance of SQL Server Express Message-ID: <4dd71a0c0908220953g263ab8dei5d6b1843a03fa7ff@mail.gmail.com> I have installed SQL Server Express on a client's computer and configured it for remote access. I'd like to log in using SS Management Studio from my computer. I can't find any documentation on the exact format of the login. I've tried some variations without success, but I don't know if I'm logging in correctly or I have some other connection problems. If the client ip address is 111.222.333.444 and the server name on the client is DAVE\SQLEXPRESS, what should I be entering into the 'Server Name' box of the SSMS 'Connect to Server' dialog box? Thanks, Doug Steele From ebarro at verizon.net Sat Aug 22 13:17:43 2009 From: ebarro at verizon.net (Eric Barro) Date: Sat, 22 Aug 2009 11:17:43 -0700 Subject: [dba-SQLServer] Logging in to remote instance of SQL Server Express In-Reply-To: <4dd71a0c0908220953g263ab8dei5d6b1843a03fa7ff@mail.gmail.com> References: <4dd71a0c0908220953g263ab8dei5d6b1843a03fa7ff@mail.gmail.com> Message-ID: <9466B7DF1BB44041BCC514C4CEB404A6@advancedinput.com> \\111.222.333.444\SQLEXPRESS Or \\DAVE\SQLEXPRESS -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Doug Steele Sent: Saturday, August 22, 2009 9:53 AM To: dba-sqlserver at databaseadvisors.com Subject: [dba-SQLServer] Logging in to remote instance of SQL Server Express I have installed SQL Server Express on a client's computer and configured it for remote access. I'd like to log in using SS Management Studio from my computer. I can't find any documentation on the exact format of the login. I've tried some variations without success, but I don't know if I'm logging in correctly or I have some other connection problems. If the client ip address is 111.222.333.444 and the server name on the client is DAVE\SQLEXPRESS, what should I be entering into the 'Server Name' box of the SSMS 'Connect to Server' dialog box? Thanks, Doug Steele _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From Gustav at cactus.dk Wed Aug 26 11:32:17 2009 From: Gustav at cactus.dk (Gustav Brock) Date: Wed, 26 Aug 2009 18:32:17 +0200 Subject: [dba-SQLServer] Free MS Press book: Introducing Microsoft SQL Server 2008 Message-ID: Hi all Did you notice this link for a free 250+ page PDF book: http://csna01.libredigital.com/?urss1q2we6 Written by industry experts Peter DeBetta, Greg Low, and Mark Whitehorn, Introducing Microsoft SQL Server 2008 will lead you through major new features in SQL Server 2008, including security, administration, performance, high availability, and business intelligence. /gustav From jwcolby at colbyconsulting.com Wed Aug 26 11:39:48 2009 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 26 Aug 2009 12:39:48 -0400 Subject: [dba-SQLServer] Free MS Press book: Introducing Microsoft SQL Server 2008 In-Reply-To: References: Message-ID: <4A956554.6090808@colbyconsulting.com> Thanks for that link. There's another one specifically for LINQ but I was unable to get at it. "Malformed xml" error. I did manage to get to this one. Thanks again. John W. Colby www.ColbyConsulting.com Gustav Brock wrote: > Hi all > > Did you notice this link for a free 250+ page PDF book: > > http://csna01.libredigital.com/?urss1q2we6 > > > Written by industry experts Peter DeBetta, Greg Low, and Mark Whitehorn, Introducing Microsoft SQL Server 2008 will lead you through major new features in SQL Server 2008, including security, administration, performance, high availability, and business intelligence. > > > /gustav > > > _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com > > From Gustav at cactus.dk Wed Aug 26 11:52:02 2009 From: Gustav at cactus.dk (Gustav Brock) Date: Wed, 26 Aug 2009 18:52:02 +0200 Subject: [dba-SQLServer] Free MS Press book: Introducing Microsoft SQL Server 2008 Message-ID: Hi John No, those three links at the VS2008 area don't work. I wrote to MS about it. /gustav >>> jwcolby at colbyconsulting.com 26-08-2009 18:39 >>> Thanks for that link. There's another one specifically for LINQ but I was unable to get at it. "Malformed xml" error. I did manage to get to this one. Thanks again. John W. Colby www.ColbyConsulting.com Gustav Brock wrote: > Hi all > > Did you notice this link for a free 250+ page PDF book: > > http://csna01.libredigital.com/?urss1q2we6 > > > Written by industry experts Peter DeBetta, Greg Low, and Mark Whitehorn, Introducing Microsoft SQL Server 2008 will lead you through major new features in SQL Server 2008, including security, administration, performance, high availability, and business intelligence. > > > /gustav From Betsy.Powlen at stanleyassociates.com Wed Aug 26 12:14:34 2009 From: Betsy.Powlen at stanleyassociates.com (Powlen, Betsy) Date: Wed, 26 Aug 2009 13:14:34 -0400 Subject: [dba-SQLServer] Free MS Press book: Introducing Microsoft SQLServer 2008 In-Reply-To: Message-ID: <2A419A21A2A23243A9E7851EEDBDC1220179C03E@OP-S-EX-2.stanleyassociates.com> This is great, Thanks! Is there a link like this for SQL Server 2005? I know we're a little behind...gov't, you know... Betsy Powlen DBA betsy.powlen.ctr at usmc.mil -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Wednesday, August 26, 2009 12:32 PM To: dba-sqlserver at databaseadvisors.com Subject: [dba-SQLServer] Free MS Press book: Introducing Microsoft SQLServer 2008 Hi all Did you notice this link for a free 250+ page PDF book: http://csna01.libredigital.com/?urss1q2we6 Written by industry experts Peter DeBetta, Greg Low, and Mark Whitehorn, Introducing Microsoft SQL Server 2008 will lead you through major new features in SQL Server 2008, including security, administration, performance, high availability, and business intelligence. /gustav _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From Gustav at cactus.dk Wed Aug 26 12:22:45 2009 From: Gustav at cactus.dk (Gustav Brock) Date: Wed, 26 Aug 2009 19:22:45 +0200 Subject: [dba-SQLServer] Free MS Press book: Introducing Microsoft SQLServer 2008 Message-ID: Hi Betsy I guess not ... if you ask MS. "2000 and what?? There is a book on 2008!". /gustav >>> Betsy.Powlen at stanleyassociates.com 26-08-2009 19:14 >>> This is great, Thanks! Is there a link like this for SQL Server 2005? I know we're a little behind...gov't, you know... Betsy Powlen DBA betsy.powlen.ctr at usmc.mil -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Wednesday, August 26, 2009 12:32 PM To: dba-sqlserver at databaseadvisors.com Subject: [dba-SQLServer] Free MS Press book: Introducing Microsoft SQLServer 2008 Hi all Did you notice this link for a free 250+ page PDF book: http://csna01.libredigital.com/?urss1q2we6 Written by industry experts Peter DeBetta, Greg Low, and Mark Whitehorn, Introducing Microsoft SQL Server 2008 will lead you through major new features in SQL Server 2008, including security, administration, performance, high availability, and business intelligence. /gustav From john at winhaven.net Sat Aug 29 12:32:59 2009 From: john at winhaven.net (John Bartow) Date: Sat, 29 Aug 2009 12:32:59 -0500 Subject: [dba-SQLServer] Test2 Message-ID: <00bf01ca28ce$c15779f0$44066dd0$@net> Test2 No trees were killed in the sending of this message, but a large number of electrons were terribly inconvenienced.