Today, I was trying to create a diagram in SQL Server to setup table relationships. I kept getting an error. I gave my user owner rights on the database but that still did not work, until I found this: EXEC dbo.sp_changedbowner @loginame = N'sa', @map = false This fixed it!
The dotNetDave Rocks The Nation Tour will stop in southern California at the SQL Saturday on April 26th. Lets Rock the OC! If you live in the area you need to attend the following session: Rock Your Technical Interview™ Have you ever not gotten a job because you weren’t prepared for the interview? Would you [...]
I hope everyone in southern California is planning to attend this years SQL Saturday in San Diego, Ca on 9/15. It’s always a great time and lots of free training! I will be presenting the following sessions and I hope you will attend. Geeks Anonymous What do programmers really want? Do you work at a [...]
SQL Server 2012 has been released to manufacturing today! SQL Server 2012 will provide Mission Critical Confidence with greater uptime, blazing-fast performance and enhanced security features for mission critical workloads; Breakthrough Insight with managed self-service data exploration and stunning interactive data visualizations capabilities; Cloud On Your Own Terms by enabling the creation and extension of [...]
We recently completed some load tests and found a bug with the SqlConnection object in .NET 4.0. When reviewing the results of our load test we noticed that the handle count climbed up to 85,000 and never went down. After investigation we found the problem is with the SqlConnection object. We contacted Microsoft about the [...]
I hope everyone in southern California is planning to attend this years SQL Saturday in Huntington Beach, CA on April 9th. It’s always a great time and lots of free training! I will have a limited number of my latest book to sell "David McCarter's .NET Coding Standards" ($12) and a DVD full of conference [...]
Here is a cool sp that will find any text within a stored procedure. Add this your Master database. CREATE PROCEDURE [dbo].[Find_text_in_sp] @text VARCHAR(250),@dbname VARCHAR(64) = NULL AS BEGIN SET nocount ON; IF @dbname IS NULL BEGIN --enumerate all databases. DECLARE #db CURSOR FOR SELECT name FROM MASTER..sysdatabases DECLARE @c_dbname VARCHAR(64) OPEN #db FETCH #db INTO @c_dbname WHILE @@FETCH_STATUS <> -1 --and @MyCount < 500 BEGIN EXECUTE Find_text_in_sp @text, @c_dbname FETCH #db INTO @c_dbname END CLOSE #db DEALLOCATE #db END --if @dbname is null ELSE BEGIN --@dbname is not null DECLARE @sql VARCHAR(250) --create the find like command SELECT @sql = 'select ''' + @dbname + ''' as db, o.name,m.definition ' SELECT @sql = @sql + ' from ' + @dbname + '.sys.sql_modules m ' SELECT @sql = @sql + ' inner join ' + @dbname + '..sysobjects o on m.object_id=o.id' SELECT @sql = @sql + ' where [definition] like ''%' + @text + '%''' EXECUTE (@sql) END --@dbname is not null [...]