SQL Server CE 3.5 SP2 - SQLCE Toolbox / Automated Database Schema Upgrade Scripting / Drop Index

I am provisioning for automated database schema upgrades in a Windows Forms Application (VS2010/VB) which uses SQL Server Compact 3.5 SP2.  A portion of the schema upgrade procedure uses TSQL commands passed to SQLCE like the following:
cmd.CommandText = "DROP INDEX [SaleComps$ProjID]"
cmd.ExecuteNonQuery()
However, when this command is processed by the SQLCE engine, I get the following error:
Command: DROP INDEX [SaleComps].[ProjID]
Error: The specified index does not exist. [ ProjID ]
But, if I try to recreate the index (or try to change the index column) I get the following errors which indicate that the index is still there:
Command: ALTER TABLE [SaleComps] ALTER COLUMN [ProjID] nvarchar(20) NULL
Error: Cannot alter a column that is part of a key or an index. [ Index Name = SaleComps$ProjID,Column = ProjID ]
Command: CREATE INDEX "SaleComps$ProjID" ON "SaleComps" ("ProjID" ASC)
Error: The specified index already exists. [ SaleComps$ProjID ]
Any ideas why this would not be working? Thanks!
-BGood

No, I was guessing at the syntax from reviewing other web postings, some of which were in different SQL dialects. 
While your SQLCE Toolbox did not provide the DROP INDEX command, it did provide most of the "Schema Diff" scripting commands.  In hindsight, maybe SQLCE Toolbox should recognize when schema differences involve a Column which is used in an index, and
DROP the index before executing the ALTER COLUMN command, then re-CREATE the index with the modified column.
Despite this shortcoming, I am very thankful for the help provided by SQLCE Toolbox, and learned a little more about SQL scripting in the process.
Thanks, ErikEJ!
-BGood

