Created FK using sql but "CREATE SCRIPT" not same

I used this to create a FK relationship between  a Parent and Child table.
     ALTER TABLE [dbo].[Child]
     ADD  CONSTRAINT [FK_Child_Parent]
     FOREIGN KEY([Pid])
     REFERENCES [dbo].[Parent] ([pid])
     GO
When I scripted the relationship (under SSMS) this was returned....
     ALTER TABLE [dbo].[Child]  WITH CHECK ADD  CONSTRAINT [FK_Child_Parent] FOREIGN KEY([Pid])
     REFERENCES [dbo].[Parent] ([pid])
     GO
      ALTER TABLE [dbo].[Child] CHECK CONSTRAINT [FK_Child_Parent]
      GO
Note the addition of "CHECK CONSTRAINT" and now there are two statements What does that do that my original statement didn't?
TIA,
edm2

It does nothing different.  This is just another instance of SSMS explicitly scripting out the current state of the object, and explicitly specifying every possible option, even if the current value is the same as the default setting.
The first statement creates the constraint, checks the existing data and enables the constraint.  The second statement enables the constraint.
The reason it uses two statements is probably because you cannot create a CHECK CONSTRAINT and disable it in a single statement.  If you want to, you must use two statements.  So SSMS appears to be coded to always use two statements: one to create
the constraint and one to set it's enabled/disabled state.  IE because it sometimes requires two statements to create a CHECK CONSTRAINT in the desired state, SSMS always uses two statements, because it's simpler to code the script generator that way.
David
David http://blogs.msdn.com/b/dbrowne/

