Different results from same PS script

Welcome Forums General PowerShell Q&A Different results from same PS script

This topic contains 1 reply, has 2 voices, and was last updated by

2 years, 3 months ago.

  • Author
  • #55255

    Points: 1
    Rank: Member

    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

    Points: 132
    Helping Hand
    Rank: Participant

    Can you post the script and sample input?

The topic ‘Different results from same PS script’ is closed to new replies.