SQL 2012 Management Studio Remote Servers Service Status Slow/Stops Working

This is a huge annoyance.  I manage about 50 SQL instances of SQL Server versions 2005-2012 and I noticed that it takes 1-2 seconds to load the service status (green arrow) on each individual server.  If you then connect to a server, you have to
wait for all the statuses to be loaded first in the Registered Servers list before it loads the statuses for servers in the Object Explorer.  This happens whether the servers are registered in Local Server Groups or Central Management Servers, and whether
I have access to all servers (as windows local administrator and sa), or not.  It also happens regardless of whether I run as Administrator or normally on my instance of SSMS (which is SQL 2012 Development on Windows Server 2008 R2).
These servers are also registered in alphabetical order by group and server name, which means that if I have "DEV" groups, they will be registered before "PROD", unless I rename accordingly.  It sometimes takes a few minutes, if
I'm lucky, to get a server I connect to to load, which means I can't use SSMS to really manage any remote servers and start/stop/pause/resume/restart services.
Worse, sometimes due to a server becoming unavailable (due to updates/patches/failovers), SSMS is unable to load the service statuses anymore for any new server connections made to object explorer, resulting in the loss of ability to view/change service statuses. 
In this case, there is no way to recover (Refresh of Central Management Servers does nothing), except to close SSMS and open it again, and then wait again for all the statuses to load.
I have lived with this since first installing SQL, and regardless of the Windows Updates and SQL patches applied, the problem has never gone away.  This also happens if I load SSMS in Windows Server 2012.  Its starting to become a huge issue now
that I have to patch several servers each month.
I have already checked WMI permissions, GPO, firewall, etc. as per all the suggestion on the internet, including this post
http://www.sqlservercentral.com/Forums/Topic825246-146-1.aspx.  None of these suggestions have made a difference, as my real problem is one of connectivity and performance, and
not security, which most of these suggestions apply to.  Of note, all servers are in the same domain, firewall is disabled across the board, correct permissions for local administrators exist for remote registry settings, WMI, GPO, etc, and all service
accounts and windows accounts that are used are local admins and sysadmins.
My work-around has been to delete the Central Management Server and any local server group registered servers, close and re-launch SSMS, and then connect to a server I'm interested in via Object Explorer.  Otherwise, close and re-launch will take forever. 
My other alternative is to RDP into the remote server and manage services via SQL Configuration Manager locally.
If anyone has any ideas on how to fix this, or make it go faster, I'd really appreciate it.
Diane

Hi Satish,
Thanks for taking the time to reply.  Yes, I actually am already using work-arounds (i.e. methods other than SSMS) to accomplish my tasks.  My issue is that this is supposed to be working and provide a nice GUI so that you can easily visualize
any issues, and address them directly, without having to hodge-podge access via scripts or 3rd-Party tools.
Since no one else has any comments, I guess there are no plans to make remote server administration work with SSMS properly then, and that kludge methods are the only ones being advocated.
Diane

