SQL Error: Database diagram support objects cannot be installed

September 3rd, 2010 by Sanket 
Solution to MS SQL Error: Database diagram support objects cannot be installed If you ever get a message like this when trying to create a diagram in SQL 2005 “Database diagram support objects cannot be installed because this database does not have a valid owner. To continue, first use the Files page of the Database Properties dialog box or the ALTER AUTHORIZATION statement to set the database...

Understanding INNER join in detail

August 11th, 2010 by Sanket 
Understanding INNER join in detail The objective of this article is dig into detail of how INNER joins produce the result set. The INNER join is the common join type used in many cases. Even though it is used very often I have seen most people are not certain how it produces the result set when changing the join condition.   Before go into the article contents, I need to create the two tables...

Delete All Stored Procedures and Views in SQL

July 17th, 2010 by Sanket 
  Delete All Stored Procedures declare @procName varchar(500)declare cur cursor for select [name] from sys.objects where type = 'p'open cur fetch next from cur into @procName while @@fetch_status = 0 begin if @procName <> 'DeleteAllProcedures' exec('drop procedure ' + @procName) fetch next from cur into @procName end close...

Delete All Tables in MS SQL

July 16th, 2010 by Sanket 
Delete All TablesĀ  – MS SQL Query --Delete All Keys DECLARE @Sql NVARCHAR(500) DECLARE @Cursor CURSORSET @Cursor = CURSOR FAST_FORWARD FORSELECT DISTINCT sql = 'ALTER TABLE [' + tc2.TABLE_NAME + '] DROP [' + rc1.CONSTRAINT_NAME + ']'FROM INFORMATION_SCHEMA.REFERENTIAL_CONSTRAINTS rc1LEFT JOIN INFORMATION_SCHEMA.TABLE_CONSTRAINTS tc2 ON tc2.CONSTRAINT_NAME =rc1.CONSTRAINT_NAMEOPEN @Cursor FETCH...

Enable SQL encryption in ASP.NET

January 21st, 2010 by Sanket 
Database Encryption is ASP.NET   If you are using the ADO.NET SQL Server managed data provider and a SqlConnection object to connect to SQL Server, then you can enable encryption by adding the encrypt=true parameter to the connection string as shown here. <configuration>    <connectionStrings>       <add name="MyDbConn"       ...