Thursday, 19 February 2015

automatic inserted in sql tables multiple rows

automatic inserted in sql tables multiple  rows :


automatic inserted in sql tables multiple  rows :


declare @id int 
select @id = 1
while @id >=1 and @id <= 50
begin
insert into [sample] values ('c' +convert(varchar(5),@id)+'@gmail.com','123')
   print 'c' +convert(varchar(5),@id)+'@gmail.com
    select @id = @id + 1
end

Tuesday, 10 February 2015

Create temp table in sql

Create temp table in sql :



SQl Temp Table


SELECT  [EmpID]
      ,[FirstName]
      ,[LastName]
      ,[Salary]
      ,[Address]
      ,[id] 
    INTO #TempEmp   --> TableName
  FROM [sample].[dbo].[Employee]


  
  Select * From #TempEmp