tanrj / pyodbc

Automatically exported from code.google.com/p/pyodbc
MIT No Attribution
0 stars 0 forks source link

Different output in SQL Server Management Studios vs PyODBC #133

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. execute("sp_ScriptTable @TableName='Table', @NewTableName='dbo.Table'", con)

What is the expected output? What do you see instead?

Expected output (what i get if I execute the statement in SQL Server Management 
Studios):

CREATE TABLE dbo.table
(
 FactorId INT NOT NULL ,
 SubFactorId INT NOT NULL ,
 SubFactorWeight FLOAT NOT NULL ,
 StartDate DATETIME NOT NULL CONSTRAINT [DF_Table_StartDate] DEFAULT(((1900)/(1))/(1)),
 EndDate DATETIME NOT NULL CONSTRAINT [DF_Table_EndDate] DEFAULT(((3000)/(12))/(31))
,CONSTRAINT PK_RiskFactorTree_1 PRIMARY KEY  CLUSTERED (FactorId 
ASC,SubFactorId ASC,StartDate ASC)
)

Actual Output:

['CREATE TABLE dbo.Table',
 '(',
 '\nFactorId INT NOT NULL ,',
 '\nSubFactorId INT NOT NULL ,',
 '\nSubFactorWeight FLOAT NOT NULL ,',
 None,
 None,
 ',CONSTRAINT PK_Table_1 PRIMARY KEY  CLUSTERED (FactorId ASC,SubFactorId ASC,StartDate ASC)',
 ')']

What version of the product are you using? On what operating system?

PyODBC 2.1.5, Windows XP

Please provide any additional information below.

Not sure why the StartDate and EndDate become None in Python. Perhaps the 
slashes?

Original issue reported on code.google.com by chang...@gmail.com on 10 Nov 2010 at 1:11

GoogleCodeExporter commented 8 years ago
Never mind. The issue was something really weird/subtle in the SQL code. Sorry 
>_<

Original comment by chang...@gmail.com on 10 Nov 2010 at 4:08

GoogleCodeExporter commented 8 years ago

Original comment by mkleehammer on 20 Nov 2010 at 6:59

GoogleCodeExporter commented 8 years ago

Original comment by mkleehammer on 21 Nov 2010 at 4:43