TIPS(52) : SQL 내의 문자열 주변에 인용부호를 생성하거나 QUOTES를 만드는 방법

제품 : SQL*PLUS
작성날짜 : 2003-07-28
TIPS(52) : SQL 내의 문자열 주변에 인용부호를 생성하거나 QUOTES를 만드는 방법
==========================================================================
<해결 방법>
1> Single quotation mark를 생성하려면 4 single quote('''')를 사용한다.
(Example)
sql> select '''' from dual;
위의 문장을 실행 시 return되는 결과는 다음과 같다.
2> 문자열 주변에 single quote를 두기 위해서는 3 single quote 안에(''')
문자열을 포함시키면 된다.
(Example)
sql> select '''character string in quotes''' result
from dual;
위의 문장을 실행 시 return되는 결과는 다음과 같다.
RESULT
'CHARACTER STRING IN QUOTES'
3> 참고로, Literal single quote를 생성하기 위해서는 연속적인
single quote mark를 사용하면 된다.
(Example)
srw.do_sql('select decode(dname, ''NONE'', NULL, ''A'')
from dept
where deptno = 10');
위의 문장을 실행 시 return되는 결과는 다음과 같다.
select decode(dname, 'NONE', NULL, 'A')
from dept
where deptno = 10
(Example)
DECLARE
a varchar2(200);
q char(1) := '''';
BEGIN
a := '''this is a ' || q || 'quoted'' string' || q;
END;
위의 문장을 수행 결과 스트링 a에는 'this is a 'quoted' string' 이 저장된다.
Reference Documents
none

Similar Messages

  • Tuning tips for sql

    Can some one tell me the tuning tips for sql statements, please.
    Thanks
    Ajwat

    Yes get EP (explain plan) going and try add /*+ RULE */ hint to your SIUD commands (Select/Insert/Update/Delete) . This changes the optimizer mode from CHOOSE to RULE, I find RULE uses indexes more often than CHOOSE (see example below).
    select /*+ RULE */ c1,c2,c3 from t1 where n1=123
    --[EP 1 results]
    SELECT STATEMENT Optimizer=HINT: RULE
    TABLE ACCESS (BY INDEX ROWID) OF T1
    INDEX (RANGE SCAN) OF I_NU_T1_N1 (NON-UNIQUE)
    select c1,c2,c3 from t1 where n1=123
    --[EP 2 results]
    SELECT STATEMENT Optimizer=CHOOSE (Cost=1 Card=1 Bytes=12)
    TABLE ACCESS (FULL) OF T1 (Cost=1 Card=1 Bytes=12)
    Look for any FULL TABLE SCAN entries in your EP results and try to get rid of them. As the above example shows, switching to RULE uses the index on table T1.
    There are a while pile of other HINTS listed as well (other than just RULE) which are at ...
    http://download-west.oracle.com/otndoc/oracle9i/901_doc/server.901/a87503/hintsref.htm#4894
    There is a whole section on Oracle Performance at the following address...
    http://download-west.oracle.com/otndoc/oracle9i/901_doc/server.901/a87503/toc.htm
    the Hints section is Chapter 5
    There are many more things to tuning tips, but by far, getting your SQL to use indexes is the primary one and you'll have to get EP results to see which indexes are being used (the FREE Toad program shows EP results nicely).
    Hope this helps,
    Tyler

  • PL/SQL: quoting problems (double quotes within PL/SQL, howto?)

    Hello,
    I have a big problem with that: I just cannot use execute immediate to do what I want.
    The goal is that another user than sysdba needs to be able to open/close the wallet (we are sysdba and our client doesn't want us to be able to open the wallet, and we don't want the client to have sysdba), so I take advantage of the fact that procedures are executed by default with the privileges of the user which writes it. So, I try and create a PL/SQL procedure as sys and grant execute rights to the client user.
    To open/close a wallet, the command is:
    alter system set encryption wallet open/close identified by "thepasshere";
    Note the double quotes... They are the problem here (passwords are mixed case and contain special characters). Right now, the only solution I came up with is:
    create or replace procedure open_wallet (passwd in varchar2) is
    begin
    execute immediate 'alter system set encryption wallet open identified by "' || passwd || '";';
    end;
    But that's vulnerable to code injection... So, instead, I tried:
    create or replace procedure open_wallet (passwd in varchar2) is
    cmd varchar2(512);
    begin
    cmd != 'alter system set encryption wallet open identified by ":1"';
    execute immediate cmd using passwd;
    end;
    which yields "ORA-00911: invalid character" - uh?
    Now, if I try:
    create or replace procedure open_wallet (passwd in varchar2) is
    cmd varchar(512);
    begin
    cmd := 'alter system set encryption wallet open identified by :1;';
    execute immediate cmd using passwd;
    end;
    it answers "ORA-28357: password required to open the wallet"
    Aaargh! I see no way around that :(
    Is there a solution at all?

    Did you try including the double quotes in the password bind value? Either when you pass the value in or by adding it in the routine.
    create or replace procedure open_wallet (passwd in varchar2) is
    cmd varchar(512);
    pass varchar(512);
    begin
    cmd := 'alter system set encryption wallet open identified by :1;';
    pass := '"' || passwd || '"';
    execute immediate cmd using pass;
    end;

  • Tip: Placing Straight Quotes without turning off Smart Quotes

    I thought I was alone in this dilemma until I read a recent thread from someone wishing to easily place straight quotes into a document. Prior to this, the quickest way for me to place straight quotes into a document was to copy/paste them from a text editor. Even when you try to add straight quotes using the ASCII code for them, Frame overrides this and replaces them with smart quotes.
    Last week when I was customizing the Frame 9 interface (because it is ungodly poor) I stumbled across the native command for inserting straight quotes regardless whether Smart Quotes is turned on or not. The native command is "CharStraightQuote", but you have a lot of options with how you want to implement it. Because there are so many different ways to implement this, I will describe only the default method.
    There is a flyout toolbar for special symbols. The content of this flyout is controlled from your "menus.cfg" file and is near the top of the file. I believe you can add the following line anywhere within the "menus.cfg" file, but you will find similar entries about 30 lines down from the top of the file.
       <Add CharStraightQuote                <Menu SpecialSymbols>>
    By the way, if you look through your "cmds.cfg" file, especially near this CharStraightQuote entry, you will find a whole bunch of similar entries that are useful and could also be added to your menus.

    To insert the straight quotes directly from the keyboard (overriding Smart Quotes): press Escape, then type quotes.
    (note: no need to hold down the Escape key)
    Shlomo Perets
    MicroType, http://www.microtype.com
    FrameMaker/TCS training & consulting * FM-to-Acrobat TimeSavers/Assistants
    "Improve your FrameMaker Skills" web-based training sessions

  • Escaping sql quotes manually. (replace function)

    I can't get a simple replace to work and am surprised at myself.
    How do I replace every occurrence of either a 'single or "double quote with a backslash+quote (\' or \")?
    (I need it for mysql escaping of selects. Before you jump that prepared statements do it, yes but Jboss-ejb does not, and I don't know how to tell jboss to do so.)
    Anyhow this is a basic Java question, I tried the following to no avail:
    public static String escapeMySqlSelect(String s){
         if ((s.indexOf("\"") >=0) || (s.indexOf("\'") >=0)) {
              s = s.replace("\"","\\\"");
              s = s.replace("\'","\\\'");
              return s;
    }Whatever I try as the second argument for the replace, I get 1 of the following:
    1) Same as original string.
    2) TWO backslashes+quote.
    3) A red-flag from Eclipse with some obscure error message. (Won't compile.)
    Thanks
    -nat

    Further research;
    Jboss automatically escapes the string internally (likely via prepared statement), therefore causing a problem if I also escaped it. BUT, I have yet to figure out exactly when it does so.
    [And this threw me off completely ]There is definetly a BUG in ECLIPSE's (3.1) debugger!
    The 'variables ' panel does not show the true value of the returned string. In other words, a println of the returned string will DIFFER with what the debugger is showing as the value.
    Anyone with Eclipse can try it; with or without j2ee.
    -nat

  • Oracle SQL developer tool vs toad

    Hi - I am trying to do a feature comparison on these 2 tools and am not very familiar with them could someone please tell me if Oracle SQL developer tool has these features:
    Project Manager
    Result Set Compare
    Chart Designer
    Toad Report Wizard
    Pivot & Chart
    Data Compare and Synch
    Automation
    Simple Cross-Platform Queries
    Advanced Cros-Platform Queries
    Local Data Storage
    Data Transformation and Cleansing
    Data Browser
    ER Diagrammer
    Charts & Pivot Table Reports
    Automation & Scheduling Engine
    Data Compare & Sync
    Cross-connection Query

    Hi!
    I have worked with several Oracle IDE's in the past:
    * TOAD
    * PL/SQL Developer
    * Navigator
    * SQL/Developer
    Right now I tend to do most of my work with SQL-Developer and only some tasks with TOAD.
    SQL-Developer feels faster and has a cleaner interface than TOAD, while TOAD has better tools.
    Im currently publishing a series of tips for SQL-Developer in my blog:
    http://oracledeli.wordpress.com/
    Some of the posts are focussing on overcomming SQL-developers disadvantages versus TOAD:
    * SQL-Developer: Using macros http://oracledeli.wordpress.com/2011/09/28/sql-developer_using_macros/
    * Execute current worksheet file via SQL*Plus (external tools) http://oracledeli.wordpress.com/2011/09/23/sql-developer_execute_via_sqlplus/
    Best regards,
    Matt
    Best regards,
    Matt

  • Java sql and Oracle resultsets

    I am trying to execute a query but I never get anything back from the database.
    Do I have to format the date in my sql quoted string to get it to bring back data correctly?
    The sql that I am trying to execute looks like the following.
    sql = "SELECT " + REPORTTRANSDATE + ", " + REPORTCUSTACCTNUM + ", " + REPORTNAME + ", " + REPORTAMOUNT + ", " + REPORTTENDER + ", " + REPORTTRACKINGID + ", " + REPORTRETURNCODE + " FROM " + REPORTTABLE + " WHERE " + REPORTBILLERID + "=?" + " AND " + REPORTTRANSDATE + ">= ?" + " AND " + REPORTTRANSDATE + "<= ?" + " ORDER BY " + REPORTTRANSDATE;
    Prior to executing the query the following date parameters are provided.
    I am using a preparedstatement.
    stmt.setDate(2, new java.sql.Date(sqlFromDate.getTime()));
    stmt.setDate(3, new java.sql.Date(sqlToDate.getTime()));
    The from date looks like this: "07/11/2004 00:00:00"
    The to date looks like this: "07/11/2004 23:59:59"
    The dates are in java.util.Date format to start with and I am trying to get them into java.sql.Date to pass in the values. Is the above date format ok or does it need to look like "11-Jul-2004 00:00:00" for Oracle?
    Thanks for you help.

    Is there anyway to get the resultset to display the
    actual query being run when using ExecuteQuery?
    I am talking about the sql string after the parameters
    have been supplied using the stmt.setTimestamp...
    I would like to be able to see exactly what the
    database is seeing when the query is executed.As far as I know, there is not. However, if you are using oracle, then you can get the exact SQL that is getting executed. I am not sure as to the details (the word sqltrace comes to mind, but I don't know if that is a colloqialism or an actual term). Your friendly Oracle DBA can probably help out more here than I can.
    - N

  • SCOM 2012 - How does SQL MP "know" which instances are available and active?

    Using SCOM 2012 R2 with Microsoft's SQL MP 6.5.1.
    Getting alerts occasionally for issues with SQL instances which are later found to be not active any more or removed from the SQL server.
    Can someone explain how the MP determines which SQL instances are available?  Is it a matter of simply reading folder structures on the various mount points, reading registry?  Much appreciated for any tips.

    SCOM SQL MP will using discovery to discovery SQL instance. Once the SQL instance is discovery, the SQL instance object persist in the database even though the SQL instance is removed.
    Solution:
    To clean up the objects you can run the Remove-SCOMDisabledClassInstance Powershell cmdlet. Then all the relationships that involve objects related to a disabled discovery is deleted.
    Roger

  • "My Day" widget for iCal?

    Hi--
    I'm about ready to give up on Office and switch to iWork, but the one feature that is (perhaps stupidly) holding me back is Entourage's brilliant "My Day" widget:
    <http://www.microsoft.com/mac/products/entourage2008/default.mspx#/my_day/>
    Is there something out there for iCal that will display my upcoming calendar events and undone tasks in a single, concise window? I need something that will "live" at the edge of my screen and won't require me to switch applications to see what's coming next on my calendar....
    Thanks for any tips/recommendations!

    {quote}Entourage's brilliant "My Day" widget{quote}
    Yes, I love it too. There is an app called Today that is pretty much a copy of My Day http://www.macupdate.com/info.php/id/27366/today . The only thing stopping me from buying it is I forbid myself from rewarding copycat developers.

  • *UPDATED 7/15/04* Complete guide to bioses, drivers, and needed files for the MSI K8N Neo Platinum

    Complete newbie's guide to bioses, drivers, and needed files for the MSI K8N Neo Platinum:
    Last Updated: Thursday July 15th, 2004
    Bioses:
    (In order of date released.)
    1.1b3 - (Download)
    - Pre-1.1, given to reviewers to use in their reviews and benchmarks.
    - Less stable, but supposedly you get slightly better overclocks.
    1.1 Official - (Download)
    1. This is AWARD BIOS release
    2. This BIOS fixes the following problems of the previous version:
    - Memory always run DDR 200 when install single side DDR on DIMM2 & DIMM3.
    - Windows 2000 can't format the RAID IDE HDD when plug in Promise 378 controller.
    1.2b5 - (Download)
    1.2b7 - (No Download Yet)
    1.2b10 - (Download)
    - First attempt to fix false temperature readings. Fixes it for some people with Newcastle cores and doesn't fix it for anybody with Clawhammer cores.
    1.2b12 - (Download)
    - Second attempt to fix false temperature readings. Fixes it for some people with Newcastle cores and some people with Clawhammer cores.
    1.3b1 - (Download)
    - Another attempt to fix temperature problems?
    - Possibly fixes cold boot/power light issues?
    1.2 Official - (Download)
    1. This is AWARD BIOS release
    2. This BIOS fixes the following problems of the previous version:
    - System can't resume from S3 sometimes when install USB device.
    - Support K8 Sempron CPU.
    - Turn off keyboard LED in S3.
    --Quick Guide for flashing BIOS, provided by MSI--
    1. Create a MS-DOS boot diskette, then copy the the .exe and the bios file to the floppy disk. Both of these files can be found in the package you downloaded.
    2. Press "Delete" and go to BIOS setup while computer bootup.
    Check BIOS advanced features and see if BIOS flash write control is enabled
    (This option must be enabled. If you can not find this setting, it means the BIOS can be
    flashed.)
    3. Boot from MS-DOS boot diskette and get a:\> prompt.
    4. Type "", then press ENTER
    5. The flash program will then ask "Do you want to save BIOS?", please press "N" for no. The when you see Press 'Y' to program or 'N' to Exit, please press "Y" to continue.
    6. After flashing complete, remove floppy and reset the system .
    7. Press DELETE or F1 when prompted at first reboot after flashing.
    8. Load BIOS optimized defaults, then save settings and exits.
    Drivers & Needed Files:
    (Note: All these drivers are for Windows XP.)
    Leaked Nvidia nForce3 Chipset Drivers Version 4.40
    (Please use at your own risk, these are LEAKED drivers. Password for the .zip file is "ocworkbench rules". Also, you will need to rename the WinXP_2K folder in IDE to either WinXP or Win2K else the installer doesn't pick it up.) Thanks for the link Wonkanoby!
    *NEW* Leaked Nvidia nForce3 Chipset Drivers Version 5.03
    More leaked drivers? Seems some parts of the drivers are older and some are newer.
    1. Windows XP Service Pack 1A (Web Install) -or- Windows XP Service Pack 1A (Full Install)
    2. Microsoft DirectX 9.0b (Web Install) -or- Microsoft DirectX 9.0b (Full Install)
    3. Nvidia nForce3 Chipset Drivers Version 4.24
    4. AMD Athlon 64 Processor Driver Version 1.1.0.14
    5. Nvidia Video Card Driver Version 56.72 -or- Omega Nvidia Video Card Driver Version v1.5303
    (The Omega drivers are third party drivers optimized for gaming, most prefer these over the standard Nvidia drivers.)
    5. ATI Video Card Driver Version 4.7 -or- Omega ATI Video Card Driver Version 2.5.51
    (The Omega drivers are third party drivers optimized for gaming, most prefer these over the standard ATI drivers.)
    6. Onboard Sound Driver (Realtek AC'97 Audio Codec) Version A3.61
    It is HIGHLY reccomended that you install the drivers/needed files in the order listed above. Please note that there are two #5's because you either install one or the other depending on your video card, do not install both of them.
    You will come across a problem here though. You can't install the chipset drivers without installing the Windows service pack and DirectX first, but the Windows service pack and DirectX installs need the internet to download files and you won't have working internet until you install the chipset drivers. Here's what I did to get around this. Instead of downloading the web install versions of Windows service pack and DirectX, download the full version and and put them along with all the other drivers on a backup hard drive or burn them to a CD, this way you will have all the drivers you need when it's time to install them and none of them will require the internet to download files.
    Another note when installing drivers. Apparently the Nvidia chipset drivers also come with drivers for the onboard sound, but people seem to agree that the Realtek onboard sound drivers are better. When you are installing the Nvidia chipset drivers, just be sure to uncheck the box for sound drivers when it asks you which drivers you would like to install. Now you can safely install the Realtek drivers without any chance of conflicting sound drivers. Thanks for the tip Wonkanoby!

    Quote
    Originally posted by RLiu818
    Quote
    Originally posted by Deviation56
    Quote
    Originally posted by RLiu818
    You CAN install the nforce drivers BEFORE installing SP1.  The only requirement to install the nforce drivers is DX9.
    So is SP1 still recommended to install before the nforce drivers?
    The installer still reccomends to install it beforehand for full USB 2.0 functionality... I would have put what you said in there but I wanted to keep it as simple as possible.  
    oh.  IIRC the installer just says USB 2.0 will be fully functional after SP1 is installed.  So after you install SP1 you go into device manager and u click update driver and it will auto search and update the driver.
    Simplicity-wise, i guess its pretty much equal.  It might take less preparation to just copy DX9 full onto a CD and install that first, then nforce driver, then right away you have yoru internet connection.
    but i dunno.. i guess i will try it your way this time when my RMA"d board comes.
    i will be fomratting and doing a fresh install later on today and will let you know if i come across any problems

  • Oracle11i AP positive Pay customized program setting

    Hi
      I need to know how to set up a new customized program for Positive Pay file for payment batch where the checkbox is in actions panel so once it is clicked by the user the program will be triggered
    Thanks

    ISUTri wrote:
    Thank you for your reply Hussein. Those documents don't appear to address the specific problem we seem to be having. Out of the log file that I posted I have been concentrating my search on this error message. Let me know if you have any other tips.
    java.sql.SQLException: ORA-06502: PL/SQL: numeric or value error: character to number conversion error
    ORA-06512: at "APPS.IBY_EXTRACTGEN_PVT", line 380
    ORA-06512: at line 1
    Is there a way I can get additional information that might help me track down what is happening? I have an SR on this but Oracle seems to be as stumped as I am.R12: Troubleshooting Payment Process Request (PPR) Errors: Comprehensive Listing of Errors and Solution Documents [ID 1314118.1]
    IBY_FD_PAYMENT_FORMAT_TEXT Format Payment Instructions Errors with ORA-06502 [ID 1073786.1]
    Thanks,
    Hussein

  • Unreconciled documents at specific date

    Here's the problem: I need to show customer balance at specific date span (let say from BeginningDate to EndingDate). However for beginning balance, I must show all unreconciled documents (invoices, credit memos, incoming and outgoing payments, and direct journal entries) at BeginningDate. How can I do that? I considered using JDT1.IntrnMatch = 0 condition, however, it doesn't work for specific date. Please help. Thank you.

    Hello
    A buil in functionality supports this. Why you would like to create a new?
    open Financials->Financial Reports->Accounting->General Ledger
    Select Business Partner unselect G/L Accounts, enter posting dates required.on Display, select Not Fully Reconciled, and select Co&nsider Reconciliation Date below.
    Run
    This will display the unreconsiled transactions of your customer based on dates entered.
    Tip:
    RUN SQL profiler to get the query executed behind if you would like to built a custom application......
    Regards
    János

  • Change SharePoint_Config Database to simple recovery mode. Risk.

    Hello,
    we have SBS 2008 with Exchnage and OWA-Service.
    The Logfile of SharePoint is very large (30 GB).
    But we don't use SharePoint.
    I want to change the recovery mode of SharePoint_Config Database to simple.
    But i don't know, what of Application/Services/Programms use SharePoint Database.
    What are the risks of changing SharePoint_Config Database to Simple Mode?
    What of the Sevices/Programms  use SharePoint Database ?
    Thank You

    Hi ,
    As Dimitri pointed out, SharePoint DB is in SQL database, the change of it won't affect Exchange and Outlook Web Access.
    If you use SharePoint in future, you may take a look at the following article about the effect to SharePoint database with simple recovery mode.
    http://searchwinit.techtarget.com/tip/How-SQL-Server-recovery-models-impact-your-SharePoint-databases
    Thanks
    Daniel Yang
    TechNet Community Support

  • Create Boot Media/Capture Media - Error -2147217379 (8004101d)

    Hello All,
    I'm trying to regenerate boot media as I've added a new Network driver to my PE environment. Driver added fine, and Boot Image regenerated successfully, on all DP's.
    The problem comes when I try to create updated Capture Media, or Dynamic Boot Media (I would hypothesize standalone boot media would have the same issue).
    It errors out with:
    Media creation failed with error code -2147217379.
    CreateTSMedia.log contains the following relevant lines:
    Creating ISO writer    CreateTsMedia    2/23/2014 4:08:12 PM    12720 (0x31B0)
    MediaGenerator::MediaGenerator()    CreateTsMedia    2/23/2014 4:08:12 PM    12720 (0x31B0)
    Pre-execution package location on media is 'file:VOL001:\SMS\bin\i386'    CreateTsMedia    2/23/2014 4:08:12 PM    12720 (0x31B0)
    Boot image AD1003AE will be staged as normal package.    CreateTsMedia    2/23/2014 4:08:12 PM    12720 (0x31B0)
    StageBaseFiles::SetTsmVariables()    CreateTsMedia    2/23/2014 4:08:12 PM    12720 (0x31B0)
    Client agent branding title for site code X11 is '%Proper Site Title%'    CreateTsMedia    2/23/2014 4:08:13 PM    12720 (0x31B0)
    Query "SELECT Props, PropLists FROM SMS_SCI_Component WHERE SiteCode = 'X11' AND ItemName = 'SMS_SITE_COMPONENT_MANAGER|%SITESERVERFQDN%'" failed    CreateTsMedia    2/23/2014 4:08:13 PM    12720 (0x31B0)
    Error retrieving site component manager settings (0x8004101d)    CreateTsMedia    2/23/2014 4:08:13 PM    12720 (0x31B0)
    MediaGenerator::~MediaGenerator()    CreateTsMedia    2/23/2014 4:08:13 PM    12720 (0x31B0)
    Failed to create media generator (0x8004101d)    CreateTsMedia    2/23/2014 4:08:13 PM    12720 (0x31B0)
    CreateTsMedia failed with error 0x8004101d, details=''    CreateTsMedia    2/23/2014 4:08:13 PM    12720 (0x31B0)
    Media creation process that was started from Admin Console completed.
        CreateTsMedia    2/23/2014 4:08:13 PM    10076 (0x275C)
    CreateMedia.exe finished with error code 8004101d    CreateTsMedia    2/23/2014 4:08:13 PM    10076 (0x275C)
    Note: some info replaced above with obfuscated data,
    I am currently running SCCM 2012 R2 with KB2905002 and KB2910552 applied.
    The last time I generated boot media (capture and dynamic) was shortly after installing 2012R2, and it succeeded without issue. I have not generated boot media since applying both of these hotfixes, as there haven't been any new drivers to add in several
    months. All of my admin consoles have both hotfixes applied, just for giggles, i spun up an admin console with neither hotfix applied, and it gave the same error. I have tried running from remote consoles, as well as locally on the primary site server.
    Does anyone have any suggestions? WMI isn't my strong suit, I tried entering wbemtest, but wasn't really sure what to look for, other than verifying that the class SMS_SCI_Component existed, though I cannot seem to figure out how to query it.
    Thanks in advance for any suggestions/tips,

    The SQL view that Jason referred to is called "vSMS_SC_Component".
    Also, to expand slightly on the WMI "unexpected error", it appears that the necessary WMI information to create the instance(s) of "SMS_SCI_Component" are present.
    Using WBEMTEST, you can connect to "root\sms\site_XXX" and click "Enum Classes..." and select "Recursive". The class for "SMS_SCI_Component" exists. The superclass that it's based on (SMS_SiteControlitem) can also
    be queried to produce the same "unexpected" error. You can see this by selecting "Enum Instances..." in WBEMTEST, selecting "recursive", and entering the superclass name "SMS_SiteControlItem". The results begin displaying
    and then when the query reaches the "SMS_SCI_Component" (presumably, I can't actually see what caused the error in WBEMTEST) it displays the same error number 0x8004101d "Unexpected error".
    Sample output from the SQL query "select * from vSMS_SC_Component":
    ID
    SiteNumber
    SiteCode
    ComponentName
    Name
    Flags
    0
    1
    XXX
    AI_UPDATE_SERVICE_POINT
    AI Update Service Point
    5
    0
    1
    XXX
    SMS_AD_FOREST_DISCOVERY_MANAGER
    HOSTNAME.TLD
    6
    0
    1
    XXX
    SMS_AD_SECURITY_GROUP_DISCOVERY_AGENT
    HOSTNAME.TLD
    6
    0
    1
    XXX
    SMS_AD_SYSTEM_DISCOVERY_AGENT
    HOSTNAME.TLD
    6
    0
    1
    XXX
    SMS_AD_USER_DISCOVERY_AGENT
    HOSTNAME.TLD
    6
    0
    1
    XXX
    SMS_AI_KB_MANAGER
    HOSTNAME.TLD
    6
    0
    1
    XXX
    SMS_ALERT_NOTIFICATION
    HOSTNAME.TLD
    6
    0
    1
    XXX
    SMS_AMT_OPERATION_MANAGER
    SMS AMT Service Point
    5

  • SSIS Job is failing when scheduled.

    Hello,
    I'm getting error when running an ssis package in sql agent Job in sql server 2008. Error message as shown below.
    Message
    Executed as user: ANSWERS\administrator. The process could not be created for step 1 of job 0x71B1306CBCCA6846A4E345640CFAE163 (reason: The system cannot find the file specified).  The step failed.
    Any help would be appreciated ASAP.
    Thanks,
    Vinay

    Hi Vinay,
    According to the error message” The system cannot find the file specified”, it seems that there are some files are invalid or the account has no access to the files.
    Considering you are used excel file in the package, please pay attention to the following tips:
    If SQL Server Agent is 64-bit version, we should run a package in 32-bit mode from in the Job Step dialog box, on the Execution options tab, select Use 32 bit runtime.
    Make sure the script in command line is correct, for example the quotation marks.
    The path of the excel file or other files is valid.
    The path should contains the files.
    SQL Server Agent should has access to the files.
    If the Job is running under a proxy account, then that proxy should has access to the files.
    Restart SQL Server Agent.
    References:
    https://social.msdn.microsoft.com/forums/sqlserver/en-US/76d14c97-ad3e-4c18-9465-cded95c612f7/job-fails-with-the-system-cannot-find-the-file-specified
    https://ask.sqlservercentral.com/questions/108260/unable-to-run-dts-package-from-sql-server-agent-jo.html
    Thanks,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

Maybe you are looking for