Similar Messages

  • What does ERROR: DW050:  - SQL Server Compact 3.5 SP2 x64: Install failed

    What does ERROR: DW050:  - SQL Server Compact 3.5 SP2 x64: Install failed mean

    What Adobe software are you trying to install?  Which operating system are you using?  You may also want to review Troubleshoot with install logs | CS5, CS5.5, CS6 - http://helpx.adobe.com/creative-suite/kb/troubleshoot-install-logs-cs5-cs5.html as the error your posted is not very actionable at the moment.

  • How to get Cumulative Update packages for SQL Server Compact v3.5 SP2 for use on a Windows Mobile device

    There are links on the pages for various Cummulative Updates for SQL Compact v3.5 SP2 which look to relate to the desktop version, but are these also available for Windows Mobile devices?  If so, what is the process to get hold of them?
    We are seeing intermittent problems with corrupted databases on devices which are using SQL Compact v3.5 SP2 and have seen that some of the Cumulative Updates do relate to corruption and would like to see if these can help to solve the issue.

    Just select the KB article, at the top of each there is a link to request a hotfix, you will then get a email with a download link. The 8088 and 8109 hotfixes also apply to Windows Mobile.
    http://erikej.blogspot.dk/2010/08/sql-server-compact-35-sp2-downloadable.html
    Please mark as answer, if this was it. Visit my SQL Server Compact blog http://erikej.blogspot.com

  • SQL Server std 2008 R2 SP2 upgrade to 2014 std fails, SSRS issue?

    I’m trying to make an in place upgrade from 2008 r2 sp2 to sql 2012. With old installation everything (including Reporting Services) works fine, there is only one instance named MSSQLSERVER and all stuff is on one server, ssrs is native mode, compatibility
    level of databases is 100.
    When I start upgrade process al things go fine till “Feature Rules” where “No Custom Rendering Extensions” fails (it says “The Report Server has some custom rendering extensions configured”). Into Windows Application Log appears the following “Report Server
    (MSSQLSERVER) cannot connect to the report server database” and installation stops. We have not installed any extensions as far as I know. I’ve done some tweaking with RSReportServer.config but without success.
    Any good advice?
    Pekka

    Hello,
    Please verify you don’t have extension elements added on the RSReportDesigner.config file too.
    Use the following article to remove any possible rendering extensions:
    http://msdn.microsoft.com/en-us/library/ms152821(v=sql.105).aspx
    Hope this helps.
    Regards,
    Alberto Morillo
    SQLCoffee.com

  • WSUS wants our SQL server (running 2008 R2 SP2) to install SP1. Why?

    We just installed a bunch of Windows Updates on our servers (that were pushed out from WSUS).  One of the updates -- SQL Server 2008 R2
    SP1 -- failed to install on our SQL server.  But that's because it already had
    SP2 installed.  I ran a Discovery Report, and all of our SQL Server 2008 R2 components are at SP2.  And yet, WSUS wants this server to install SP1.
    Any suggestions as to why?  I'd rather not re-install SP2 if it's not necessary.
    Thank you!
    p.s.  I do see the following in the Sumary.txt file produced by the Discovery Report:
    Package properties:
      Description:                   SQL Server Database Services 2008 R2
      ProductName:                   SQL Server 2008 R2
      Type:                          RTM
      Version:                       10
      SPLevel:                       1
      Installation edition:          EVAL
    What is this "EVAL" version?  I don't think we ever installed an evaluation version of SQL, though I suppose that's possible

    Hi,
    A similar thread discussed below was caused that reporting service didn’t work properly. And the solution is to run
    Sp2 setup again and just select reporting service for upgrade.
    For more information please refer to:
    SQL Server 2008 R2 SP2 wants to install SP1 again via WSUS
    http://social.technet.microsoft.com/Forums/en-US/6e711903-7c2c-4bec-a9d8-c0b56ba0f9f8/sql-server-2008-r2-sp2-wants-to-install-sp1-again-via-wsus?forum=sqlsetupandupgrade

  • SQL SERVER 2014 Developer - SQL Server Management Studio (SSMS) - Tools in Toolbox are disabled because of bad path to DTS

    Hello all,
    after populating the Toolbox of SSMS  with the "Maintenance Plan Tasks" all task are disabled. The reason is simple a bad path to the DTS modules. The path in the Toolbox points to ...\DTSTasks\... Installation has created a path of ...\DTS\Tasks\...
    This is clearly a bug. But perhaps there is a workaround by changing something in the configuration. Any idea where to look for the responsible configuration file?
    Regards Uwe

    Hi Uwe,
    Based on my research, just as you said, the path of Maintenance Tasks in the Choose Toolbox Items dialog box points to ...\DTSTasks\..., but the actual path is...\DTS\Tasks\....I can reproduce the issue in my SQL Server 2014, SQL Server 2012 and SQL Server
    2008 R2 environments. It seems that this is a known issue. But the issue doesn’t affect the use of maintenance tasks, we can still drag the tasks to design the maintenance plan.
    If you have concern about this issue, it is my pleasure to help you to reflect your recommendation to the proper department for their consideration. Please feel free to submit your situation on our product to the following link
    https://connect.microsoft.com/SQLServer/. Your feedback is valuable for us to improve our products and increase the level of service provided.
    As to the issue that all tasks are disabled in the Toolbox of "Maintenance Plan Tasks", please make sure that you have selected the tasks in the Choose Toolbox Items dialog box. Then double-click the task in Toolbox pane or drag the task to maintenance
    design tab.
    Thanks,
    Katherine Xiong
    If you have any feedback on our support, please click
    here.
    Katherine Xiong
    TechNet Community Support

  • SQL Server 2008 R2 { An Error occured when attaching database(s) }

    Hello Guys!
    I just installed SQL Server 2008 R2 a couple of days ago, on the first day use i can attach database(.mdf) with out any problem.
    on the day 2, i keep getting this error:
    http://img515.imageshack.us/img515/14/1212i.png
    TITLE: Microsoft SQL Server Management Studio
    An error occurred when attaching the database(s).  Click the hyperlink in the Message column for details.
    BUTTONS:
    OK
    after clicking the Hyperlink this window open:
    http://img34.imageshack.us/img34/8766/hyperg.png
    TITLE: Microsoft SQL Server Management Studio
    Attach database failed for Server 'STARGAZER-PC\SQLSTARMAX'.  (Microsoft.SqlServer.Smo)
    For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=10.50.1600.1+((KJ_RTM).100402-1539+)&EvtSrc=Microsoft.SqlServer.Management.Smo.ExceptionTemplates.FailedOperationExceptionText&EvtID=Attach+database+Server&LinkId=20476
    ADDITIONAL INFORMATION:
    An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)
    Unable to open the physical file "E:\New folder\DataBase.MDF". Operating system error 5: "5(Access is denied.)". (Microsoft SQL Server, Error: 5120)
    For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=10.50.1600&EvtSrc=MSSQLServer&EvtID=5120&LinkId=20476
    BUTTONS:
    OK
    in that day i reinstall SQL Server 2008 R2, because I'm so confused. after that i try to attach i still got the same error, what i did is i share the folder where the database is.
    i open SSMS and try to attach and i attached without any error...
    i think this is the 4rth day, untill now everytime i want to attach a database i got this error, and even i try to share the folder where the database is i still got that error.
    any advice guys?
    Thanks a lot
    jhules
    if you want to be happy, find something you love to do and do it for free, then find someone to to you for it.

    The Error clearly shows that MDF files and LDF files are not matching or LDF file is corrupted.
    You can follow either of the one option below
    1. Restore a recent backup rather attaching the MDF file
    2. Attach  single MDF file without LOG File( Warning: All the log transactions will be gone and new log file will be created)
    EXEC sp_attach_single_file_db @dbname = 'AdventureWorks2008R2',
        @physname = N'C:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\Data\AdventureWorks2008R2_Data.mdf';
    Thanks, Aditya Badramraju, _______________________________________________________ Please mark answered if your question is completely answered; vote it as helpful to help others find a solution quicker. This posting is provided AS IS with no warranties
    and confers no rights. _______________________________________________________

  • How to create a database in SQL Server Express 2014 to be used with LV Database Toolkit

    I use LV Database Toolkit, which by default uses Jet database. Now I want to use SQL database with LV Database Toolkit. I have downloaded and installed "SQL Server 2014 Express with Tools" in my Labview Laptop. Now I want to create a database in SQL Server, because I think it is a requirement for creating a "udl connection file" (*.udl file). Please help me!
    Solved!
    Go to Solution.

    I made a database whose path is: C:\Program Files\Microsoft SQL Server\MSSQL12.SQLEXPRESS\MSSQL\DATA\depot1
    I tried to make .udl connection file, but when I click on "test connection" with the provider: "OLEDB Provider for Microsoft SQL Server" I get the Error "UDL Connection File Failure" (attached below)
    When I tried to make the .udl connection file with the provider "Microsoft SQL native Client 11.0" and when I click on "Test Connection" I get the Error" UDL Native Client_1"& " UDL Native Client_2".
    Please help!
    Thanks!
    Attachments:
    UDL Connection File Failure.png ‏78 KB
    UDL with Native Client_1.png ‏702 KB
    UDL with Native Client_2.png ‏714 KB

  • Permission to run SQL Server DTA - dbo access needed --- to the user database, or msdb ?

    Hi All,
           I am remotely working with a developer who wants to run DTA (SQL Server 2008 R2). I gave the AD Group "ALTER TRACE" permission, and also "execute" permission to xp_msver in master db. I also read that
    the user needs to be in dbo group. This is to the user database they wish to use DTA with, correct ? I just want to be sure that dbo to msdb is not needed.
    Thank you,
    Joe Clark
    Joe Clark

    Please see the link bellow
    http://technet.microsoft.com/en-us/library/ms190987(v=sql.105).aspx
    vt
    Please mark answered if I've answered your question and vote for it as helpful to help other user's find a solution quicker

  • SQCRS_Exec: State:42000 Error:[Microsoft][ODBC SQL Server Driver][SQL Server]Could not allocate a new page for database 'MEDICAL' because of insufficient disk space in filegroup 'PRIMARY'.

    I keep getting this error even though I have done all the suggestions. This was a restored database everything worked well for 2 days and now i am getting this error. I have autogrowth on and have shrunk the TransLog to 60mb the 2 table spaces that getr
    this error have been checked by several DBA's and they all say it is correct and to check with Microsoft. DBCC CHECKDB has also been run along with a native check for our Medical program. The DB is not abnormally large as I have others much larger. this is
    Server 2008r2 with SSMS 2008r2

    Add another file to the PRIMARY FILE GROUP on another drive.
    Above is a quick & dirty fix.
    You should makeup a disk space allocation plan keeping in mind the requirements 3 years from now.
    Kalman Toth Database & OLAP Architect
    SQL Server 2014 Design & Programming
    New Book / Kindle: Exam 70-461 Bootcamp: Querying Microsoft SQL Server 2012

  • SQL Server 2008 64-bit - Master Data Services troubleshoot database create Error

    I am getting the following error when trying to create a new database in SQL server using MDS
            Microsoft.MasterDataServices.Configuration.ConfigurationException: Data is Null. This method or property cannot be called on Null values. ---> System.Data.SqlTypes.SqlNullValueException: Data is Null. This method or
    property cannot be called on Null values.
               at System.Data.SqlClient.SqlBuffer.get_String()
               at Microsoft.MasterDataServices.Configuration.DatabaseUtilities.GetDatabases(DatabaseServerInformation server)
               at Microsoft.MasterDataServices.Configuration.Commands.NewMasterDataServicesDatabase.InternalProcessRecord()
               at Microsoft.MasterDataServices.Configuration.Commands.ConfigurationCmdlet.ProcessRecord()
               at System.Management.Automation.CommandProcessor.ProcessRecord()
               --- End of inner exception stack trace ---
              at Microsoft.MasterDataServices.Configuration.InstanceManager.Execute(Command command)
               at Microsoft.MasterDataServices.Configuration.InstanceManager.CreateMasterDataServicesDatabase(DatabaseServerInformation serverInformation, DatabaseInformation databaseInformation)
               at Microsoft.MasterDataServices.Configuration.UI.MdsDatabase.CreateNewDatabase()
    How can this error be resolved?
    Thanks

    Just double check the code and history.
    The bug is fixed in 2011/08/23 and made into SQL 2012 RTM. So I assume you are using 2008 R2, which mainstream support is ended. I am not able to push a fix to that.
    https://msdn.microsoft.com/en-us/library/ms178534.aspx
    collation_name
    sysname
    Collation for the database. Acts as the default collation in the database.
    NULL = Database is not online or AUTO_CLOSE is set to ON and the database is closed.
    The only option would be fix the NULL collation databases.

  • Understand SQL Server 2008 R2 replication features for a reporting database

    Hi, I am using SQL Server 2008 R2 and working on building a reporting database using transactional push replication and want to know the downside that we should aware of using this.
    For instance, is the data always available to the users even when changes are being written from the publisher?
    I am also interested in learning replication mechanism & internals. How should I proceed?
    Thanks in advance........
    Ione

    >>For instance, is the data always available to the users even when changes are being
    written from the publisher?
    Answer is Yes.
    For more information
    http://www.codeproject.com/Articles/715550/SQL-Server-Replication-Step-by-Step
    --Prashanth

  • Is it possible to set up sql server 2012 alwayson AG for existing scom2012 r2 databases?

    we have an existing scom 2012 r2 management group of which all databases are on a single sql server 2012 sp1 instance on a server 2012 r2 server. Now we want to utilize the sql 2012 alwayson feature to improve the HA and DR. Is it possible to add another
    sql server 2012 sp1 instance on another server 2012 r2 server and configure the two to create AlwaysOn Availability Group for all three scom databases, and how?
    Many thanks

    Hi,
    Microsoft recommends dedicated SQL clusters for the DBs. If you are trying to achive a common backend SQL for your SC 2012 DBs; check this great post by Cameron Fuller:
    http://www.systemcentercentral.com/system-center-2012using-a-common-sql-backend-database-sysctr-scom-scsm/ – it should give you some pointers. Check out the SCOM 2012 sizing helper as well!
    We can set scom 2012 databases in SQL cluster and install SCOM Report Service on different SQL Report Server intance. And RS instance cannot be clustered but can be HA. Failover clustering is supported only for the report server database; you cannot run
    the Report Server service as part of a failover cluster.
    Please also go through the below blog for more details about SQL alwayson:
    SQL Server 2012 AlwaysOn High Availability and Disaster Recovery Design Patterns
    http://blogs.msdn.com/b/sqlcat/archive/2013/11/20/sql-server-2012-alwayson-high-availability-and-disaster-recovery-design-patterns.aspx
    Regards,
    Yan Li
    Regards, Yan Li

  • SQL Server 2012 and guest access to the MSDB database

    Hello!
    Today we were given a vulnerability scan on one of our SQL Server 2012 systems and it is flagging the following issue:
    Guest is not disabled on the msdb database.
    I pointed our security team to the following article:
    https://support.microsoft.com/en-us/kb/2539091
    My question on this:
    Other than the three cases outlined, are there other possible implications of disabling guest on the msdb database?  Can you point me to a reference that states one way or the other if guest needs to be disabled on msdb?
    I do not like the thought of applying this change blindly and I am afraid of a potential issue caused in some other part of our application that we cannot account for down the road.
    Any info would be much appreciated.
    Thanks!
    -Bill S.

    Hello,
    Possible issues when SQL logins try to connect to a database.
    https://connect.microsoft.com/SQLServer/feedback/details/559791/if-you-disable-guest-user-in-msdb-it-causes-issues-with-a-sql-login-sql-2008
    Hope this helps.
    Regards,
    Alberto Morillo
    SQLCoffee.com

  • Sql Server Management Assistant (SSMA) Oracle okay for large database migrations?

    All:
    We don't have much experience with the SSMA (Oracle) tool and need some advice from those of you familiar with it.  We must migrate an Oracle 11.2.0.3.0 database to SQL Server 2014.  The Oracle database consists of approximately 25,000 tables and 30,000
    views and related indices.  The database is approximately 2.3 TB in size.
    Is this do-able using the latest version of SSMA-Oracle?  If so, how much horsepower would you throw at this to get it done?
    Any other gotchas and advice appreciated.
    Kindest Regards,
    Bill
    Bill Davidson

    Hi
    Bill,
    SSMA supports migrating large database of Oracle. To migrate Oracle database to SQL Server 2014, you could use the latest version:
    Microsoft SQL Server Migration Assistant v6.0 for Oracle. Before the migration, you should pay attention to the points below.
    1.The account that is used to connect to the Oracle database must have at least CONNECT permissions. This enables SSMA to obtain metadata from schemas owned by the connecting user. To obtain metadata for objects in other schemas and then convert objects
    in those schemas, the account must have the following permissions: CREATE ANY PROCEDURE, EXECUTE ANY PROCEDURE, SELECT ANY TABLE, SELECT ANY SEQUENCE, CREATE ANY TYPE, CREATE ANY TRIGGER, SELECT ANY DICTIONARY.
    2.Metadata about the Oracle database is not automatically refreshed. The metadata in Oracle Metadata Explorer is a snapshot of the metadata when you first connected, or the last time that you manually refreshed metadata. You can manually update metadata
    for all schemas, a single schema, or individual database objects. For more information about the process, please refer to the similar article: 
    https://msdn.microsoft.com/en-us/library/hh313203(v=sql.110).
    3.The account that is used to connect to SQL Server requires different permissions depending on the actions that the account performs as the following:
     • To convert Oracle objects to Transact-SQL syntax, to update metadata from SQL Server, or to save converted syntax to scripts, the account must have permission to log on to the instance of SQL Server.
     • To load database objects into SQL Server, the account must be a member of the sysadmin server role. This is required to install CLR assemblies.
     • To migrate data to SQL Server, the account must be a member of the sysadmin server role. This is required to run the SQL Server Agent data migration packages.
     • To run the code that is generated by SSMA, the account must have Execute permissions for all user-defined functions in the ssma_oracle schema of the target database. These functions provide equivalent functionality of Oracle system functions, and
    are used by converted objects.
     • If the account that is used to connect to SQL Server is to perform all migration tasks, the account must be a member of the sysadmin server role.
    For more information about the process, please refer to the  similar article: 
    https://msdn.microsoft.com/en-us/library/hh313158(v=sql.110)
    4.Metadata about SQL Server databases is not automatically updated. The metadata in SQL Server Metadata Explorer is a snapshot of the metadata when you first connected to SQL Server, or the last time that you manually updated metadata. You can manually update
    metadata for all databases, or for any single database or database object.
    5.If the engine being used is Server Side Data Migration Engine, then, before you can migrate data, you must install the SSMA for Oracle Extension Pack and the Oracle providers on the computer that is running SSMA. The SQL Server Agent service must also
    be running. For more information about how to install the extension pack, see Installing Server Components (OracleToSQL). And when SQL Express edition is used as the target database, only client side data migration is allowed and server side data migration
    is not supported. For more information about the process, please refer to the  similar article: 
    https://msdn.microsoft.com/en-us/library/hh313202(v=sql.110)
    For how to migrate Oracle Databases to SQL Server, please refer to the  similar article: 
    https://msdn.microsoft.com/en-us/library/hh313159(v=sql.110).aspx
    Regards,
    Michelle Li

