Blog ( Of Ryan Olshan)

News

About Ryan Olshan

LinkedIn Profile

Follow Ryan via twitter

Join StrongTypes - Free Generics Help By Email
Join StrongTypes

Community Credit Winner

View my MVP profile

The posts on this weblog are provided "as is" with no warranties and confer no rights. The opinions expressed herin are my own personal opinions and do not represent my employer's view in any way.

Subscribe to Rolog via My AOL
Subscribe to Rolog via Bloglines


Subscribe to Rolog via Feedburner

Furl Rolog




Subscribe to Rolog via Newsburst


Subscribe to Rolog via Pluck

Add Rolog to Technorati Favorites




Thycotic Secret Server

Receive Email Updates


.NET Websites

  • => StrongTypes.com <=
  • Community Credit
  • DotNetCharity.com
  • DotNetSlackers
  • EasyListBox
  • LearnAsp.com
  • SystemNetMail.com
  • SystemWebMail.com

Blogroll

  • Alex Campbell
  • Carlos Magalhaes
  • Charles Carroll
  • Chris Taylor
  • Darren Neimke
  • David Betz
  • Eric Smith
  • Rob Caron
  • Rob Howard
  • Sam Gentile
  • Scott Guthrie
  • Scott Mitchell
  • Tess
  • Wesner Moise
  • Jason Alexander
  • Bill Ryan
  • Steve Smith
  • Sahil Malik
  • David Silverlight

Other Websites

  • 911 Pigeon Alert
  • Pacific Wildlife Project

Strong Coder Bloggers

  • Dean Fiala
  • Doug Nelson
  • Kevin Jones

Yahoo! Groups

  • => StrongTypes <=
  • AspNet2
  • AspNet20GridView
  • PayPalDevDotNet
  • RubyOnRails
  • VSTS

SQL

Fixing orphaned SQL users
I was migrating some databases and had some orphan users that I needed to fix. So, I found the sp_change_users_login stored procedure. It's pretty cool. Check it out.
Share this post: | bookmark it! | digg it! | reddit! | kick it! | live it!
Posted: Jan 15 2007, 07:47 PM by Ryan Olshan | with 1 comment(s)
Filed under: ,
2 Awesome Blog Posts By Doug Nelson

I came across two awesome blog posts by Doug Nelson.

Optional Parameters for Stored Procedures
GridView Dissapointments

Share this post: | bookmark it! | digg it! | reddit! | kick it! | live it!
Posted: Aug 09 2006, 06:56 AM by Ryan Olshan | with no comments
Filed under: ,
Useful SQL Script

Below is a script that I use to change the owners of all objects on a database to dbo.

------------------------------------------------------------------
-- Name: dbo.sp_FixObjOwners
-- Auth: Sal Terillo (
)
-- Date: 10/1/2002
-- finds objects that are not owned by dbo
-- and changes them to dbo
-- this eliminates the problem with objects accidentally
-- created as being owned by someone other than dbo
-- REVS:
--
------------------------------------------------------------------

CREATE PROC dbo.up_FixObjOwner
AS
   SET NOCOUNT ON

   DECLARE @dynsql VARCHAR ( 1000 )
   SET @dynsql = ''

   DECLARE @Obj_Owner sysname
   SET @Obj_Owner = ''

   DECLARE @Obj_Type VARCHAR ( 30 )
   SET @Obj_Type = ''

   DECLARE @Obj_Name sysname
   SET @Obj_Name = ''

   DECLARE @ObjCounter INT
   SET @ObjCounter = 0

   DECLARE @DBO CHAR ( 3 )
   SET @DBO = 'DBO'

   -- temp table to hold all objects not owned
   -- by DBO

   CREATE TABLE  #ChangeOwners (
       id INT identity ( 1 , 1 ),
      Obj_Owner sysname ,
      Obj_Name sysname ,
      Obj_Type VARCHAR ( 30 ))

   -- populate it
   INSERT #ChangeOwners ( Obj_Owner , Obj_Name , Obj_Type )
   SELECT
      su. name ,
      so. name ,
       CASE
          WHEN type = 'u'   THEN 'table'
          WHEN type = 'p'   THEN 'sproc'
          WHEN type = 'v'   THEN 'view'
       END AS  obj_type
   FROM sysusers su
   JOIN sysobjects so
   ON su.uid = so.uid
   WHERE su. name   NOT IN   ( 'information_schema' , 'dbo' )
   AND so.type  IN ( 'p' , 'u' , 'v' )

   -- select * from #ChangeOwners
   
SET @ObjCounter = @@rowcount     -- holds the count of rows inserted into #ChangeOwners

   WHILE @Objcounter > 0
       BEGIN
          -- construct string for object ownership change
          SELECT @Obj_Name = Obj_Owner + '.' + Obj_Name FROM #ChangeOwners WHERE id =
@ObjCounter
          SELECT @Obj_Type = Obj_Type FROM #ChangeOwners WHERE id = @ObjCounter

          SET @dynsql = 'sp_ChangeObjectOwner ''' + @Obj_Name + ''', ' + @DBO
          --select @dynsql
          PRINT 'changing ownership on ' + @Obj_Type + ': ' + @Obj_Name
          EXEC ( @dynsql )
          SET @ObjCounter = @ObjCounter - 1
       END

   -- ok all done, collect garbage
   DROP TABLE  #ChangeOwners
GO

Share this post: | bookmark it! | digg it! | reddit! | kick it! | live it!
Posted: Nov 15 2005, 10:03 AM by Ryan Olshan | with no comments
Filed under:
Cool Embed SQL DB

VistaDB 2.1 database for .NET has been released

This 2.1 update includes over 60 improvements, including new support for .NET 2.0 and Visual Studio 2005. VistaDB is a small-footprint, embedded SQL database alternative to Jet/Access, MSDE and SQL Server Express 2005 that enables developers to build .NET 1.1 and .NET 2.0 applications. Features SQL-92 support, small 500KB embedded footprint, free 2-User VistaDB Server for remote TCP/IP data access, royalty free distribution for both embedded and server, Copy 'n Go! deployment, managed ADO.NET Provider, data management and data migration tools.


Free trial is available for download.
- Learn more about VistaDB
- Repost this to your blog and receive a FREE copy of VistaDB 2.1!

Share this post: | bookmark it! | digg it! | reddit! | kick it! | live it!
Posted: Nov 14 2005, 02:17 PM by Ryan Olshan | with no comments
Filed under: ,
More Posts