SSMS Trusted

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

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 →

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 →

A WordPress.com Website.

Up ↑