Similar Messages

  • I am trying to configure my SCXI-1540 card for excitation voltage and frequency using MAX - but it is not giving me that option when I click on the card and then properties​, am I looking in the wrong place?

    I am trying to configure my SCXI-1540 w/1315 card for excitation voltage and frequency using MAX - but it is not giving me that option when I click on the card and then properties, am I looking in the wrong place?
    I have LabVIEW Express 7.0 Professional - SCXI-1000 Chassiss - along with SCXI-1112, and SCXI 1520/1314 - cable to the PCI-6052E is attached to the 1520 card.
    MAX says it recognizes all the cards in the chassiss.

    Jeremy, Thanks for the reply.
    I tried to set up the system as DAQmx.
    I had MAX auto-detect the set-up - and it recognized all the cards - but did not select the 1315 accessory on the 1540 card - I had to do that manually - but in the configuration section I would select the accessory and it would deselect itself. I had to get out of the set-up and then right click on the 1540 card and click on the "Accessories" tab and select the 1315 terminal block that way.
    It didn't seem right that the system should behave that way, but I pressed onward.
    I then tried to create a new DAQmx Task
    When I create new DAQmx task and then click on Analog Input no "Position" Tab appears for me to select, all I get are:
    Analog>>Voltage
    Analog>>Temperature
    Ana
    log>>Strain
    Analog>>Current
    Analog>>Resistance
    Analog>>Frequency
    Analog>>Custom Voltage with Excitation
    Do you think there might be something wrong with either my hardware or perhaps my configuration that is not allowing it to recognize the 1540/1315 in DAQmx?
    I had included the system report of what programs I am using, etc. as attached file nireport.txt
    After the DAQmx did not work I tried installing everything as Traditional DAQ and it did let me set-up the 1540 Card with Excitation Voltage and Frequency and gain - I then went in to the VI that I had built and tried to use the Express DAQ Assisant to read the channel that I am connected to on the 1315/1540 - when I try to use DAQ Assistant it gives me an error saying that "Device not available in NI-DAQmx. It is possible that the device is being use by traditional NI-DAQ"
    Which I guess it is since both configurations are now set-up in MAX.
    I would PREFER to use the DAQmx set-up, but I am confused as to WHY it won
    't come up with
    Analog input>>POSITION>>LVDT
    When I try to create a new DAQmx task.
    Thanks for the help so far! As you can probably tell I am new at this.
    Ryan
    Attachments:
    nireport.txt ‏2 KB

  • I have just dowloaded the icloud control panel on my PC and i am am able to see everything that has been pushed to icloud from my ipad. However i cannot see my email. i can send from the computer using icloud, but i do not see any mail that is being rec.

    i have just dowloaded the icloud control panel on my PC and i am am able to see everything that has been pushed to icloud from my ipad. However i cannot see my email. i can send from the computer using icloud, but i do not see any mail that is being received by my ipad, which is set up with my mail server. What haven't i checked lol?

    turn your ipad off by holding the sleep wake button for 5 seconds and slide to turn off then turn it back on and the apps should be finished and if the apps didnt finish just redownload them

  • I have produced a number of DVD on my iMac. They are stored in a folder called Burn Folder. I want to get them into iTunes so I can play them on Apple TV. I have tried to convert them to MP4s using Handbrake but Handbrake does not recognize these files.

    I have produced a number of DVD on my iMac. They are stored in a folder called Burn Folder. I want to get them into iTunes so I can play them on Apple TV. I have tried to convert them to MP4s using Handbrake but Handbrake does not recognize these files. I am stumped.

    If you have the original movie files, you'd be much better converting those, otherwise try MPEGstreamclip.

  • My iPad mini is not syncing with my MAC. I'm trying to sync my photos using iTunes but it's not working. Help???

    My iPad mini is not syncing with my MAC. I'm trying to sync my photos using iTunes but it's not working. Help???

    Hello, flippytippi.  
    Thank you for visiting Apple Support Communities.
    I would need a little more information regarding what exactly you are experiencing when attempting to sync photos to better assist you.  However, here is a troubleshooting article that I would recommend going through.  
    iTunes: Unable to sync photos
    http://support.apple.com/kb/TS3697
    Cheers,
    Jason H.

  • I use uTorrent but it will not shut down when i quit

    I use uTorrent but it will not shut down when I quit

    Any torrent program will and can destroy your computer.
    You are not the first and will not be the last to learn this.
    UnInstall and if your machine is capable Repair Permissions and shut your computer clear off, this allows it to reset and then restart your computer.  Be wary of anything you get from a torrent. Movie, Music, game, EVERYTHING.

  • Can I back out 3.6.1 and install 3.6 instead? I want to use Azigo, but it is not compatible with 3.6.1.

    Can I back out 3.6.1 and install 3.6 instead? I want to use Azigo but it is not compatible with 3.6.1.

    Install Firefox Portable 3.6.22 to your hard drive for that website. <br />
    http://portableapps.com/apps/internet/firefox_portable/localization#legacy36

  • Sometime ago I found a copy of Photoshop 5.5 (both the APPLICATION and TRAINING) CD's in trash. I finally am getting around to try to use this, but I do not have a serial number. I have the original CD's, not illegal copies - how can I get serial numbers

    Sometime ago I found a copy of Photoshop 5.5 (both the APPLICATION and TRAINING) CD's in trash. I finally am getting around to try to use this, but I do not have a serial number. I have the original CD's, not illegal copies - how can I get serial numbers to use to get this program working?

    Sorry to say you are out of luck.
    The serial numbers came on the cd case. If they are no longer there, you have no way of using the program except as a 30 day trial. Adobe does not sell CS5 licenses any more.
    Gene

  • I am using numbers but I am not able to update numbers and I get error that you could not able to download this app.

    I am using numbers but I am not able to update last version of numbers. When I try to update that I get error that you could not able to download this app. So what should I do?  

    Try running the combo update.
    10.9.2
    If that works and it still shows as an update, try re-indexing Spotlight.
    Spotlight – Re-index

  • IPhone 6 plus thinks I'm using headphone but I'm not?

    My iphone 6 plus thinks I'm using headphone, but I'm not. Why is this happening  I need sound

    this has happened on every model iPhone going back to the original - try plugging and unplugging the headphone cable into the iPhone jack quickly a few times - that usually fixes it
    if not you may need to take it an Apple store or send it back to Apple for repair
    whats going on is the Iphone things the headphones are still attached

  • My computer temp runs at 120 degrees. I used scmfancontrol but it did not lower the temp much. Can you tell me what I can do to make it work or any other suggestions to fix this would be most appreciated.

    My computer temp runs at 120 degrees. I used scmfancontrol but it did not lower the temp much. Can you tell me what I can do to make it work or any other suggestions to fix this would be most appreciated.

    To get rid of "pop-up ads and other crap on my computer when I am on the internet", click on Safari in the Menu bar, and select Preferences. Next select Extensions. Delete all of them. Restart Safari.
    The first step in addressing the black screen is an SMC reset.
    Shut down the computer.
    Plug in the MagSafe power adapter to a power source, connecting it to the Mac if its not already connected.
    On the built-in keyboard, press the (left side) Shift-Control-Option keys and the power button at the same time.
    Release all the keys and the power button at the same time.
    Press the power button to turn on the computer. 
    Note: The LED on the MagSafe power adapter may change states or temporarily turn off when you reset the SMC.
    Excerpt from
    http://support.apple.com/kb/ht39

  • Use BridgeTalk,but my script doesn't work

    Hi,
    I want to use BridgeTalk to open a image in photoshop,but my script doesn't work.
    Anyone can tell me why?Thanks!
    Best Regards
    goldbridge
    #target indesign
    #targetengine "MyEngine"
    var doc=app.activeDocument;
    if(doc.selection.length>0)
                        if(doc.selection[0].constructor.name=="Image")
                               jpgpath=new File(app.selection[0].itemLink.filePath);
                               bt = new BridgeTalk;
                               bt.target = "photoshop";
                               bt.type = "iterator";
                               bt.body="{app.open(jpgpath);}";
                               bt.onResult = function(resObj) {};
                               bt.send();
                               BridgeTalk.bringToFront("photoshop");

    In your body script… jpgpath is just part of a string you have not constructed this to pass the variable… Also some classes are considered complex types so you need to toSource() and then eval…
    #target indesign
    #targetengine "MyEngine"
    var doc=app.activeDocument;
    if(doc.selection.length>0)
                        if(doc.selection[0].constructor.name=="Image")
                               jpgpath=new File(app.selection[0].itemLink.filePath).toSource();
                               bt = new BridgeTalk;
                               bt.target = "photoshop";
                               bt.type = "iterator";
                               bt.body = "{app.open( eval (" + jpgpath + ") );}";
                               //$.write( bt.body  );
                               bt.onResult = function(resObj) {};
                               bt.send();
                               BridgeTalk.bringToFront("photoshop");

  • Securely deploying and using credentials within a script (not running the script under the credentials)

    Here is my scenario - I have SCOM 2007 R2 and on certain agents I want to execute a script. One of the actions of that script is to access a secured web page using a username and password via integrated authentication (IE pop-up for auth).
    The username and password that I need to use are unrelated to the Windows domain that the servers run in, meaning you can think of the website as if it were a public site (it isn't, but it has no security sharing with the domain where the agents run - no trust,
    no nothing).
    I can easily accomplish this by hard-coding the username and password within the script (powershell), however, I don't want to do this for security reasons. Here's a rough example of the relevant code:
    $targetURL = "https://somehost.somewhere.something/filename.zip"
    $path = "c:\downloads\filname.zip"
    $wclient = New-Object System.Net.WebClient
    $wclient.Credentials = New-Object System.Net.Networkcredential($uname, $pword)
    $wclient.DownloadFile( $url, $path )
    What I want is a way to pass the $uname and $pword variables to this script securely, with the script running on a schedule under SCOM. The SCOM agents run as localsystem and need to remain that way.
    I currently use Run-As accounts and profiles for other functions where the entire script runs under the run-as profile, but I can't figure out how to extract the username and passwords, and doubt it's even possible.
    To be clear, I cannot run the script under the given credentials as a Run-As account as those credentials are not known to the local server. I need to somehow pass the credentials to the script (other than hardcoding) or extract them from the run-as accounts.
    I've looked at the get-runasaccount cmdlet and can see some of the info there, but don't see a way to re-use, pass-through, or extract the password for use in my scenario.
    Any guidance? Can I get there from here?

    Hi, check this
    http://social.technet.microsoft.com/Forums/windowsserver/en-US/ebfc706d-93be-4ca0-83e0-33d9e072fb97/powershell-script-monitor-with-encrypted-password?forum=operationsmanagerauthoring
    But you should not specify runas account for your workflow, just reference Runas Username and Password from Profile and use simple authentication. (The same way as in article above)
    So in the end your script will be executed by default action account but you'll pass username and password securely to your script.

  • HT1311 tried to use messages but it does not accept my apple id

    Tried to use messages with get started but it would not accept my apple id

    I'm guessing it needs a password to update your system - that is, the administrator password. Most software needs this when you install it.
    This is the password you (or someone) chose when you first switched on your computer.

  • I have a class where I need to use SmartDraw but it is not compatible with Mac probook what are some other software programs I can use to make floorplans and building plans?

    I am suppose to download SmartDraw to my computer for a class but it is not compatible with Probook is there another program that does the same as SmartDraw?  I am planning a building addition and need it for the floor plans.  Any help would be greatly appreciated.

    There are lots of choices. Just go to the App Store and type in Cad Drawing in the search field. Also Sketchup from Google is a cloud based solution hat works pretty well.

