SQL script to HTML
Python file: Export_MPD.py # Purpose: Generate an HTML file listing descriptions of tables in a SQL Server database # from a base creation script (exported from SQL Server Management Studio) # Input file: BaseTest.SQL # Output file: BaseTest.HTML def getHtmlHead(): return """<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> </head> <body> <font size="4" color="black"><u><b>""" def transform(source, target): inFile = open(source, 'r') outFile = open(target,'a') while 1 : tLine = inFile.readline() if tLine == '': break elif 'CREATE TABLE [dbo].[' in tLine: tLine = tLine.replace('CREATE TABLE [dbo].[','') tLine = tLine.replace('](','') htmlText = getHtmlHead() + 'Table: '+t...
Commentaires
Enregistrer un commentaire