Why am I getting "There is already an object named '#TempTable...' in the database." within my SQL Server IF Statement

The creation of My #TempTable is based on my input Parameter and I am getting "There is already an object named '#TempTable_Service_X_Claims' in the database." Why???
USE [Report]
GO
DECLARE @ProviderType CHAR(1)
SET @ProviderType = 'G'
IF Object_ID('TempDB..#TempTable_Service_X_Claims') IS NOT NULL DROP TABLE [#TempTable_Service_X_Claims]
IF @ProviderType = 'I'
BEGIN
SELECT...
INTO [#TempTable_Service_X_Claims]
FROM [dbo].[service_x]
LEFT JOIN [dbo].[affiliation]
ON [affiliation].[AFF_NBR] = [service_x].[AFF_NBR]
AND [affiliation].[PROV_NBR] = [service_x].[Prov_Nbr]
AND [affiliation].[VOID] = ''
AND [affiliation].[c_ymdeff] <= [service_x].[C_EFF_DATE]
AND [affiliation].[c_ymdend] >= [service_x].[C_EFF_DATE]
WHERE [service_x].[C_EFF_DATE] >= '1/1/2013'
AND [service_x].[C_EFF_DATE] <= '12/31/2013' --AND [affiliation].[PRAC_NBR] = @PracticeNbr
AND [affiliation].[PRAC_NBR] = 'F330'
END
-- THEREFORE, USE THIS QUERY FOR "G" GROUP SELECTION SINCE IT USES [NPI]
IF @ProviderType = 'G'
BEGIN
SELECT...
INTO [#TempTable_Service_X_Claims]
FROM [dbo].[service_x]
LEFT JOIN [dbo].[affiliation]
ON [affiliation].[AFF_NBR] = [service_x].[AFF_NBR]
AND [affiliation].[PROV_NBR] = [service_x].[Prov_Nbr]
AND [affiliation].[VOID] = ''
AND [affiliation].[c_ymdeff] <= [service_x].[C_EFF_DATE]
AND [affiliation].[c_ymdend] >= [service_x].[C_EFF_DATE]
WHERE [service_x].[C_EFF_DATE] >= '1/1/2013'
AND [service_x].[C_EFF_DATE] <= '12/31/2013'
AND [affiliation].[NPI] = '1700947884 '
END
Thanks in advance for your review and am hopeful for a reply.
PSULionRP

The creation of My #TempTable is based on my input Parameter and I am getting "There is already an object named '#TempTable_Service_X_Claims' in the database." Why???
USE [Report]
GO
DECLARE @ProviderType CHAR(1)
SET @ProviderType = 'G'
IF Object_ID('TempDB..#TempTable_Service_X_Claims') IS NOT NULL DROP TABLE [#TempTable_Service_X_Claims]
IF @ProviderType = 'I'
BEGIN
SELECT...
INTO [#TempTable_Service_X_Claims]
FROM [dbo].[service_x]
LEFT JOIN [dbo].[affiliation]
ON [affiliation].[AFF_NBR] = [service_x].[AFF_NBR]
AND [affiliation].[PROV_NBR] = [service_x].[Prov_Nbr]
AND [affiliation].[VOID] = ''
AND [affiliation].[c_ymdeff] <= [service_x].[C_EFF_DATE]
AND [affiliation].[c_ymdend] >= [service_x].[C_EFF_DATE]
WHERE [service_x].[C_EFF_DATE] >= '1/1/2013'
AND [service_x].[C_EFF_DATE] <= '12/31/2013' --AND [affiliation].[PRAC_NBR] = @PracticeNbr
AND [affiliation].[PRAC_NBR] = 'F330'
END
-- THEREFORE, USE THIS QUERY FOR "G" GROUP SELECTION SINCE IT USES [NPI]
IF @ProviderType = 'G'
BEGIN
SELECT...
INTO [#TempTable_Service_X_Claims]
FROM [dbo].[service_x]
LEFT JOIN [dbo].[affiliation]
ON [affiliation].[AFF_NBR] = [service_x].[AFF_NBR]
AND [affiliation].[PROV_NBR] = [service_x].[Prov_Nbr]
AND [affiliation].[VOID] = ''
AND [affiliation].[c_ymdeff] <= [service_x].[C_EFF_DATE]
AND [affiliation].[c_ymdend] >= [service_x].[C_EFF_DATE]
WHERE [service_x].[C_EFF_DATE] >= '1/1/2013'
AND [service_x].[C_EFF_DATE] <= '12/31/2013'
AND [affiliation].[NPI] = '1700947884 '
END
Thanks in advance for your review and am hopeful for a reply.
PSULionRP
Is it possible that this procedure is being executed more than once concurrently (even against different databases)) within the instance?
Microsoft SQL Server Storage Engine PM

Similar Messages

  • Why do I get an "invalid signature" message when trying to download the latest version of iTunes?

    Why do I get an "invalid signature" message when trying to download the latest version of iTunes?  Apple Support is the lamest excuse for support I have EVER seen.

    That suggests that the installer is getting damaged during the download.
    I'd first try downloading an installer from the Apple website using a different web browser:
    http://www.apple.com/itunes/download/
    If you use Firefox instead of IE for the download (or vice versa), do you get a working installer?

  • Why am I getting a message that I need to log into the Canadian store for app updates and iTunes

    Why am I getting a message that I need to log into the Canadian store for app updates and I tune purchases?

    Should you be in the Canadian App Store? Is that your store? Of not - or of you need to see what store you are in.
    Settings>iTunes and App Stores>Apple ID
    Tap your ID
    Tap View Apple ID
    Enter your password
    Go to country/region in the popup window to change the store

  • Is there a forum or additional documentation for Adobe Flex Connector for MS SQL Server?

    Is there a forum or additional documentation for Adobe Flex Connector for MS SQL Server?  I am having problems getting it to work.  Also it states that it is Flash Builder 4 certified but the code is all in halo (<mx:Application ...).  I followed the documentation in the included PDF to no avail.  I am looking for additional documentation - e.g.:  a)  where exactly (which directory on the SQL Server) to store the "fas_mssql_connector.asp" file;  b) how to code the URL to the  "fas_mssql_connector.asp";  c) wondering if the product is really Flex 4 certified.  Thanks for any help (especially pointers to additional documenation).

    I do have exactly the same questions. SO far the fas_mssql_connector.asp file is placed at the 'wwwroot' folder of the 'inetpub' folder of the IIS server. As hostname I use '[MyServer]' since it should run on the same machine and username and password are correct.
    The fas_MSsql_Clean file is setup in a way that the name of the database is specified and the url to the asp file is set as: http://[MyServer]/fas_mssql_connector.asp
    My SQL query looks like this:
    private function getDbData():void
        mssqlQuery("Select * from Tomat", "getDataO3");
    And the MXML document like this:
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" minWidth="955" minHeight="600">
        <mx:Script source="Actionscript/MSsql.as"/>
        <mx:Script source="Actionscript/SqlQueries.as"/>
        <mx:DataGrid x="148" y="95" id="dgData">
            <mx:columns>
                <mx:DataGridColumn headerText="Column 1" dataField="col1"/>
                <mx:DataGridColumn headerText="Column 2" dataField="col2"/>
                <mx:DataGridColumn headerText="Column 3" dataField="col3"/>
            </mx:columns>
        </mx:DataGrid>
        <mx:Button x="148" y="264" label="Get data" id="btnGet" click="getDbData()"/>
    </mx:Application>
    However the application is busy for a long time and I do not receive a single piece of data. Any help with this?
    Thanks in advance.

  • Why am I getting different values based on order of input when the task type remains the same?

    I'm having a hard time understanding the results I'm getting when I input task information. Here are the scenarios with different, unlinked fixed work tasks:
    I estimate a task will take 2 hrs to complete and put this into work. If I add 1 resource, work = 2 hrs, duration = 1 day?, Resource A = 25%
    On the same task, if I add Resource B (along with keeping A), duration = 0.2 days, Resource A remains 25% and Resource B = 100% (no % shown)
    If I try the same scenario (adding first resource, then adding a second) on another task, occasionally it will give a duration of 0.91 days??? What the hell is that about?
    If I add 2 hrs for work then add both Resource A and Resource B at the same time I get duration = 0.5 days, Resource A = 25% and Resource B = 100%. Why is it giving a duration of 0.5 days and why does it not adjust the unit % for Resource B?
    This one is really blowing my mind. If I don't add work but instead add both resources at the same time first it's either making work 8.2 hrs OR 16 hours! I've gotten this result on the same exact task doing the same exact input. How can this differ?!
    No work input, both resources added initially and IF I get the correct 16 hours with 1 day duration, then I go ahead and change work to 2 hours, which produce Resource A & B = 100% and duration = 0.13 days.
    This last scenario is the duration result I want to see so the resources can work on multiple tasks in 1 day, but I typically try to input the work or duration estimates into the schedule and then resources last. I also don't understand how there can be
    such a wide range of results based on such similar scenarios. Also, having to do it this way creates another step since I have to go back and change the work...although I guess I would be doing that if I input estimates first.
    Can anyone explain why I'm getting those very head scratching differences, as well as provide some insight into how you initially develop a schedule (order of inputs)? I'm wondering if this has something to do with the change in 2010 regarding resources
    that I still don't understand?

    Thank you Julie for the quick reply. As indicated in the first part of my question all these scenarios are dealing with Fixed Work, so yes by default they are effort driven. I should have clarified on the 1st scenario the question mark was just to show duration
    had not changed, I wasn't actually questioning why it hadn't changed. Scenario 1 worked as expected. Although I don't fully agree with it, Scenario 2 also worked as expected.
    Scenario 3: Yes it is effort driven (fixed work). Resources are just test/fake resources so all information, including calendars, is default. This is one of those cases where I can produce that unusual result only on occasion, not everytime.
    4. In my scenario it's fixed work, but I do get the same result as you with fixed unit. Question still remains in both cases of why is the duration 0.5 days on 2 hours total work? Also, why are both units 25% in fixed units, but in fixed work Resource A
    is 25% and Resource B is 100% when in both cases they are working 1 hour? Lastly, if Units is going to be changed in this case then why isn't it 13% (1/8 hours)?
    5. This is also fixed work and I'm not touching duration in any of the scenarios. Day is still default at 8 hours. I was assigning resources via Resource Names on the Gantt View. I'm thinking this had to be some sort of glitch because I can't consistently
    produce the 8.2 hours result, but it happened multiple times.
    I also follow the same steps you do, other than I guess the last one. When you say you enter work estimates while assigning does that mean you do that in the split pane/task details form? I've typically done it from the Gantt View, but that seems to be what's
    causing my issue because when I tried doing it from task details it is giving me the duration I want. So thank you for that. I still don't understand why there is such a wide range of results, but at least it makes more sense to me that 100% Unit working on
    a task duration of 0.13 days is 1 hour.
    I apologize for how long this, but I'm trying to get out of some bad habits I've picked up by being forced to develop dumbed down schedules for the past few years.

  • Why are others getting their incredible even though we bought it on the same day?

    I ordered my phone may 9th. I have been following other threads here and I am seeing that people who ordered may 9th-10th have been getting shipping confirmation already and I still have nothing?
    I emailed CS online and they responded with:
     "Good morning. I am sorry to learn that you have concerns regarding the shipment of your new HTC Incredible Droid device. Upon receipt of your e-mail, it was too early to call and personally address your equipment concern. Due to high demand, our online website advised that pre-orders for this device are scheduled for shipment as of June 9, 2010. My name is Lasina, and I apologize that we are unable to escalate this process since it is based on the availability of this device at our warehouse."
    Ok I'm not sure if they hired some foreign job to answer my question, but I asked why in the heck aren't I getting a shipping confirm date because most others are already getting theirs. It said I would get my order by 5/29 when I ordered it, but that's what it also told everyone else.
    SO is this CS agent misinformed or what? She is now saying June 9th for my order? What the..

    I think that that cs rep was probably misinformed about what is going on. It has nothing to do with getting an answer I liked, but the last time I called the woman actually asked "when did you order?" "then you should get yours on the 29th."  That was great instead of just giving me the "its shipping in June." This can probably be attributed to Verizon's epic fail for shipping. That is why some people even got the Incredible before the April 29th release date. If mine doesn't ship on the 29th. Then I will call and complain. Until then, I just have to sit and make an attempt at patience.

  • My PDFs with form fields get "There was an error opening this document. The file is damaged and could not be repaired." on anothers computer, PC and MAC

    Im creating PDFs through InDesign and using Acrobat Pro 9 to add fields.  I save them to allow ADobe Reader people to use them.  Everything works fine on Pro and Reader on my end with a PC as well as someone elses PC.  But one person using Mac said some forms work and some dont.  Those that dont get the error "There was an error opening this document. The file is damaged and could not be repaired."  Ive resaved them and made sure they work and same problem.  There is nothing overly coplex about the PDFs either, a date field at the most.  They are using Reader 9.1.
    I found out the other day that one person who can open them adds info to them saves them and send over to that other person and cannot open any of them after they have been edited, same error.  He even tried on a PC and still gets it.
    I dont know what to do.  I know it has to be on his end and not mine.  What else can I suggest to him??

    It sounds like they are using an earlier version of Acrobat or Reader, though you said Reader 9.1. If you add some features in AA9 that are new, it appears that earlier versions see the new features as damaged files. At least that is my guess. Try using Reduce File Size or PDF Optimize to save to an earlier version and see if that helps. The other option is that you are getting them messed up in e-mail because many client look at PDF files as ascii and do not encrypt them. In that case force the encryption. You can also send them in ZIP form.

  • HT201109 Why am I getting this message when I am signed in with the account that I purchased it I don't have another account I'm not sure what's going on here's the message I keep getting my:"To update this application sign into the account you used to pu

    I am trying to update my Final Cut Pro X which I have done many times before.
    Why am I getting this message now?
    --- here's the message I keep getting every time I  try to download the update--
    "To update this application sign into the account you used to purchase it"
    I am signed in with the account that I purchased it I don't have another account I'm not sure what's going on

    Open up iTunes. Go to Store. Go to Account and sign in. Click on Purchase History. Find your purchase record.
    Good luck
    Russ

  • How can I get the data array from SQL Server Database?

    Hi,
    I can write a data array(2D)into a table of my SQL Server Database. The data array was writen to a column with image type. I know a data array is transformed a binary string when writing into database, but I dont know how to get the data array when I fetch the binary string from database.
    My question is:
    How to transform the binary string into data array? which vi's should I use? I have tried unflatten from string but failed.
    Any response is appriciated.
    Red

    happyxh0518 wrote:
    > I can write a data array(2D)into a table of my SQL Server Database.
    > The data array was writen to a column with image type. I know a data
    > array is transformed a binary string when writing into database, but I
    > dont know how to get the data array when I fetch the binary string
    > from database.
    >
    > My question is:
    > How to transform the binary string into data array? which vi's should
    > I use? I have tried unflatten from string but failed.
    In order to use Unflatten from string you first need to Flatten it
    before writing it. Also depending on the database driver, the returned
    data may actually not be binary but Hexadecimal encoded ASCII which you
    would first have to decode to binray.
    Rolf Kalbermatter
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

  • While creating the Data source for Sql server am getting this error?

    Hi i new to Power BI sites and office 365,
    For my first step 
    1. i have successful creaeted Gateway in Office 365
    2.Now i have creating  the Data source for that gateway using Sql server R2
    3.While Creating the Data source using the Corresponding gateway i have given and next phase set Credentials  phase i have noticed one pop up window and it will shows me like
    Data source Settings and  below in that window it will show's u the things like 
    Datasource Name.
    Loading......
    Credentials type:
    Privacy Level:
    Failed to verify parameter
    I will get this results finally  ,so hw should i achive this probelm ,Please let me know if any one knows
    So kindly give me the proper answer for this.
    Regards

    Any suggestions for Chinnarianu?
    Thanks!
    Ed Price, Azure & Power BI Customer Program Manager (Blog,
    Small Basic,
    Wiki Ninjas,
    Wiki)
    Answer an interesting question?
    Create a wiki article about it!

  • Is there a FM that lets you know whether the database is being locked/down?

    Dear experts,
    I have a situation here where i need to know if the database is being locked or being down.
    I understand that there is a DBID that will determine its availability.
    Thanks for your kind assistance.
    Regards
    Earl

    hi
    for locking:
    CALL FUNCTION 'ENQUEUE_E_TABLE'
    EXPORTING
    tabname = 'ZTABLE'
    EXCEPTIONS
    foreign_lock = 1
    system_failure = 2
    OTHERS = 3.
    for Unlocking:
    CALL FUNCTION 'DEQUEUE_E_TABLE'
    EXPORTING
    tabname = 'ZTABLE'.

  • Why do I get there is not enough memory warning

    I have a 2009 model Mac mini with only 2 GB of RAM, with a 160 GB hard drive, of which 116 GB remains unused. My MacBook Pro was being cranky, so I offloaded a bunch of files, via DVD and my external hard drive backup. Now when I try to open a document which was created in a newer version of Microsoft Word (I have Office 2004), I get the message "There is not enough memory or disk space to convert this document."
    What can I do other than putting in new RAM, which is nigh on to impossible for me, as the closest Apple store is at least three hours from home. Should I upgrade Microsoft Office?
    Thanks, MAM

    VirtualRuffy:
    Thank you for the most thoughtful, perceptive, intuitive and accurate/correct response vs all the pretenders giving out wrong and lazy-brain answers. Simple: ASK FOR ERROR DETAIL, which i did, and I got the "did not find what was expected" report - but did not realize what I could do about it. With your response as a guide I simply copied the entire Open Converter Supporter folder from my backup drive volume and used it to replace the folder in my active drive. Oh, the sweat virtues of having a backup copy of my original Leopard drive for emergency boot-up. BACKUP RULES !!
    Thanks,
    Holler1

  • Why do I get "there was an error working with this photo"?

    In LR 4.2, have begun seeing this error message when I apply a keyword to an image. When I move to an adjacent image and return to the original, the keyword shows it has been applied. I cannot see any problems with viewing or editing images but am concerned as I'm seeing this error message up to 10 times per day by rough count. So, in all it is appearing to be a nuisance but with no visible impacts.
    Every time I exit LR, I backup the catalog with an integrity test and optimization. When I return, I see no problems with images that received the error when a keyword was applied.
    Background: Have a catalog with over 14,700 images that for all other purposes runs fast and well. The images receiving the errors are TIFF scans of negative 4x5 sheet film. In the "active" part of the catalog, there are 519 images.
    Have a Mac Pro running OS X 10.6.8 with all patches applied. LR 4.2, current version. Over 410 GB hard drive space available. Eight GB RAM on machine.
    Have scanned Adobe Community and done a general Google search with no hits reporting this error message with no apparent other issues.
    Appreciate learning I can ignore with confidence or advice on how to stop/avoid repetition.
    Doug

    Yes. When I am watching, it seems to complete the autowrite in a few seconds after making a change.

  • Why am I getting "you've already purchased this but it hasn't been downloaded" on my iPad for a in app purchase.

    I need help. I'm trying to buy an in app purchase for FarmVille 2: Country Escape. And  it says "you've already purchased this it hasn't been downloaded. I am using iPad Air and it's up to date.

    Hi Neha
    I'm afraid I got stuck again with the popup "You've already purchased this... " as well as the occasional prompt for my Apple ID password.
    (I do make the call to finishTransaction on each callback i.e PURCHASE_TRANSACTION_SUCCESS, PURCHASE_TRANSACTION_CANCEL and PURCHASE_TRANSACTION_FAIL)
    When I print out the list of pending transactions, I can see a number of them with the "...error: Cannot connect to ITunes Store:2 originalTransaction: null"
    My question is, what happens if for some reasons the call to finishTransaction doesn't work (I'm guessing this is one of the scenarios that happened here)?
    Just having the call to finishTransaction in the callback doesn't necessarily mean it will be successfully exceuted all the time.
    What would you suggest in this scenario?
    How would I know how to process those pending transactions? At this stage, I have no info on whether those transactions were successful etc?
    I'd rather not have to interfere with Apple's handling of transactions but clickin on the popup button to download it doesn't seem to have any effect... Is this only a Sandbox issue too perhaps? *hopeful here
    Thanks!

  • Why is there a separate menu item for "Page setup" when there is already a tab for it in the "Print..." menu?

    I just can't see the point of having the same options in two places! The "Page Setup" tab from the "Print..." menu item has more options, relating to printer features, whereas the "Page Setup" dialogue box is basic and looks to me to be a little 'shoddy'. I'd have thought it would be a good idea to have the 'better' set of features available, but from it's own menu item, rather than a tab. And no duplicated controls!!

    Firefox on Windows doesn't have Page Setup in the Print dialog, it is in the Print Preview window.
    That isn't the only menu item that appears in multiple places. '''View Page Info''' is in the Tools menu (on Windows) and in the Contextual menu. '''Bookmark this Page''' is in the Bookmarks menu and the Contextual menu, along with the Tab Context menu.

Maybe you are looking for

  • Mail server setup Woes

    I don't know what I'm doing wrong. I have: A server with three users. A domain that points to that server Mail enabled for the server But when I try to use Apple Mail to point to that server and login, I get "could not connect to this IMAP server. Ch

  • Is it possible to precalculate web template when we used dropdown boxes

    Hi experts 1)Is it possibel to precalculate webtemplates when we use dropdowns in WAD? When I am doing precalculation it is precalculating only for 1st value in the dropdown and the remaining all values are not visible. If any one know how to do this

  • TS1702 Time Warner app problem

    Time Warner app no longer works.  Reinstall and other attempts do not fix.  All I get is the TW logo and after 15 seconds the channel lineup flashes by.  Any ideas?

  • Web dynpro Java on Blackberry

    Hi all, I'm developing a WD app on blackberry but I got stuck in binding data from a context node to my table. My problem is the table rows do not display correct data on each row. I do create different context data elements and add to the correct no

  • Web Services URI - How do we find it?

    Hi gurus What is Web Services URI? How does the link look like? Can someone navigate me after going in Web Services Navigator in http://<Server Name>:<Port Number>/index.html You need web services URI when you create connectors, fill  the Parameters