Guest User

Untitled

a guest
Oct 29th, 2018
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.22 KB | None | 0 0
  1. create procedure uspGetLoginDetails( @Username varchar(30),@Password varchar(30))
  2. as
  3. begin try
  4. select UserName,Password from Corporate_Booking.Employee where UserName=@Username and Password=@Password
  5. end try
  6. begin catch
  7. select ERROR_MESSAGE()
  8. end catch
  9.  
  10.  
  11.  
  12. --create proc uspGetNameByID @EmpID int,@FName varchar(30) out,@LName varchar(30) out
  13. --as
  14. --Begin try
  15. --select @FName=c.FirstName,@LName=c.LastName from HumanResources.Employee e join Person.Contact c
  16. --on e.ContactID=c.ContactID where e.EmployeeID=@EmpID
  17. --end try
  18. --begin catch
  19. --select ERROR_MESSAGE();
  20. --end catch
  21.  
  22. create proc uspGetRoomDetails @City varchar(30),@DateOfBooking varchar(30),@RoomType varchar(30),@Slot int,@RoomID int out,@RoomName varchar(30),
  23. @RoomType varchar(30),@Capacity int,@NoOfMachines int out,@TableType varchar(30) out,@FacilityName varchar(30) out,
  24.  
  25. as
  26. Begin try
  27. select @FName=c.FirstName,@LName=c.LastName from Rooms r join VenueDetails v on r.LocationId=v.LocationId
  28. join RoomFacility rf on r.RoomID=rf.RoomID
  29. join Facility f on f.Facility_ID=rf.Facility_ID
  30. join BookingDetails bon r.RoomID=b.RoomId
  31. where rf.ActiveStatus=true and
  32. (@DateOfBooking!=b.BookingDate and @Slot!= b.Slot)
  33. end try
  34. begin catch
  35. select ERROR_MESSAGE();
  36. end catch
  37.  
  38. -- delete room procedure
  39.  
  40.  
  41. create proc uspDelete @City varchar(30),@RoomName(30) varchar(30)
  42. as
  43. begin try
  44. delete from Rooms where VenueDetails.City=@City and Rooms.RoomName=@RoomName
  45. return @@rowcount
  46. end try
  47. begin catch
  48. select ERROR_MESSAGE()
  49. end catch
  50.  
  51. -- room name selection from city selection\
  52.  
  53. create proc uspSelectCity @City varchar(30),@RoomName varchar(30) out
  54. as
  55. Begin try
  56. select @RoomName=r.RoomName from Rooms r join VenueDetails v
  57. on r.LocationID=v.LocationID where v.City=@City
  58. end try
  59. begin catch
  60. select ERROR_MESSAGE();
  61. end catch
  62.  
  63.  
  64. --add room insert sp
  65.  
  66. create proc uspInsertCustomer @CustID int,@FName varchar(20),@LName varchar(20),
  67. @Email varchar(20),@Mobile varchar(20),@AL1 varchar(20),@AL2 varchar(20),@Type char(1),@Aadhar varchar(20)
  68. as
  69. begin try
  70. insert into Customer values(@CustID,@FName,@LName,@Email,@Mobile,@AL1,@AL2,@Type,@Aadhar)
  71. return @@rowcount
  72. end try
  73. begin catch
  74. select ERROR_MESSAGE(),ERROR_LINE()
  75. end catch
Add Comment
Please, Sign In to add comment