Tuesday 19 December 2017

IDENT_CURRENT SQL Server



IDENT_CURRENT return last inserted identity field value from any session any scope table.
One most interesting things which surprise me while I had used this first time. Which is follows

You can get SQL server generated identity value which inserting row, means it is not necessary that identity value only can get after save a row. Not at all!

You can use this feature while creating some userid and roll number type field in many applications.

i.e: 10000001,2000829 etc.

CREATE TABLE dbo.stu( 
   ID INT IDENTITY NOT NULL PRIMARY KEY,  
   Roll varchar(20),
   Name VARCHAR(40) NOT NULL 
   City VARCHAR(40) NOT

Saturday 16 December 2017

Nested Loop


Nested Loop Banner


When a loop resides inside of other loop .Nested loops are useful while if there is a need of looping for each count of other turn of a loop.

Temporary Table in SQL Server store procedure

declare @mytbl as table
(
     id bigint,
     name varchar(30),
     mobileno varchar(30),

Friday 15 December 2017

Sort Array using pointer

Question : Write a function in ‘C’, using pointers for the array of elements, for sorting the elements.
Solution : 


#include<stdio.h>
#include<conio.h>
void sort(int*);
void main()
{