Similar Messages

  • Opening SQL Server Management Studio causes server to freeze - mouse stops working

     I have a virtual server running Windows Server 2012 with SQL Server 2012 on it.  Recently I went to open SSMS and it caused the entire server to freeze.  I can't click on anything- nothing in SSMS, on my desktop, my taskbar, or anywhere else. 
    All I can do is close the remote desktop window, log in as a different user and restart the server to get it to unfreeze.  I found that I can use keyboard arrows for basic navigation within SSMS and the Enter key to Connect to the database but that's
    it.  I've tried uninstalling and reinstalling the software with no luck.  Event Viewer doesn't log any errors.
    We use this server for GIS data so ESRI's ArcSDE programs are also running on the machine- they are acting buggy for some users but not others.  I don't know if this is related.  We've also been having issues with the backups from vRanger which
    have caused random server crashes.  Our Server/Network Admin has temporarily disabled backups.  I'm afraid the instability has messed something up at a deeper level but I don't know where to start looking.  Any advice would be appreciated.
    Christina

    The GIS people have wanted to have all their software running directly on the server, including SSMS, based on recommendations from their ESRI consultant.  I will ask again why this is necessary.
    No matter what the consultant says, you can always connect to the server from another machine. (Unless the instance is configured to not accept remote connections.)
    While waiting for the server admin to increase the memory of the VM, you can connect to the server with SQLCMD from the command line and issue these commands:
    EXEC sp_configure 'max server memory', 2000
    RECONFIGURE
    go
    This restricts how much memory SQL Server can consume, and you should now be able to run SSMS on the server. The performance of SQL Server may suffer, though.
    When you get more memory, run the commands above again, but with 6000 instead of 2000.
    Erland Sommarskog, SQL Server MVP, [email protected]

  • Microsoft SQL Server 2012 Management Studio Express silent installation very slow

    Iam doing silent installations often on several Systems.
    I install the Microsoft SQL Server 2012 Management Studio Express with this command:
    "SQLManagementStudio_x64_DEU.exe /ACTION=INSTALL /QUIET /IAcceptSQLServerLicenseTerms="True" /FEATURES=CONN,BC,SSMS /indicateprogress"
    The installation will take almost an hour to finish. 
    I never get error messages or so. The installation afterwards is fine.
    Is there a way to speed up the installation process?
    Thanks!

    Hi Dennis,
    When installing SQL Server Management Studio, it is normal for us taking an hour to finish the installation.
     Personally, if you want to speed up the installation process, I recommend improve your hardware device on your computer, such as CPU, RAM, hard disk and so on.
    Or you can submit an submit the requirement at https://connect.microsoft.com/SQLServer/. 
    If the requirement mentioned by customers for many times, the product team may consider to add or improve this requirement in the future SQL Server version. Thanks for your understanding.
    Thanks,
    Sofiya Li
    Sofiya Li
    TechNet Community Support

  • Get error when connecting SQL 2012 Management studio to SQL Server 2012 database

    I got this error message when I tried to connect to SQL Server 2012 using Management studio 2012.
    Service 'Microsoft.SqlServer.Management.IRegistrationService' not found (Microsoft.SqlServer.Management.SDK.SqlStudio)

    Did this get this resolved?
    My SSMS 2012 was running without issue for several months until I installed VS2012. After the VS2012 I started getting "Service 'Microsoft.SqlServer.Management.IRegistrationService' not found" when connecting to database in SSMS 2012. I uninstalled VS2012
    and SSMS 2012 started working again. Installed VS2012 and SSMS 2012 is broken again.
    I tried the above suggestions without success. Here are the error details. Any help is greatly appreciated.
    ===================================
    Service 'Microsoft.SqlServer.Management.IRegistrationService' not found (Microsoft.SqlServer.Management.SDK.SqlStudio)
    Program Location:
       at Microsoft.SqlServer.Management.ServiceProvider.GetService[T](IServiceProvider serviceProvider, Boolean throwIfNotFound)
       at Microsoft.SqlServer.Management.SqlStudio.Explorer.NavigationService.Initialize()
       at Microsoft.SqlServer.Management.SqlStudio.Explorer.NavigationService.GetView(String urnPath)
       at Microsoft.SqlServer.Management.UI.VSIntegration.ObjectExplorer.NavigableItemBuilder.<GetColumnsFromNavigationService>d__11.MoveNext()
       at Microsoft.SqlServer.Management.UI.VSIntegration.ObjectExplorer.NavigableItemBuilder.AddFields(List`1 list, IEnumerable`1 fields, IDictionary`2 allValidFields, AddFieldsFlags flags)
       at Microsoft.SqlServer.Management.UI.VSIntegration.ObjectExplorer.NavigableItemBuilder.GetParentFields(INodeInformation source, Dictionary`2& allValidColumns)
       at Microsoft.SqlServer.Management.UI.VSIntegration.ObjectExplorer.NavigableItemBuilder.BuildDynamicItemWithQuery(IList`1 nodes, INodeInformation source, INavigableItem sourceItem, String urnQuery, Boolean registerBuilder, Boolean registerBuiltItems)
       at Microsoft.SqlServer.Management.UI.VSIntegration.ObjectExplorer.NavigableItemBuilder.BuildDynamicItem(IList`1 nodes, INodeInformation source, INavigableItem sourceItem, IFilterProvider filter)
       at Microsoft.SqlServer.Management.UI.VSIntegration.ObjectExplorer.NavigableItemBuilder.Build(IList`1 nodes, INodeInformation source, INavigableItem sourceItem, IFilterProvider filter)
       at Microsoft.SqlServer.Management.UI.VSIntegration.ObjectExplorer.NavigableItem.RequestChildren(IGetChildrenRequest request)
       at Microsoft.SqlServer.Management.UI.VSIntegration.ObjectExplorer.ExplorerHierarchyNode.BuildChildren(WaitHandle quitEvent)

  • SQL 2012 Management Studio messages outcome is not in english after running any statement/command

    I have recently installed SQL 2012 and by default I have selected "english" as first language. When I run any statement into SQL management studio the messages outcome shows into different language
    How I can change it back to English
    Example
    Przetworzono: 10 procent.
    Przetworzono: 20 procent.
    Przetworzono: 30 procent.
    Przetworzono: 40 procent.
    Przetworzono: 50 procent.
    Przetworzono: 60 procent.
    Przetworzono: 70 procent.
    Przetworzono: 80 procent.
    Przetworzono: 90 procent.
    Przetworzono: 100 procent.
    Muhammad Mehdi

    @ Sofiya
    After I run command I got message
    Changed language setting to us_english.
    But when I try other syntax like recovery of database it is not in english
    Przetworzono: 10 procent.
    Przetworzono: 20 procent.
    Przetworzono: 30 procent.
    Przetworzono: 40 procent.
    Przetworzono: 50 procent.
    Przetworzono: 60 procent.
    Przetworzono: 70 procent.
    Przetworzono: 80 procent.
    Przetworzono: 90 procent.
    Przetworzono: 100 procent.
    Muhammad Mehdi
    Hi,
    , you will have to use SET LANGUAGE to change the language in the above of syntax. If you have not installed the localized version of SQL Server, the default language is US English. I recommend you use the following stetament to check if you install
    the localized version of SQL Server.
    select @@language
     If you need to change the default language on this machine, then you will have to change the default language for individual logins, as doing it on a server level won't work. For more ifnormation, see:http://www.sqlservercurry.com/2010/11/change-default-language-for-sql-server.html
    Regards,
    Sofiya Li
    Sofiya Li
    TechNet Community Support

  • SQL Sever Management Studio intellisense issue in SQL Server 2008 R2 and in SQL Sever 2012

    Hi Team,
    Intellisense in sql server management studio is working fine when i am accessing the databases in my  local server.
    But Intellisense is not working when ever i am trying to connect to the remote servers with the client
    I tried different blogs and i tried to configure all the options i have upgraded to some patches upgraded for sql 2008 r2 client to sql 2012 client.
    But Intellisense is not working with the remote server databases in the sql management studio .
    Intellisense is working in the server but the same is not working when we are trying to access with client from our local machines.
    Please provide me help to fix this issue
    Regards
    Karthik Kattamudi

    Did you try to refresh the cache by hitting CTRL+SHIFT+R?
    Also, these remote servers, are they SQL Server 2008 R2 as well or different version?
    Please mark the answer as helpful if i have answered your query. Thanks and Regards, Kartar Rana

  • SQL Server 2012 Management Studio:In the Database, how to print out or export the old 3 dbo Tables that were created manually and they have a relationship for 1 Parent table and 2 Child tables?How to handle this relationship in creating a new XML Schema?

    Hi all,
    Long time ago, I manually created a Database (APGriMMRP) and 3 Tables (dbo.Table_1_XYcoordinates, dbo.Table_2_Soil, and dbo.Table_3_Water) in my SQL Server 2012 Management Studio (SSMS2012). The dbo.Table_1_XYcoordinates has the following columns: file_id,
    Pt_ID, X, Y, Z, sample_id, Boring. The dbo.Table_2_Soil has the following columns: Boring, sample_date, sample_id, Unit, Arsenic, Chromium, Lead. The dbo.Table_3_Water has the following columns: Boring, sample_date, sample_id, Unit, Benzene, Ethylbenzene,
    Pyrene. The dbo.Table_1_XYcoordinates is a Parent Table. The dbo.Table_2_Soil and the dbo.Table_3_Water are 2 Child Tables. The sample_id is key link for the relationship between the Parent Table and the Child Tables.
    Problem #1) How can I print out or export these 3 dbo Tables?
    Problem #2) If I right-click on the dbo Table, I see "Start PowerShell" and click on it. I get the following error messages: Warning: Failed to load the 'SQLAS' extension: An exception occurred in SMO while trying to manage a service. 
    --> Failed to retrieve data for this request. --> Invalid class.  Warning: Could not obtain SQL Server Service information. An attemp to connect to WMI on 'NAB-WK-02657306' failed with the following error: An exception occurred in SMO while trying
    to manage a service. --> Failed to retrieve data for this request. --> Invalid class.  .... PS SQLSERVER:\SQL\NAB-WK-02657306\SQLEXPRESS\Databases\APGriMMRP\Table_1_XYcoordinates>   What causes this set of error messages? How can
    I get this problem fixed in my PC that is an end user of the Windows 7 LAN System? Note: I don't have the regular version of Microsoft Visual Studio 2012 in my PC. I just have the Microsoft 2012 Shell (Integrated) program in my PC.
    Problem #3: I plan to create an XML Schema Collection in the "APGriMMRP" database for the Parent Table and the Child Tables. How can I handle the relationship between the Parent Table and the Child Table in the XML Schema Collection?
    Problem #4: I plan to extract some results/data from the Parent Table and the Child Table by using XQuery. What kind of JOIN (Left or Right JOIN) should I use in the XQuerying?
    Please kindly help, answer my questions, and advise me how to resolve these 4 problems.
    Thanks in advance,
    Scott Chang    

    In the future, I would recommend you to post your questions one by one, and to the appropriate forum. Of your questions it is really only #3 that fits into this forum. (And that is the one I will not answer, because I have worked very little with XSD.)
    1) Not sure what you mean with "print" or "export", but when you right-click a database, you can select Tasks from the context menu and in this submenu you find "Export data".
    2) I don't know why you get that error, but any particular reason you want to run PowerShell?
    4) If you have tables, you query them with SQL, not XQuery. XQuery is when you query XML documents, but left and right joins are SQL things. There are no joins in XQuery.
    As for left/right join, notice that these two are equivalent:
    SELECT ...
    FROM   a LEFT JOIN b ON a.col = b.col
    SELECT ...
    FROM   b RIGHT JOIN a ON a.col = b.col
    But please never use RIGHT JOIN - it gives me a headache!
    There is nothing that says that you should use any of the other. In fact, if you are returning rows from parent and child, I would expect an inner join, unless you want to cater for parents without children.
    Here is an example where you can study the different join types and how they behave:
    CREATE TABLE apple (a int         NOT NULL PRIMARY KEY,
                        b varchar(23) NOT NULL)
    INSERT apple(a, b)
       VALUES(1, 'Granny Smith'),
             (2, 'Gloster'),
             (4, 'Ingrid-Marie'),
             (5, 'Milenga')
    CREATE TABLE orange(c int        NOT NULL PRIMARY KEY,
                        d varchar(23) NOT NULL)
    INSERT orange(c, d)
       VALUES(1, 'Agent'),
             (3, 'Netherlands'),
             (4, 'Revolution')
    SELECT a, b, c, d
    FROM   apple
    CROSS  JOIN orange
    SELECT a, b, c, d
    FROM   apple
    INNER  JOIN orange ON apple.a = orange.c
    SELECT a, b, c, d
    FROM   apple
    LEFT   OUTER JOIN orange ON apple.a = orange.c
    SELECT a, b, c, d
    FROM   apple
    RIGHT  OUTER JOIN orange ON apple.a = orange.c
    SELECT a, b, c, d
    FROM   apple
    FULL OUTER JOIN orange ON apple.a = orange.c
    go
    DROP TABLE apple, orange
    Erland Sommarskog, SQL Server MVP, [email protected]

  • Not able to access database from a remote machine using SQL Server Management Studio

    Hi,
    I have a DB_BOX with SQL Server 2008 R2 installed. I can access the databases on the local machine using SQL Server Management Studio but it is not accessible from other machines, though the machines are in same domain.
    I have remote enabled on SQL Server box, TCP enabled, firewall off. I checked with IP Address too, all SQL Server services are running.
    The SQL Server log shows the message
    The requested service has been stopped or disabled and is unavailable at this time. The connection has been closed.
    I get the below message in SSMS from remote machine.
    Details of error message are
    ===================================
    Cannot connect to DB_BOX.
    ===================================
    A connection was successfully established with the server, but then an error occurred during the login process. (provider: TCP Provider, error: 0 - The specified network name is no longer available.) (.Net SqlClient Data Provider)
    For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&EvtSrc=MSSQLServer&EvtID=64&LinkId=20476
    Server Name: DB_BOX
    Error Number: 64
    Severity: 20
    State: 0
    Program Location:
       at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
       at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
       at System.Data.SqlClient.TdsParserStateObject.ReadSniError(TdsParserStateObject stateObj, UInt32 error)
       at System.Data.SqlClient.TdsParserStateObject.ReadSni(DbAsyncResult asyncResult, TdsParserStateObject stateObj)
       at System.Data.SqlClient.TdsParserStateObject.ReadNetworkPacket()
       at System.Data.SqlClient.TdsParserStateObject.ReadBuffer()
       at System.Data.SqlClient.TdsParserStateObject.ReadByte()
       at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
       at System.Data.SqlClient.SqlInternalConnectionTds.CompleteLogin(Boolean enlistOK)
       at System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, Int64 timerExpire, SqlConnection owningObject)
       at System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(String host, String newPassword, Boolean redirectedUserInstance, SqlConnection owningObject, SqlConnectionString connectionOptions, Int64 timerStart)
       at System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance)
       at System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance)
       at System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection)
       at System.Data.ProviderBase.DbConnectionFactory.CreateNonPooledConnection(DbConnection owningConnection, DbConnectionPoolGroup poolGroup)
       at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection)
       at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)
       at System.Data.SqlClient.SqlConnection.Open()
       at Microsoft.SqlServer.Management.SqlStudio.Explorer.ObjectExplorerService.ValidateConnection(UIConnectionInfo ci, IServerType server)
       at Microsoft.SqlServer.Management.UI.ConnectionDlg.Connector.ConnectionThreadUser()

    Sorry, missed the message from the errorlog in the original post. You shouldn't have included that big .Net dump that hid the important facts. :-)
    My first Google attempt on that message (which I have never seen before) suggests that the TCP Enpoint is stopped, so try this:
    ALTER ENDPOINT [TSQL Default TCP]
    STATE=STARTED;
    Erland Sommarskog, SQL Server MVP, [email protected]
    This solves the problem. Thanks...

  • SQL Server 2012 Management Studio Crashed when opening the application

    Hi,
    I had installed SharePoint 2013 with SQL Server 2012 on a single server environment a couple of months ago. Both the tools were working fine. But today morning i found that when opening SQL Server 2012 Management Studio it displays a pop-up message as attached
    below:
    Event Log:
    Faulting application name: Ssms.exe, version: 2011.110.3000.0, time stamp: 0x5081c1cd
    Faulting module name: Ssms.exe, version: 2011.110.3000.0, time stamp: 0x5081c1cd
    Exception code: 0xc0000005
    Fault offset: 0x00004b89
    Faulting process id: 0x2b0c
    Faulting application start time: 0x01cf54780a2efde8
    Faulting application path: C:\Program Files (x86)\Microsoft SQL Server\110\Tools\Binn\ManagementStudio\Ssms.exe
    Faulting module path: C:\Program Files (x86)\Microsoft SQL Server\110\Tools\Binn\ManagementStudio\Ssms.exe
    Report Id: 47e02c36-c06b-11e3-946b-00155d040605
    Faulting package full name: 
    Faulting package-relative application ID: 
    Server Details:
    Windows Server 2012 Standard
    MS SharePoint 2013
    MS SQL Server 2012
    IIS 8.0
    If anyone has faced the same problem or has a workaround, please share!
    Thanks 

    Hello,
    Applying Service Pack 1 for SQL Server 2012 may solve this issue.
    Hope this helps.
    Regards,
    Alberto Morillo
    SQLCoffee.com

  • SQL Server 2012 Management Studio Displays Error With "New Query" and Intellisense Works Intermittenly

    I was upgrade to SQL Server 2012 and Visual Studio 2010 was upgraded with SP1 the same day.  This is x64 machine. 
    Microsoft SQL Server Management Studio      11.0.2100.60
    Microsoft .NET Framework      4.0.30319.261
    Operating System      6.1.7601
    Problem 1) With SQL Server Management Studio, selecting "New Query" a warning box is displayed: "The 'Microsoft.Practices.EnterpriseLibrary.Configuration.Design.VisualStudioIntegration2010Package, Microsoft.Practices.EnterpriseLibrary.Configuration.Design.VisualStudioIntegration2010,
    Version=1.0.0.0, Culture=netutral, PublicKeyToken=null' package did not load correctly.    The problem mayhave been cuased by a configuration change or by the installation of another extension.  You can get more information by running the
    application together with the /log parameter on the command line, and then examining the file ...\AppDate\Roaming\Microsoft\AppEnv\10.0\ActivityLog.xml'.  Continue to show this error message?
    Problem 2) In a Query Initellisense works intermittently but most of the time it will not display anything.  I have tried Edit|Intellisense|Refresh Cach size and also seperately, Edit | Intellisense | List Members but neither has helped.  Also
    tried different selections for Tools|options| T-SQL | Intellisense| Maximum Script Size; no luck either. 

    Hi WallyJim,
    For your first problem, possible workaround:
    In Programs and Features (or Add/Remove Programs), right click the Microsoft Enterprise Library 5.0 Optional Update 1 program and select change. Remove the VisualStudio2010 integration.
    Then, install the EnterpriseLibrary Configuration extension from Microsoft via the Extension Manager in VS2010. This will allow you to launch the configuration editor from VS2010, but will not be installed for SSMS.
    For more information, please refer to
    https://connect.microsoft.com/SQLServer/feedback/details/620532/error-message-on-new-query-window-opening.
    For your second problem, the following conditions might affect the behavior of IntelliSense:
    There is a code error above the cursor.
    The insertion point is inside a code comment.
    The insertion point is inside a string literal.
    The automatic options are turned off.
    For more information, refer to Troubleshooting IntelliSense (SQL Server Management Studio):
    http://msdn.microsoft.com/en-us/library/ms173434.aspx.
    Thanks,
    Maggie
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. This can be beneficial to other community members reading the thread.

  • SQL Server 2012 Management Studio:Importing XML file to new Table of new Database-XML parsing: unexpected end of input???

    Hi all,
    In the Notepad, I created an xml file (ZenQroducts.xml) :
    <Qroducts>
    <Qroduct>
    <SKU>1</SKU>
    <Desc>Book</Desc>
    </Qroduct>
    <Qroduct>
    <SKU>2</SKU>
    <Desc>DVD</Desc>
    </Qroduct>
    <Qroduct>
    <SKU>3</SKU>
    <Desc>Video</Desc>
    </Qroduct>
    In my SQL Server 2012 Management Studio, I executed the following code:
    --to create a new object Qroducts in a new database OPENXMLtesting
    CREATE DATABASE OPENXMLtesting
    GO
    CREATE TABLE Qroducts(
    sku INT Primary KEY,
    qroduct_desc VARCHAR(30));
    INSERT INTO Qroducts (sku, qroduct_desc)
    SELECT X.qroduct.query('SKU').value('.', 'INT'),
    X.qroduct.query('Desc').value('.', 'VARCHAR(30)')
    FROM (
    SELECT CAST(x AS XML)
    FROM OPENROWSET(
    BULK 'H:\ZenQroducts.xml',
    SINGLE_BLOB) AS T(x)
    ) AS T(x)
    CROSS APPLY x.nodes('Qroducts/Qroduct') AS X(qroduct);
    SELECT sku, qroduct_desc
    FROM Qroducts;
    I got the following message:
    Msg 9400, Level 16, State 1, Line 6
    XML parsing: line 13, character 12, unexpected end of input
    I have no ideas why I got this "XML parsing:line 13, character12, unexpected end of input" message. Please kindly help, advise me on where I made mistake and how I can resolve this problem, and respond in this Forum.
    Thanks in advance,
    Scott Chang
     

    Hi Manish, Thanks for your response.
    Yes, it is a duplicate with Qroducts/Qroduct instead of Products/Product. I did it, because I don't know how to remove the existing "Products" database.
    Again, I got the existing "Qroducts" database in this second trial!!??  I am comletely lost in doing "Importing XML file to SQL Table" now!!  I think that I have not touched T-SQL and XML programming, since 2008. I
    did not catch the new features of T-SQL 2008, XML, SQL/XML, XQuery, etc. for long time. Recently, I did not know what DECLARE, @x, SET,...were, and dived into the SQL/XML and XQuery programming. I knew the SQL Basics (SELECT, FROM, WHERE,..), creating
    the names of databases and tables in SQL Server 2008/2012 Management Studio (Express) before. This morning, I found an old T-SQL 2008 Prgrammer's Guide that has the new features of SQL Server 2008 for T-SQL, XML, XQuery, etc. I just starting reading
    it to know what DECLARE, @x, SET,... are. But, I still don't know where the existing databases "Products" and "Qroducts" (created by me) are - they are not in the Databases of SQL Server 2012 Management Studio I am using!!??  Could
    you please kindly point out where the "Products" and "Qroducts" databases are?
    Prashanth responded to my posted question too and he asked to to try his code: DECLARE @xml XML, SELECT @xml =' <Qroducts>.....SELECT product.value.....FROM @XML.nodes.....AS.... I just learned that his code is doing the thing we
    want to do and print the results below the SQL Query. This is not what I need in doing my SQL/XML programming. I am reading/studying the new (2008) features of T-SQL, XQuery 1.0: An XML Query Language (Second Edition), and Microsoft XQuery Language Reference
    (SQL Server 2012 Books Online) closely now. I hope that I can resume the T-SQL, XML Query, SQL/XML, XQuery in my SQL Server 2012 Management Studio soon.
    Please tell me  where the existing databases "Products" and "Qroducts" I created in my previous trials in my SQL Server 2012 Management Studio.  This is what I need to know and to delete them, before I do this kind of "Importing
    XML file to Table of SQL Server 2012 Management Studio"  programming again.
    Please kindly help, advise and respond again.
    Many Thanks,
    Scott Chang

  • SQL Server 2012 Management Studio: Import XML File to SQL Table - XML parsing: illegal qualified name character

    Hi all,
    In my SQL Server 2012 Management Studio, I executed the following code:
    CREATE TABLE Products(
    sku INT Primary KEY,
    product_desc VARCHAR(30));
    INSERT INTO Products (sku, product_desc)
    SELECT X.product.query('SKU').value('.', 'INT'),
    X.product.query('Desc').value('.', 'VARCHAR(30)')
    FROM (
    SELECT CAST(x AS XML)
    FROM OPENROWSET(
    BULK 'H:\ZenProducts.xml',
    SINGLE_BLOB) AS T(x)
    ) AS T(x)
    CROSS APPLY x.nodes('Products/Product') AS X(product);
    SELECT sku, product_desc
    FROM Products;
    I got the following message:
    Msg 9455, Level 16, State 1, Line 5
    XML parsing: line 3, character 12, illegal qualified name character
    I have no ideas why the "product" in the statement "SELECT X.product.query('SKU').value('.','INT')" is not legal qualified name charcter!!!???  Please kindly help, advise and respond.
    Thanks in advance,
    Scott Chang

    Hi Manish, Thanks for your response.
    Here is a copy of my ZenProducts.xml:
    <Products>
    <Product>
    <SKU>1<</SKU>
    <Desc>Book</Desc>
    </Product>
    <Product>
    <SKU>2<</SKU>
    <Desc>DVD</Desc>
    </Product>
    <Product>
    <SKU>3<</SKU>
    <Desc>Video</Desc>
    </Product>
    I found the wrong "<<" in my xml file and changed it to the right "<" for the statement<SKU>1</sku>. I executed the corrected code and I got the following new message:
    Msg 2714, Level 16, State 6, Line 1
    There is already an object named 'Products' in the database.
    I don't know how to remove the old, existing the 'Products' object in the database and execute the corrected code again. Please kindly help, advise and tell me how to resolve this new problem.
    Many Thanks,
    Scott Chang
    P. S. I played with another project to get the 'Products' object in my database before. Frankly, I don't know where the old 'Products' object and the database are. Please enlighten me in resolving this matter more clearly.
    You welcome Scott, As Olaf mentioned in this post, there was already a table exists , so need to drop your Products table.
    Apart from this, I guess either you did not pasted the full XML file or what, I needed to have the (  </Products>)closing tag in your XML file as follows.
    <Products>
    <Product>
    <SKU>1</SKU>
    <Desc>Book</Desc>
    </Product>
    <Product>
    <SKU>2</SKU>
    <Desc>DVD</Desc>
    </Product>
    <Product>
    <SKU>3</SKU>
    <Desc>Video</Desc>
    </Product>
    </Products>
    You can use following script to drop if your 
    Products table is already existing.
    if exists(select 1 from sys.tables where name ='Products')
    drop table Products
    CREATE TABLE Products(
    sku INT Primary KEY,
    product_desc VARCHAR(30));
    INSERT INTO Products (sku, product_desc)
    SELECT X.product.query('SKU').value('.', 'INT'),
    X.product.query('Desc').value('.', 'VARCHAR(30)')
    FROM (
    SELECT CAST(x AS XML)
    FROM OPENROWSET(
    BULK 'H:\ZenProducts.xml',
    SINGLE_BLOB) AS T(x)
    ) AS T(x)
    CROSS APPLY x.nodes('Products/Product') AS X(product);
    SELECT sku, product_desc
    FROM Products;
    Let us know if you face any other problem.
    Thanks
    Manish
    Please click Mark as Answer if my post solved your problem and click
    Vote as Helpful if this post was useful.

  • SQL Server 2012 Management Studio: XML XQuery-query the XML Blob using CTE: How to specify the coorelation name in bulk rowset?

    Hi all,
    I just started doing the XML Xquery programming in my SQL Server 2012 Management Studio. I executed the following code:
    --query the XML Blob using a CTE (pulling from the XML file each time) Products
    WITH XmlFile (Contents) AS (
    SELECT CONVERT (XML, BulkColumn)
    FROM OPENROWSET (BULK 'H:\Products.xml', SINGLE_BLOB) ) AS XmlData
    SELECT *
    FROM XmlFile
    GO
    I got the the following Msg:
    Msg 491, Level 16, State 1, Line 4
    A correlation name must be specified for the bulk rowset in the from clause.
    How can I specify the correction name for the bulk rowset in my project?
    Please kindly help, advise and respond.
    Thanks in advance,
    Scott Chang

    Hello Scott,
    You have to assign a table alias for the OPENROWSET =>
    --query the XML Blob using a CTE (pulling from the XML file each time) Products
    WITH XmlFile (Contents) AS (
    SELECT CONVERT (XML, BulkColumn)
    FROM OPENROWSET (BULK 'H:\Products.xml', SINGLE_BLOB) AS MyXML ) AS XmlData
    SELECT *
    FROM XmlFile
    GO
    Olaf Helper
    [ Blog] [ Xing] [ MVP]

  • Not able to attach Adventure works Database to SQL server 2012 Management studio

    Hello
    while i try to attach AdventureWorks2012 database to SQL Server 2012 Management Studio i am getting the following error
    Msg 1813, Level 16, State 2, Line 1
    Could not open new database 'AdventureWorks2012'. CREATE DATABASE is aborted.
    Msg 948, Level 20, State 1, Line 1
    The database 'AdventureWorks2012' cannot be opened because it is version 705. This server supports version 662 and earlier. A downgrade path is not supported.
    Kindly help me in this regard
    Thanks
    Joey

    Hi,
    You can use the following query to achieve the version of SQL Server.
    Select @@version
    As the previous comments, you can either upgrade to SQL Server 2012 or attach the AdventureWorks2008 database in the link which KevinNicholas provided.
    Additional information:
    How to determine the version and edition of SQL Server and its components
    http://support.microsoft.com/kb/321185/en-us
    Upgrade to SQL Server 2012 Using the Installation Wizard (Setup)
    http://technet.microsoft.com/en-us/library/ms144267.aspx
    Thanks.
    Tracy Cai
    TechNet Community Support

  • SQL Server 2012 Management Studio: How to install AdventureWorks2012_Data.mdf file to the Databases of my SQLEXPRESS?

    Hi All,
    I just downloaded AdventureWorks2012_Data.mdf file from
    http://msftdbprodsamples.codeplex.com/releases/view/55330 to my C:/ Downloads folder.  I don't know how to install this AdventureWorks2012_Data.mdf file to the Databases (in Object Explorer) of the \SQLEXPRESS of my SQL Server 2012 Management
    Studio.  Please kindly help, advise and respond.
    Thanks in advance,
    Scott Chang

    Hi Olaf Helper, Thanks for your response.
    As you  and https//msdn.microsoft.com/en-us/library/ms190209.aspx instructed, I tried to attach the AdventureWorks2012_Data.mdf file (Using SQL Server Management Studio) to my Databses. After I did Steps 1 & 2, (in Step 3) I clicked on
    Add, and tried to locate the AdventureWorks2012_Data.mdf file in my C:/Users/e1enxshc/Downloads folder: this mdf file was not there in the "Select the file" box!!!??? I am pretty sure that mdf file has been downloaded into that "Downloads"
    folder.  I am lost completely.  Please kindly help, advise me what it is going wrong in my "Attach" the mdf file to my Databases of SQLEXPRESS, and respond.
    Thanks,
    Scott Chang
    ===============================================
    Hi Prashanth,
    I cannot find/locate the
    http://serverintellect.com/sqlserver/sql-database-attach/ in my internet websites to do the "Attach" task I need badly. Please tell me where I can find/locate/access that website>
    Thanks,
    Scott Chang
    ==================================================== 
    P.S. I moved the AdventureWorks2012_Data.mdf file to my C:\Temp folder and did the "Add" again. It located the mdf file. I added the AdventureWorks as the name of Database in SQLEXPRESS, then I clicked Add. I got the following fatalerror:
    Failed to retrieve data for this request. (Micosoft....)
    ADDITIONAL INFORMATION:    mICROSOFT sql sERVER, eRROR:5123).
    wHY DOES IT NOT WORK EITHER? 

Maybe you are looking for