Friday, January 21, 2011

Table Vairable-The Creation

This script creates a "Table Variable", then inserted 3 records into it the table, and selects all the records from the table.

  DECLARE @varTable table(   
  Id int IDENTITY(1,1),   
  UserName VARCHAR(25),   
  Passwd VARCHAR(15)   
  )   

  INSERT into @varTable(UserName,Passwd)   
  Values('Jib','JibsPasswd')   

  INSERT into @varTable(UserName,Passwd)   
  Values('Jax','JaxsPasswd')  
 
  INSERT into @varTable(UserName,Passwd)   
  Values('Who','WhosPasswd') 
  
  SELECT *
  From @varTable   
  
  GO    

More to come, CA.

No comments:

Post a Comment