Maybe you are looking for

  • Iphone 5s BIG FAIL

    Hello, i bought a new Iphone 5s . I configured the Fingerprint , to lock my Handy. So if it stolen or something happened noboby can unlock it. But i find the biggest BUG in this System: I testet it with an other Person, which should try to unlock it.

  • R/3(MM) -XI- SUS Scenario Error

    Hello, I'm working on SRM Integration: R/3(MM) to SUS Scenario Whenever i post a PO message to SUS from R/3 (MM module), I see the following error in SXMB_MONI: ERROR: <?xml version="1.0" encoding="UTF-8" standalone="yes" ?><!-- Call Inbound Proxy --

  • Resource bundles and sort order?

    I am wanting to use a resource bundle to store entries that can then be displayed sorted in a combo-box component in an HTML page, though it does not seem to be working out. Basically I am using JSTL and Struts2, and the select component can take var

  • Cost Center Project

    Hi Experts, I went thru the CCA doc but still unclear. Would you send or explain about CC Planning, Distribution, assessment, CC group, hirarchy, different valuation approaches. I already have many t-codes and problums that SDNer had but I would like

  • Nokia 7390 update,HELP!!

    i want to update my firmware to see if i can change it back to the original language, but th current latest version is lower than mine, will it degrade it? also, my phone code is 0534679, will anyone be able to tell me where the phone originated from