Monday, April 20, 2015

How to stop IIS asking authentication for default website on localhost

IIS uses Integrated Authentication and by default IE has the ability to use your windows user account...but don't worry, so does Firefox but you'll have to make a quick configuration change.

1) Open up Firefox and type in about:config as the url


2) In the Filter Type in ntlm

3) Double click "network.automatic-ntlm-auth.trusted-uris" and type in localhost and hit enter

Wednesday, April 15, 2015

How to find all the dependencies of a table in sql server

Following are the way can check the depedencies


Method 1: Using sp_depends

 sp_depends 'dbo.First'  
 GO  


Method 2: Using information_schema.routines
 SELECT *   
  FROM information_schema.routines ISR   
  WHERE CHARINDEX('dbo.First', ISR.ROUTINE_DEFINITION) > 0   
  GO  


Method 3: Using DMV sys.dm_sql_referencing_entities

 SELECT referencing_schema_name, referencing_entity_name, referencing_id, 
 referencing_class_desc, is_caller_dependent FROM sys.dm_sql_referencing_entities
 ('dbo.First', 'OBJECT'); GO referencing_id, referencing_class_desc, is_caller_dependent  
 FROM sys.dm_sql_referencing_entities ('dbo.First', 'OBJECT');  
 GO  

Tuesday, April 14, 2015

Insert value from one table to another in SQL Server

Example

 INSERT INTO new_table (Col1, Col2, Col3, Coln)  
 SELECT Value1, Value2, Value3, Valuen
 FROM initial_table  
 -- optionally WHERE / JOINS ...  

Update one table based on another table using JOIN - SQL Server

Example

  UPDATE t1 SET   
     t1.status = 1  
  FROM  table1 t1   
     INNER JOIN table t2   
           ON t1.Id = t2.ID  
  WHERE t2.num = 15