Write-datatable - does it finish writing before it returns? (SP run after doesn't seem to see the data)

I'm trying to load data then run a stored procedure when it finishes.  So my code looks like:
(using runspaces, fwiw, but this is within the same runspace)
    Write-DataTable -ServerInstance $server_repository -Database $database_repository -TableName myinsert -Data $LogResults
    invoke-sqlcmd2 -serverinstance $server_repository -database $database_repository `
    -query "EXEC myinsert_Blacklist_Removal @ComputerName = '$computername', @EventLog = '$eventlog'"
My blacklist code deletes from the table, inserts remaining records into the master table, then deletes from the staging table.  Further complicating matters is the use of full-text, which speeds up the delete based off the blacklist.
However, I'm seeing where the data isn't touched.  So I added this to the beginning of the stored procedure:
SELECT @max_recordnumber = MAX(RecordNumber)
FROM myinsert
WHERE eventlog = @EventLog
AND ComputerName = @ComputerName
INSERT INTO myinsert_Blacklist_Calls (computername, eventlog, max_recordnumber) VALUES (@ComputerName, @EventLog, @max_recordnumber)
And to my surprise, I have NULLs for the max_recordnumber, even though I can see the record in the staging table.
Which means, I think, that stored procedure is called before the BulkInsert is finished.  Which makes no sense. Maybe it hasn't finished committing from disk before the SP runs?  *shrug*  I'm really stumped and it's torking me off good.
Any help greatly appreciated.
Michael

What bulk insert?
You need to post issues with SQL in the SQLServer forum.  None of this is done by Powershell so it is not a scripting issue.
\_(ツ)_/

Similar Messages

  • FCP X does not recognize projects and events on USB drive after a time machine restore of the MBP macintosh disk

    FCP X does not recognize projects and events on USB drive after a time machine restore of the MBP macintosh disk.
    I upgraded from an i5 to an i7 15" MBP and restored my files using my time machine backup. All seemed to go ok, except I had to use the migration assistant because on the initial boot the MAC didn't recognize the backup database on the USB device. MAybe this is a hint.
    Since when I start FCPX it too cannot finnd the project or event directories.
    Before my upgrade, I had a choice of files either on the Macintosh disk or the 2TB USB disk.
    Now only files on the Macintosh are accessible to FCPX. The USB drive is visible under events and project but it finds no projects or events.
    Please help if you can.
    Thanks
    Barry

    Thanks... alas no one has responded.
    I think I have the structure that you are recommending.
    I have a root level directory (Final Cut Events) with the files in them.
    The puzzling thing is that it used to work before the migration!.
    Anyway I'm going to move the contents to the root and see what happens.
    On a slightly different note...
    I also posted a question about CPU utilization. Can I ask a question or two?
    While rendering a short clip, I noticed burst of disk activity when the render started (likely loading the media files into ram since I have about 4Gigs available, then almost no activity while the render is happening, then more disk activity when its done.
    However the cpu activity is not as high as I would have expected since rendering requires a lot of cpu.
    What is your experience? I know some render is done by the GPU, but in my older i5 the CPU was about 100%, now in my i7 its about 50%.
    Please look at the attached utilization for CPU and disk activity.
    Thanks for any thoughts... Barry

  • I'm in cycle mode, and 'merge' is clicked in preferences. However, when I record, my previous track data keeps getting overwritten. Does anyone know what I'm doing wrong. Interestingly, I can still see the data in the region.

    I'm in cycle mode, and 'merge' is clicked in preferences. However, when I record, my previous track data keeps getting overwritten. Does anyone know what I'm doing wrong. Interestingly, I can still see the data in the region.

    jamestait wrote:
    when I record, my previous track data keeps getting overwritten.
    since you didn't specify, are you recording in a single take?
    http://www.bulletsandbones.com/GB/GBFAQ.html#multipassrecording
    (Let the page FULLY load. The link to your answer is at the top of your screen)

  • My mac Doesn't seem to see my external hard drive (seagate 1tb) I have it usb'd in to the back of my computer, but when I open time machine...it does not see it. Help

    My mac Doesn't seem to see my external hard drive (seagate 1tb) I have it usb'd in to the back of my computer, but when I open time machine...it does not see it. Help...please

    Yes...at least I thought it was....I have 10.6.8.
    That's the whole issue. I want to run/install photoshop elements but I have to have 10.8. for that. So...be fore I install an upgrade (Yosemite is getting BAD press) I thought I'd check my back up...it's not there...I have the seagate plugged in and the usb into the back of the mac...when I try to turn the time machine "ON" it says airport device not found not ....
    By the way...I REALLY appreciate the help here....

  • My preferences are set to 'show informational overlay' but when I scroll through events I do not see the date as I'm supposed to. I only see the date underneath the event. What am i doing wrong?

    I so not see the date as I scroll through my events and I have my preferences set to 'show informational overlay'. They only date I see is below the event. What am I doing wrong?

    Make a temporary, backup copy (if you don't already have a backup copy) of the library and try the following:
    1 - delete the iPhoto preference file, com.apple.iPhoto.plist, that resides in your
         User/Home()/Library/ Preferences folder.
    2 - delete iPhoto's cache file, Cache.db, that is located in your
         User/Home()/Library/Caches/com.apple.iPhoto folder. 
    Click to view full size
    3 - launch iPhoto and try again.
    NOTE: If you're moved your library from its default location in your Home/Pictures folder you will have to point iPhoto to its new location when you next open iPhoto by holding down the Option key when launching iPhoto.  You'll also have to reset the iPhoto's various preferences.
    OT

  • Why does Firefox automatically install it's latest update, even after I've spent months clicking the 'no' button whenever I've been asked to update?

    For months Firefox has been providing me with a little dialogue box asking whether I want to update to the latest version. This has been annoying, but each time I have politely clicked the button saying that 'no, I do not wish to update at this time', allowing me to get on with my day using my preferred version of Firefox. However, just moments ago when I most recently opened my Firefox browser, a simple look at the tabs told me that Firefox had updated itself without my permission (something which has happened in the past and really ticks me off). Whenever this problem has presented itself to me in the past, however, I have simply been able to go onto the Firefox website and download my old version. When I tried doing that this time around however, I somehow keep getting stuck with the latest version, which is extremely rankling and the sole reason for my complaint. If Firefox would just stop inviting it's new versions onto my computer whenever it felt like it, I wouldn't be seriously inconvenienced whenever I felt like browsing the internet. It also seems to be harder to find the old versions of Firefox than it used to be, as I am having a devil of a time trying to find my old version (though that may just be me). Frankly, if Firefox would just stop automatically updating itself, it would save me a lot of unnecessary stress and hassle.

    if i have to read any comment by matt n again i will throw up...in my mouth. i have gone all over google trying to figure out what the f ff did to me without my permission, i have updates turned off so there should be no prompting to restart, there should be a polite offer not a forced update. i am angry and so are a ton of people.
    everytime i go to a new complaint, another angry fellow ff user there is matt n with his infuriating smiling little picture...telling me about the awesome safety and security of the new ff...ignoring that a supposed safe but ugly and unusable browser is worse than a customized, beautiful, well functioning browser...with supposed safety issues. i am so angry i cannot express how this has wasted my time. i have been online for 2 hours now figuring out how to fix, apparently i cannot. my old theme is not compatible now...so i am screwed.
    good bye. if i wanted chrome i would have had chrome. but i have no choice now.

  • I can only get Firefox to start if I restore my system to an earlier date (the previous day for instance). If I just close down Firefox I cannot sart it up agian without a system restore -- yet it does not show as a task which is running after I click ont

    Restored machine. Opened Firefox - all is well.
    2. Closed Firefox. 3. Clicked on Firefocx shortcut - no Firefox ran. 4 Clicked on Firefox in program list - no Firefox ran.
    5. Restored to the previous restore point; clicked on Firefox shortcut - Firefox ran.
    == This happened ==
    Every time Firefox opened
    == a month ago.

    Thank you for your help Nattgew.
    Boinc is already running in the background as a service. There is no need to run "boinc" on the command line. The error you see is because it is trying to start Boinc again from the command line, but the service is already running and has claimed the port 31416.
    I know, it was in order to give all the possible feedback.
    I'm not sure why boincmgr won't connect... could you be more specific about what happens when you run it?
    No, I can't be more specific than I've already been above. I've described all that I see that happens.
    Other than that, the wiki tells you where to look at the log file (make sure there are no errors there) and explains the password for connecting (sounds like you already took care of that, but good to double check).
    As you can see I've searched all the errors I got in the boinc wiki. I know what they mean, but not why are happening.
    I think my problems come from a bad management of the files permissions by the package installation. I mean, when a package is installed there should be an script or something that modifies (or create the files with) the permissions that files must have, or create the groups that need to be created, and so on. But it looks like I have to modify all this data in order to get boincmngr connect to boinc, boinc and boincmngr get the writting permissions in the installation folder too, etc etc etc. I don't know very well how to do all this stuff (I mean that I've already created by hand the boinc group, changed the execution, access, modification of files with users and boinc groups credentials, and I still get silly errors as "boinc can't write" in a folder which is the owner, or can't write executed by the root. All this stuff messed me up because looks too much stupid), but more important, I shouldn't to do it manually after a package installation.
    I should open a bug report in arhlinux first and if they can't solve the problem open it in the boinc support, I suppose.

  • Before I buy, will I see the date on photos in sorter?

    I'm looking for the right App to make movie / video  files from a photoshow.  I'm interested in iMovie but am concerned that I won't see the date stamp on my photo files like in the iPad photo albums.  I find this very annoying in the Photo app.  You can't sort or anything.  Will I see the date stamp of when the photo was taken if I download a photo to my iPad?  So I can sequence my pictures for a video?
    When I say date stamp, I don't mean a the date and time right on the photo.  I just want to know when the photo was taken and be able to sort a group of photos based on date taken.

    Photos are sorted by date and time, but the date and time is not shown in the app.

  • When trying to statup with install disc inserted,all i get is an apple logo.when i try starting using command v it seems to see the cpu,but does not list any drivers.any thoughts appreciated!

    when trying to startup with install disc inserted,all i get is an apple logo.when using command v keys,it seems to see the cpu, but doesn't list any drivers.any idea what,s wrong?

    That is the wrong system disc, the Mid 2007 Mac Mini's originally came with Tiger 10.4. You must have been sent the wrong disc, because that gray 10.6 system disc is obviously for a later Mac.
    Mac mini (Mid 2007) - Technical Specifications
    At this point I'm afraid that your options are very limited.
    1. Call Apple, have your serial # handy and ask for a replacement Tiger disc set. Problem is that it wouldn't be of much use, except for maybe running the Apple Hardware Test.
    Apple - Support - iMac - Service FAQ
    2. Purchase a Retail Snow Leopard Upgrade disc.
    Mac OS X 10.6 Snow Leopard - Apple Store (U.S.)
    As for the RAM, if 2GB is shown in both Apple / About This Mac and in the Activity Monitor then there is a pretty good chance that's it OK. Of course it is hard to test without the original disc set and in your case may need to be done with a third party RAM checker like Memtest OS X

  • Ü Character being replaced ? when writing the data to CSV from DB in Linux

    Hi All,
    Can anyone help me in understanding the exact cause of my issue
    Issue Description: Ü Character being replaced ? or when writing the data to CSV from DB in Linux.
    Shell used: ksh
    Actual string: MÜNCHENER RÜCKVERSICHERUNGS-GESELLSCHAFT AG
    Output String: M?NCHENER R?CKVERSICHERUNGS-GESELLSCHAFT AG
    locale ouput:
    LANG=en_US.UTF-8
    LC_CTYPE="en_US.UTF-8"
    LC_NUMERIC="en_US.UTF-8"
    LC_TIME="en_US.UTF-8"
    LC_COLLATE="en_US.UTF-8"
    LC_MONETARY="en_US.UTF-8"
    LC_MESSAGES="en_US.UTF-8"
    LC_PAPER="en_US.UTF-8"
    LC_NAME="en_US.UTF-8"
    LC_ADDRESS="en_US.UTF-8"
    LC_TELEPHONE="en_US.UTF-8"
    LC_MEASUREMENT="en_US.UTF-8"
    LC_IDENTIFICATION="en_US.UTF-8"
    LC_ALL=
    Environment variable set: NLS_LANG=AMERICAN_AMERICA.WE8ISO8859P1
    Linux Version: 2.6.18-128.el5 128 bit
    java Version: 1.6
    Oracle DB version: Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bi
    When i query directly from DB i get the data in right format but when i write the same data to a csv file then the above problem occurs.
    Can anyone please suggest me what could be the cause for this issue?
    Regards,
    Shiva

    Hi Srini,
    We are using Java based ETL specifically written for our application. we are using sqlplus to make DB connections. am using vi editor to see the data. After the Extraction process the data processed in also in the wrong format.
    Regards,
    Shiva

  • HT204384 why does my 16gb SDHC card reads as full, but I can't see the files

    I have a SanDisk 30mb/s 16GB SDHC card used with a GoPro HD Hero. When I plug it into my card reader, it DOES show up on my desktop. When I double-click on it, I see the folders, but no files. I know the card is full, and it shows up as full when I press "command i".
    How can I get these files?!?

    I just wasn't sure I should put down the actual IP address.
    You made the right choice, and is what I guessed was the case. But I've learned to confirm my assumptions; I've been surprised before.
    Anyway, hope you get somewhere with your IT folks. If you approach them from the standpoint that you can't ping the server and avoid, at least initially, the "can't mount the server volume" issue, you may have better luck with them. If you can get them to help you to the point where you get a ping through successfully, you may find the other problems go away.
    One note: it is possible that they've blocked the ability to ping their network devices, so the failure of the ping isn't completely diagnostic. But it's certainly a symptom to bring up with them; if they are blocking ping, they should tell you that.
    Good luck.

  • I have a new time capsule (replace my old time capsule).  I want to erase my old one.  My computer does not see the old one anymore, how do I connect it (the old TC is not connected to modem)

    I have a new time capsule (replace my old time capsule).  I want to erase my old one.  My computer does not see the old one anymore, how do I connect it (the old TC is not connected to modem).  I want to erase it and then use it as either a second hard drive (sired/sirelesly?) or as a hard drive/bridge.  So,
    1.  why doesn't my cmputer see the old TC
    2  once i have solved that, how do I erase the old one
    3.  Can I use the old one as a supplemental hard drive
         a.  wired?
         b. wirelessly?
    4.  Can I use the old one as a range extender?
    I know .. a lot of questions but I would appreciate any help.
    Thanks

    sgetraer wrote:
    I have a new time capsule (replace my old time capsule).  I want to erase my old one.  My computer does not see the old one anymore, how do I connect it (the old TC is not connected to modem).  I want to erase it and then use it as either a second hard drive (sired/sirelesly?) or as a hard drive/bridge.  So,
    1.  why doesn't my cmputer see the old TC
    2  once i have solved that, how do I erase the old one
    3.  Can I use the old one as a supplemental hard drive
         a.  wired?
         b. wirelessly?
    4.  Can I use the old one as a range extender?
    I know .. a lot of questions but I would appreciate any help.
    Thanks
    1. Because it is either the same IP as the new one or hidden by being plugged in as a second router.
    To access it, isolate one computer from the existing network and plug it directly by ethernet to a lan port of the TC. Use the erase function in the TC to remove all the content of the hard disk.
    Then go to the internet tab, connection sharing and select off bridged. You can then reconnect the TC to the network.. and the computer as well. The TC will act as bridged device.. getting IP from the main router and should then appear correctly in Airport utility.
    2. I covered in 1. But you just go in airport utility manual setup. disk, and you will see the erase function. You can also set it to bridge and leave the erase until you put it back in the network.. but be careful you erase the right one.
    3. You can use the old TC via wired or wireless.. although I would always stick to wired connection if possible. Speed on wireless is 10x worse than wired.
    Also note the reliability goes down dramatically after 2 years.. a series 1 3 years old or more is ebay fodder unless you want to repair it. Do not trust vital data to it.. when it dies you will have issues recovering it.
    4. Yes, all apple routers will function as wireless extenders. when you do that the ethernet ports turn off so it becomes a purely wireless device.. strange apple decision on what you want to use your TC for.

  • Deleting the date before time in a column

    Hi guys, I am currently cleaning up alot of data and have come across a problem. I have a starting_time field of date datatype which is suppose to contain a list of times such as 23:30:00 or 10:45:00 etc. My issue is that all the times in this field seem to be prefixed with a date such as 30/12/1899 (thus look like 30/12/1899 10:45:00) all times are prefixed with this and I was wondering if there is an easy way to delete this date from every record so that it leaves only the time section?
    Thanks for any help I may get.

    user13390506 wrote:
    Hi guys, I am currently cleaning up alot of data and have come across a problem. I have a starting_time field of date datatype which is suppose to contain a list of times such as 23:30:00 or 10:45:00 etc. My issue is that all the times in this field seem to be prefixed with a date such as 30/12/1899 (thus look like 30/12/1899 10:45:00) all times are prefixed with this and I was wondering if there is an easy way to delete this date from every record so that it leaves only the time section?
    Thanks for any help I may get.WHY?
    If you don't want to see the date portion, then do NOT display it.
    It does not impact anything as it exists now.
    I bet you that new records will contain the same so do you plan or mucking with this data daily from now on?

  • How do you remove the date/time stamp from a photo before printing?

    I have one group of photos in an event that have the date and time stamp on them.  I don't know how to remove the date/time stamp before printing. 

    If you have your camera set to imprint the date/time on the photo you can not "remove it - it is a part of the photo - depending on the surounding photo you might be able to retouch it out
    LN

  • After upgrading to OS Mavericks, I realized that the Partition for Windows is gone. I have really important data on this drive without a back up. Is there any way I can get this data before reformatting. Is there any third party software for receiving the

    After upgrading to OS Mavericks, I realized that the Partition for Windows is gone. I have really important data on this drive without a back up. Is there any way I can get this data before reformatting. Is there any third party software for receiving the data or any possible way? Money is not a limitation to this fix. Please help!!!

    sure pretty simple.  make a backup of your current settings
    http://support.apple.com/kb/HT1766?viewlocale=en_US
    then restore device from old backup you need pics off of
    then import pics to computer
    http://support.apple.com/kb/HT4083
    you may need to save pics to camera roll first
    then restore the new backup and sync pics back to phone via itunes
    Peace, Clyde

Maybe you are looking for

  • ORA-00911: invalid character using multiple select statements

    I am getting an ORA-00911: invalid character error when trying to execute 2 select statements using ODP.NET. cmd.CommandText = "select sysdate from dual;select sysdate from dual;"; cmd.Connection = conn; cmd.CommandType = System.Data.CommandType.Text

  • I was listening to a station on iTunes radio and now my library is empty. Does anyone know how I can fix this?

    I was done listening so I closed iTunes and eventually I shut off my computer. But the next time I turned it on and opened iTunes my entire library was empty, and the playlists were set to the system default. I tried doing a system restore to my lapt

  • File Download in JSP, Please help

    I am wondering if somebody can help me with a problem : I am trying to register a fact that somebody has downloaded a file from my company's website. When a user clicks on the link I provided, a message box came up to prompt user with the location to

  • Support for multiple struts modules in NitroX

    I have a struts application with multiple modules, however, NitroX won't fully recognize the second module. I created this module though Struts' "Create new Struts module...", the module works fine in tomcat, I'm able to edit the config files with Ni

  • Seeking helping sending hi res photos with iPhone 4S

    I have an iPhone 4S and am having trouble sending hi res files as e-mail attachments. I haven't changed anything in my settings nor can find anything related. Any help anyone has to offer would be greatly appreciated. Thanks!