It is possible to run SQL Server Management Studio under the guise of another user account from the command line: The command line will request a password which (quite rightly!) cannot be entered into the command. Successful authentication will launch an instance of SSMS 2008. Lovely.
SQL Server Compact 4.0
Loving the medium trust capabilities for small online apps - take that! all you sucky rip off hosters!!Here Comes SQL Server Compact 4.0 | Rob Tiffany
ASP.NET embedded database support
New Embedded Database Support with ASP.NET - ScottGu's Blog
Mapping Your Data with Bing Maps and SQL Server 2008 – Part 1
Mapping Your Data with Bing Maps and SQL Server 2008 – Part 1
SQL to Select a random row from a database table
SQL to Select a random row from a database table
Restore Database 2005 User Logins
When a database is restored from one server to another user logins are dropped. This script will help rectify that: SET NOCOUNT ON--SELECT 'EXEC sp_change_users_login ''Auto_Fix'', '''+ user_id + ''', NULL, '''+ user_id + ''''SELECT 'EXEC sp_change_users_login ''Auto_Fix'', '''+ user_id + ''', NULL, ''password''' FROM staff s JOIN sys.sysusers su ON su.name = s.user_id WHERE... Continue Reading →
Using ASPNET_RegSQL.exe with SQL Express databases in APP_DATA
As discussed at Lance's Whiteboard, a really easy way to hook up an ASPNET membership provider database to an application ... perfect for rapid prototyping... "Creating a new DB in VisualStudio.NET 2005 is as simple as "Select APP_DATA node -> Add New Item -> Sql Database" and wah-lah you have a new aspnet.mdf file located... Continue Reading →
Compare contents of two tables.
SET QUOTED_IDENTIFIER ON GOSET ANSI_NULLS ON GOif exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[sp_CompareTables]') and OBJECTPROPERTY(id, N'IsProcedure') = 1) drop procedure [dbo].[sp_CompareTables]GOCREATE PROCEDURE sp_CompareTables @table1 sysname, @table2 sysname, @ColumnList varchar(8000) = '*', @Summary bit = 0, @Detail bit = 1, @TableNameHeader varchar(30) = '[Table Name]', @CounterHeader varchar(30) = '[Counter]', @rc int = null... Continue Reading →
Compare 2 database tables
SET QUOTED_IDENTIFIER ONGOSET ANSI_NULLS ON GOIF EXISTS (select * from dbo.sysobjects where id = object_id(N'[dbo].[sp_CompareDBTables]') and OBJECTPROPERTY(id, N'IsProcedure') = 1) drop procedure [dbo].[sp_CompareDBTables]GOCREATE PROC sp_CompareDBTables@targetDB sysname,@Summary bit = 0,@Detail bit = 1--****************************************--@targetDB: we'll compare the current database with this one--@Summary: do we want summary output?--@Detail: do we want detail output?--calls sp_CompareTables for each table in... Continue Reading →