Saturday, 18 May 2013

Take Back up of table using select statement in sql server

BackUp table

Sql server:Take Back up using select statement in sql server

Hi,
        We can see How to take a back up using select statement in sql server.
Example ::

Create a table by using following query
      Create table #info (id int,Sname varchar(50))

Insert data in to above table


   insert into #info(id,Sname) values(1,'sandip.')
   insert into #info(id,Sname) values(2,'sandip_SP')
   insert into #info(id,Sname) values(3,'sandip_Ak')
   insert into #info(id,Sname) values(4,'sandip_Sk')
   insert into #info(id,Sname) values(5,'sandipG')


Check following Query to take backup from our table #info to #backUp


  select * into #backUp from #info

Take a back up of table #info to #backUp with where clause


  select * into #backUp from #info where id=1

1 comment:

  1. very simple but greate example

    ReplyDelete

8451831077