Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

44 lines
819 B

  1. use Win32::OLE;
  2. $conn = new Win32::OLE('Adodb.Connection');
  3. $conn->Open(<<EOF);
  4. Provider=SQLOLEDB;
  5. Persist Security Info=False;
  6. User ID=sa;
  7. Initial Catalog=Northwind;
  8. EOF
  9. checkerror();
  10. $conn->Execute("DROP Proc Test");
  11. $conn->Execute("DROP Proc get_customer");
  12. $conn->Execute(<<EOF);
  13. CREATE PROC Test
  14. AS
  15. RETURN(64)
  16. EOF
  17. checkerror();
  18. $conn->Execute(<<EOF);
  19. CREATE PROC get_customer \@cust_id nchar(5)
  20. AS
  21. SELECT * FROM Customers WHERE CustomerID=\@cust_id
  22. EOF
  23. checkerror();
  24. sub checkerror {
  25. if( $conn->Errors->{Count} ) {
  26. foreach $error (Win32::OLE::in($conn->Errors)) {
  27. print $error->{Description};
  28. }
  29. }
  30. }
  31. #CREATE PROCEDURE Test AS
  32. #RETURN 64
  33. #GO