MoinMoin Logo
  • Comments
  • Immutable Page
  • Menu
    • Navigation
    • RecentChanges
    • FindPage
    • Local Site Map
    • Help
    • HelpContents
    • HelpOnMoinWikiSyntax
    • Display
    • Attachments
    • Info
    • Raw Text
    • Print View
    • Edit
    • Load
    • Save
  • Login

Navigation

  • Start
  • Sitemap

Upload page content

You can upload content for the page named below. If you change the page name, you can also upload content for another page. If the page name is empty, we derive the page name from the file name.

File to load page content from
Page name
Comment

Revision 3 as of 2013-12-23 10:48:15
  • tsql

tsql

Microsoft Transact SQL (t-sql)

Show stored procedure or function code

   1 exec sp_helptext 'schema.storedProc'
   2 exec sp_helptext 'schema.function'

Show CLR assemblies

   1 -- get assembly_id
   2 select * from sys.assembly_modules

Extract SQL CLR assembly

http://serverfault.com/questions/139703/extracting-a-sqlclr-assembly

   1 -- reconfigure
   2 sp_configure 'show advanced options', 1;
   3 GO
   4 RECONFIGURE;
   5 GO
   6 sp_configure 'Ole Automation Procedures', 1;
   7 GO
   8 RECONFIGURE;
   9 GO
  10 
  11 -- extract assembly
  12 DECLARE @IMG_PATH VARBINARY(MAX)
  13 DECLARE @ObjectToken INT
  14 
  15 SELECT @IMG_PATH = content FROM sys.assembly_files WHERE assembly_id = 65824 and file_id=1
  16 
  17 EXEC sp_OACreate 'ADODB.Stream', @ObjectToken OUTPUT
  18         EXEC sp_OASetProperty @ObjectToken, 'Type', 1
  19         EXEC sp_OAMethod @ObjectToken, 'Open'
  20         EXEC sp_OAMethod @ObjectToken, 'Write', NULL, @IMG_PATH
  21         EXEC sp_OAMethod @ObjectToken, 'SaveToFile', NULL, 'c:\windows\temp\65824.dll', 2
  22         EXEC sp_OAMethod @ObjectToken, 'Close'
  23         EXEC sp_OADestroy @ObjectToken

Number seconds netween two dates

   1 SELECT datediff(second, dateX1, GETDATE() )
   2 FROM tablex
  • MoinMoin Powered
  • Python Powered
  • GPL licensed
  • Valid HTML 4.01