Different results from same PS script

This topic contains 1 reply, has 2 voices, and was last updated by Profile photo of Sam Boutros Sam Boutros 1 week, 1 day ago.

  • Author
  • #55255
    Profile photo of Constantin D
    Constantin D

    Good afternoon All,

    I find myself into a bit of a strange situation.

    Basically, I have a PowerShell script which uses SMO to generate DDL scripts for database objects (tables, in my case).
    After assigning the various scripter options (among others, was the disable of all object constraints), when I am running the PowerShell script on my Win 7 machine (Powershell Version 4, 64 Bit), I get the desired DDL scripts, where all tables have no constraints whatsoever. Everything looks good!

    But when I run the same PowerShell script from a Win Server 2012 machine (same PowerShell version 4, 64 Bit), the generated DDL scripts contain constraints for the source tables. Note that the source tables are identical in both situations.

    So far, I double checked that the code is the same and that the version and environment of the PowerShell script is identical in both situations. Note that I am calling the PowerShell scripts via windows batch files (again, identical in both situations).

    Nothing else comes to mind on what would I be checking next. Anyone else has encountered anything of the sort?
    Any help would be greatly appreciated.


  • #55301
    Profile photo of Sam Boutros
    Sam Boutros

    Can you post the script and sample input?

You must be logged in to reply to this topic.