Have file name with date working but appending the time to file name can't get a result

DECLARE @dt AS VARCHAR(26)
SELECT @dt = REPLACE(CONVERT(VARCHAR(26),getDate(),110),'-','-'
Have this appended to a filename like: log_01-15-2015.  Don't know what to add to SQL code to get the get the time and append time in hours, min, sec. like:  log_01-15-2015_10:01:33  
DECLARE @dt AS VARCHAR(50)
SELECT @dt = REPLACE(CONVERT(VARCHAR,CURRENT_TIMESTAMP,110),'-','-') +'_'+ CONVERT(VARCHAR,CURRENT_TIMESTAMP,108)
EXEC master.dbo.sp_configure 'show advanced options',1
RECONFIGURE WITH OVERRIDE
EXEC master.dbo.sp_configure 'xp_cmdshell',1
RECONFIGURE WITH OVERRIDE
SET @bcpCommand = 'bcp "SELECT * FROM ##Temp ORDER BY barcode" queryout "C:\TEMP\Log\ContainerHistory_Log_' + @dt +'" -c -T'
EXEC master..xp_cmdshell @bcpCommand
I am trying to append to the file created with the date a time stamp but when appending the time part for the filename results aren't creating the file.  If it's just doing the date part then it is working. Any idea what is wrong? 

Since you added ":" to the file name, the file name is not valid. You can change ":" to "-".
DECLARE @dt AS VARCHAR(50)
SELECT @dt = CONVERT(VARCHAR,CURRENT_TIMESTAMP,110) +'_'+ REPLACE(CONVERT(VARCHAR,CURRENT_TIMESTAMP,108), ':', '-')
SELECT @dt
A Fan of SSIS, SSRS and SSAS

Similar Messages

  • Only one of my earbuds on my bose headphones works with my ipad, iphone and macbook- if I hold them there the right earbud will work, but for the life of me, I can't get them to both work. Why is this? And is Apple doing anything about this?

    Only one of my earbuds on my bose headphones works with my ipad, iphone and macbook- if I hold them there the right earbud will work, but for the life of me, I can't get them to both work. Why is this? And is Apple doing anything about this? While Apple's headphones have (finally) admittedly gotten better of late, I still prefer the much more comfortable headphones & sound quality that Bose makes and that I spent the money for.

    Bose Product Support

  • HT1727 i bought some ringtones on my iPhone, later on i sync my iphone to my old computer now i have a new mac pro desktop and i only have 2 ringtones on my phone but not the rest of them how can i get them back without having to pay for them again?

    i bought some ringtones on my iPhone, later on i sync my iphone to my old computer now i have a new mac pro desktop and i only have 2 ringtones on my phone but not the rest of them how can i get them back without having to pay for them again?

    If you bought them on your iPad then you will need to connect your iPad to your computer's iTunes and do File > Devices > Transfer Purchases to copy them over to the Tones part of your computer's iTunes library and you can then sync them to your iPhone - ringtones are a one-time only download, so you won't be able to redownload them directly on your phone.

  • I have a 4s with ios 6 but when I place a call I can't hear the person I' m calling, the volume is high but it's not working. Please help.

    I have a 4s with ios 6 but when I place a call I can't hear the person I' m calling, the volume is high but it's not working. Please help.

    I have taken it back to the Apple store genius bar, but they say they don't see anything wrong. Well unless you use it all day and experience the problems when they happen, you wont see anything wrong. But there are lots wrong with it. But this would be the same store as I purchased the phone. And they backed up my old Iphone 4, but were not able to get anything to load back onto my new phone. So, I lost pretty much everything. But over time, some of my contacts have started showing up, although i am still missing over 800 of them.

  • Hye, i bought my iphone5s in malaysia on early febuary 2014 but on april/may i have problem with my fhone. but now i resides in istanbul turkey. can i get a a service from apple.tr ? how ? thank you

    Hye, i bought my iphone5s in malaysia on early febuary 2014 but on april/may i have problem with my fhone. but now i resides in istanbul turkey. can i get a a service from apple.tr ? how ? thank you

    It can only be serviced in the country where it was originally sold.
    An iPhone sold in an EU member State can be serviced in any other EU member nation. Malaysia is NOT a member of the EU. It can only be serviced in Malaysia.

  • I have an I phone 3g and I downloaded the newest software and I can't get any music to play.  I can't change my playlists and the songs I have on the phone just get skipped over.  What can I do to correct this?

    I have an I phone 3g and I downloaded the newest software and I can't get any music to play.  I can't change my playlists and the songs I have on the phone just get skipped over.  What can I do to correct this?

    it recognizes the iPOD but I can't get any of the new songs to import to the iPOD
    are you getting an error message, Odessa? if so, what does it say? include error message numbers if you're getting any.
    if you're not getting an error message, describe what happens when you try to transfer songs to the ipod as best you can.

  • Did i buy Adobe Photoshop & Adobe premiere elments but uTrshed  the box before instalation how can i get the serial number?

    did i buy Adobe Photoshop & Adobe premiere elments but uTrshed the box before instalation how can i get the serial number?

    I suggest that you Contact Customer Care - click on the Still need help? button to chat with an agent.

  • HT2240 i already bought a quicktime pro version but lost the key some how. how can i get back that key, without buying a new one?

    i already bought a quicktime pro version but lost the key some how. how can i get back that key, without buying a new one?

    thank you Malcolm J. Rayfield for your replay. but this didn't help, because i bought the "pro" bevore that.

  • File Access with unsigned Applet through editing the java.policy file

    I'am starting to lose my hair on this...
    I am trying to get an applet to run so that it can access the file system to move files on my local maschin. Because this applet is only running on my VM i can change the java.policy to avoid the signing of the applet.
    first of all, if i wrote in the java.policy file
    grant {
      permission java.security.AllPermission; 
    };everything is working perfekt.
    But I have not the intention to open the gates for any applet out there, so i want to limit the access to my applet. With every of the following versions I get at best an
    java.security.AccessControlException: access denied (java.io.FilePermission...
    My Setup
    My Java Version: jre1.6.0_02
    My applet is located unter the url
    http://admin.mydomain.com/applet.jar
    In Html i tryed the following different versions of loading the applet - none worked
    <applet codebase="http://admin.mydomain.com/" name="shortcut" code="start.class" archive="applet.jar" width="0" height="0"></applet>
    <applet codebase="http://admin.mydomain.com" name="shortcut" code="start.class" archive="applet.jar" width="0" height="0"></applet>
    <applet name="shortcut" code="start.class" archive="http://admin.mydomain.com/applet.jar" width="0" height="0"></applet>in java.policy i tryed following versions with every html applet load version
    grant codeBase "http://admin.x-press.de/-" {
      permission java.security.AllPermission; 
    grant codeBase "http://admin.x-press.de/+" {
      permission java.security.AllPermission; 
    grant codeBase "http://admin.x-press.de/applet.jar" {
      permission java.security.AllPermission; 
    };why is it with
    grant {
      permission java.security.AllPermission; 
    };working, and not with the other versions?
    i am almost bold now, please try to save my last hair from falling down.
    any suggestion would be nice
    thanks, feyyaz
    Message was edited by:
    feyyazdogu

    I read the mentioned documentation and your right, some of my versions were wrong, but after reading the doumentation again i came to following result which should had worked but didn't.
    java.policy
    grant codeBase "http://admin.mydomain.com/*" {
      permission java.security.AllPermission;
    HTML File
    <applet codebase="http://admin.mydomain.com/" name="shortcut" code="start.class" archive="applet.jar" height="0" width="0"></applet>if I am entering http://admin.mydomain.com/applet.jar i can download the jar, so the archive lays in the correct directory.
    what i am doing wrong? do i have to change an additional file somewhere else?

  • Prores files not recognized... most of the time [message -- file '[file name].mov' cannot be imported – this 'MooV' file is damaged or unsupported.]

    Running AE CC 13.2 on iMac with Yosemite 10.10.2
    I just started getting an error message when trying to import any number of ProRes 422 (HQ) files.
    file ‘[file name].mov’ cannot be imported – this ‘MooV’ file is damaged or unsupported.
    This happens approximately 90% of the time. There have been occasions where I can open and view files of this type.
    I have gone through the various troubleshooting options here:
    http://blogs.adobe.com/aftereffects/2013/08/solutions-for-problems-with-quicktime-files-in -after-effects-cc-12-0-because-of-conflict-with-dvcprohdvideoout-quicktime-component.html
    I reinstalled ProApps to no avail.
    Permissions are fine.
    Creative Cloud recently updated AE over the past few days. Perhaps this incremental update fouled something up? Last weekend, things worked perfectly fine.
    I have also noticed that it takes a lot longer to load AE (since using last weekend). I have used Time Machine to roll the application back to last week's version to see if that helps.
    Any insight is appreciated.

    The update last week was just to Adobe Camera RAW and not really AE. It would be unlikely to cause the issues you describe. Have you tried turning your Mac all the way off and then back on again?

  • Trying to use system instrument but its telling I have to download, I click ok but APP store says no updates, how can I get these instruments and/or effects?

    So I'm new to Garage band and I know I can use my computer keyboard as a midi interface for some instruments, i.e. drums. However I notice that when I click on some instruments like horns or guitar a pop up opens that says I need to download them at about 1.2 GB of free storage. I click on ok to start the download and the app store pops up but after loading it tells me there are no updates available. Could it be possibly bc I am using the GB that came on the computer and not the paid app or is it just me not doing somehting right? Not sure what else to do and I want these instruments to fool around with and create awesome music...any help would be appreciated.
    Mahalo!

    You should be able to download and use the additional loops without a problem, but it works not always smoothly. And there have been different fixes that worked for different people. See this long thread if something will work in your case:
    GarageBand '11 won't download additional loops: https://discussions.apple.com/message/15137750#15137750
    Sometimes you simply need to reload the "Updates" tab of the AppStore using ⌘R after signing in with your AppleID and starting the download.

  • I have a subscription for Captivate 7 but also need Captivate 6.  How can I get older versions?

    I have an opportunity to do some work for a company that is using Captivate 6 but I'm using Captivate 7.  As we all know, the software isn't backwards compatible, so all my CP7 project files do not work as expected when opened by a CP6 user.  How can I get Captivate 6, too?  I can run one version on my MAC and the other on my PC, so that shouldn't be a problem. 

    That's what I was afraid of. 

  • I have a brand new IPhone 4G.  For the life of me, I can't get the phone to ring. I have been in and out of my settings, have disengaged both silent and vibrate.  But when dialing my number from another phone, the call goes direclty into my voice mail

    I have a brand new IPhone 4G.  I can't get it to ring.  I have gone into settings and disengaged vibrate, and have engaged the ring button on side of phone.  But everytime I dial my number from a different phone, it doesn't ring. Rather the call goes directly into my voice mailbox (ogm heard immediately); not even one ring! Please advise

    Well, if it goes to VM immediately the call isn't reaching your phone, so no wonder it isn't ringing. Do you see a network displayed in the upper left of the screen? Have you activated the phone by connecting to a computer with the latest version of iTunes? Have you called your carrier to make sure they have provisioned it correctly?

  • My iPhone 5 has been freezing up and my lock (top) button doesn't work 50% of the time..Am i able to get a replacement free of charge?

    I pre-orded the iPhone 5 and got it a week after they came out and every since I have been having problems with the lock button. It seems to only work the first time I push it 50% of the time. On top of that, my phone keeps freezing and I don't know what to do. Am I still eligible under warranty to get a replacement??

    If it is defective and your within your warranty period then they should replace it. But , have you went trhough all the trouble shooting steps such as,
    1)restart your phone
    2)reset your phone by holding down the home and off button until the apple symbol comes up
    3)restore your phone in itunes from your backup, then if still not fixed, restore as new

  • Tried to update iPhone 4 with iOS7, now it is frozen with an iTunes icon and the recharger icon. I can't get into anything.  Restarting hasn't helped

    I tried to update my iPhone 4 with the new Apple iOS7.  Now my phone is locked with an iTunes icon and my recharger icon.  I can't turn it on or get into anything.  I can't even receive calls on my phone.  HELP!

    Same thing happend to my Girlfriend, you will have to connect to the computer and snyc with iTunes. Make sure you update your iTunes software. we had to click on "Restore iphone...". phone updated and she lost everything on phone , we then tried to get everything back and only thing we got was her apps . Good luck hope everything turns out better then us. .

Maybe you are looking for

  • How do I find the file size of my presentation in keynote for iPad?

    I know this is a simple question, and I have a work around by just emailing the file to me, but I want to know how I can see the file size as I work on the file within keynote.....on the iPad. Thanks

  • Custom infotype field data in Rem. Statement

    Hi, I am trying to display a date in the Rem statement from a field in custom infotype.Have given the table and the field and pulled the same into the Remu. statement with conversion being Date formatting.But the date is not reflecting in the slip. R

  • 9.0.3 Bug - getServletContextName returns incorrect value

    getServletContextName is returning "current-workspace-app" even though I have set the J2EE Web Context Root to something else, e.g. "mywebapp". Running the app does in fact load the correct URL, with "mywebapp", but all the links that are built using

  • Capturing non-drop-frame as drop-frame??

    I have to capture a bunch of amateur tapes shot with various cameras. Ultimate destination is NTSC DV. I have a sense that if I capture the non-drop-frame in a standard NTSC DV setup that I might have some buggy problems. Or at least the batch captur

  • Frank session expiration sample - Does it work with a Custom JAAS Module ?

    I configured the sample as described in "Detecting and handling user session expiry" - http://thepeninsulasedge.com/frank_nimphius/2007/08/22/adf-faces-detecting-and-handling-user-session-expiry/ I also have a custom database JAAS login module as des