Friday, October 14, 2011

Change Password of SA Login Using Management Studio - SQL SERVER

Change Password of SA Login Using Management Studio - SQL SERVERStep1: Login into SQL Server using Windows Authentication. Step2: In Object Explorer, open Security folder, open Logins folder. Right Click on SA account and go to Properties. Step3: Change SA password, and confirm it. Click OK.Make sure to restart the SQL Server and all its services and test new password by log into system using SA login and new passwo...

Monday, September 19, 2011

User Defined Functions - Informatica

User Defined Functions - InformaticaInformatica User Defined Functions are similar to Built-in Functions, where these functions need to be created once and execute multiple timesTransformation Logic implemented without User Defined Functions: Validation “IIF( ISNULL(INPUT),’TRUE’,’FALSE’)” is being performed in multiple ports. The disadvantage with this approach is any changes to this validation need to be done in all the ports. This can be addressed...

Monday, February 21, 2011

The easy way to Get table and index DDL script

The easy way to Get table and index DDL script: The dbms_metadata utility helps to display DDL directly from the data dictionary. We see the small example. Initial setup:SQL> conn scott/tiger;Connected.SQL> create table GET_TAB_SCRIPT2 (3 c1 varchar2(10),4 c2 number5 );Table created.SQL> insert into get_tab_script values ('A',10);1 row created.SQL> commit;Commit complete.SQL> create index idx_1 on GET_TAB_SCRIPT (c1);Index created. To get table script: SQL> select dbms_metadata.get_ddl('TABLE','GET_TAB_SCRIPT') from dual;DBMS_METADATA.GET_DDL('TABLE','GET_TAB_SCRIPT')------------------------------------------------CREATE...

Saturday, February 12, 2011

Order by based on the parameter passed in SQL server:

Order by based on the parameter passed in SQL server:Dynamically ordering a result set based on the parameter passed is a powerful technique for ordering your data. The below example shows that and see the issues which we faces.Initial setup:create table dept(deptid int,deptname varchar(10))insert into dept values (1,'Sales')insert into dept values (4,'Production')insert into dept values (3,'fiance')insert into dept values (2,'HR')The following SQL script shows how you might try to use a CASE expression to dynamically order a result set:DECLARE...

Wednesday, January 5, 2011

Schema Binding in SQL server

Schema Binding : Creating a view with the SCHEMABINDING option locks the tables being referred by the view and prevents any changes that may change the table schema. Notice two important points while creating a view with SCHEMABINDING OPTION:1. The objects should be referred to by their owner names (two part name - [ownername.objectname] ).2. SELECT * is not permitted. We see that using below scripts.create table schema_binding_table(id int,msg varchar(10))insert into schema_binding_table values(1,'msg1'),(2,'msg2'),(3,'msg3')select * from schema_binding_tableid...