SQLSoldier

Untitled

Jan 24th, 2014
175
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Create Table dbo.TestTable (TestID int, TestValue varchar(5))
  2. Go
  3.  
  4. Create Function dbo.TestTVF ()
  5. Returns Table
  6. As
  7. Return (Select * From dbo.TestTable)
  8. Go
  9.  
  10. Select *
  11. From dbo.TestTVF();
  12. Go
  13.  
  14. Alter Table dbo.TestTable Add TestValue2 varchar(5);
  15. Go
  16.  
  17. Exec sp_refreshsqlmodule 'dbo.TestTVF';
  18. go
  19.  
  20. Select *
  21. From dbo.TestTVF();
  22. Go
RAW Paste Data