Maybe you are looking for

  • Open Directory Keychain Question

    I have set up open directory on my domain but I am having trouble with Keychain access over the network when users logging into network accounts. Whenever I log in using open directory, I can open all of my applications, however each time I log in to

  • Is there any way to publish from Adobe Muse directly to a domain without Business Catalyst?

    I'm getting extremely frustrated with Adobe Muse. I think it's ridiculous having to go through Business Catalyst to publish a website when I have already purchased my own domain. Please tell me there is a way around this.

  • DNG and MESZ timestamp / sony A100 RAW conversion

    Hello, i have a question regarding the timestamp within the EXIF metadata after the RAW to DNG conversion for my A100 pictures. Today I have seen that the timestamp betwen the RAW original file and the converted DNG file differs about 3 hours. I can'

  • Am I able to claim this?

    http://i4.photobucket.com/albums/y128/HaoHao2986/IMG_0005.jpg http://i4.photobucket.com/albums/y128/HaoHao2986/IMG_0003.jpg (Link to the pictures) This is what appeared on my keyboard. I'm not sure when it's started but it definately appeared at its

  • FEATURE REQUEST: illuminate keyboard on wake from sleep and passwd required

    I've had my MBA for about a week and a half now. Slick little machine. Love it. There's one thing it doesn't do that's driving me crazy. Well, not literally crazy, but it is annoying. To reproduce: 1. System Preferences -> Security -> check "Require