An exception occurred while executing a transact-sql statement or batch












1















I keep getting the error message:




an exception occurred while executing a transact-sql statement or batch




when trying to do anything in SQL Server Management Studio 2016.



This occurs when I try to create or edit a login, when I try to create a new database, basically when I do anything.



I tried the solution given in SQL Server 2008 R2 Express permissions -- cannot create database or modify users but I can't edit the Startup Parameters specified in step 6.



Can anyone explain what the issue is and how to solve it?










share|improve this question




















  • 2





    can you post the exact code you attempt to run in the batch. You say when you "do anything", what about select 1?

    – scsimon
    Dec 28 '16 at 22:02











  • that's the thing. i haven't even created a database yet or coded anything. i have just installed the software and this error keeps happening from the get-go.

    – krishna
    Dec 28 '16 at 22:04






  • 1





    you are logging in as the sa account you set up during installation?

    – scsimon
    Dec 28 '16 at 22:08











  • Did you right-click the installation and choose "Run as Administrator"? Also, check your permissions for each SQL service you're installing, especially the db-engine--best to use an Adminstrator-type account cheers

    – mike morris
    Dec 29 '16 at 1:43











  • Service account don't have permissions. Open configuration manager and get account name. Right click on folders (where is sql server, your default paths) and go to security and add user from conf. manager. Other options are firewall, security software, port config or there are missing system databases (like tempdb). Need more info.

    – Deadsheep39
    Dec 29 '16 at 13:42


















1















I keep getting the error message:




an exception occurred while executing a transact-sql statement or batch




when trying to do anything in SQL Server Management Studio 2016.



This occurs when I try to create or edit a login, when I try to create a new database, basically when I do anything.



I tried the solution given in SQL Server 2008 R2 Express permissions -- cannot create database or modify users but I can't edit the Startup Parameters specified in step 6.



Can anyone explain what the issue is and how to solve it?










share|improve this question




















  • 2





    can you post the exact code you attempt to run in the batch. You say when you "do anything", what about select 1?

    – scsimon
    Dec 28 '16 at 22:02











  • that's the thing. i haven't even created a database yet or coded anything. i have just installed the software and this error keeps happening from the get-go.

    – krishna
    Dec 28 '16 at 22:04






  • 1





    you are logging in as the sa account you set up during installation?

    – scsimon
    Dec 28 '16 at 22:08











  • Did you right-click the installation and choose "Run as Administrator"? Also, check your permissions for each SQL service you're installing, especially the db-engine--best to use an Adminstrator-type account cheers

    – mike morris
    Dec 29 '16 at 1:43











  • Service account don't have permissions. Open configuration manager and get account name. Right click on folders (where is sql server, your default paths) and go to security and add user from conf. manager. Other options are firewall, security software, port config or there are missing system databases (like tempdb). Need more info.

    – Deadsheep39
    Dec 29 '16 at 13:42
















1












1








1


0






I keep getting the error message:




an exception occurred while executing a transact-sql statement or batch




when trying to do anything in SQL Server Management Studio 2016.



This occurs when I try to create or edit a login, when I try to create a new database, basically when I do anything.



I tried the solution given in SQL Server 2008 R2 Express permissions -- cannot create database or modify users but I can't edit the Startup Parameters specified in step 6.



Can anyone explain what the issue is and how to solve it?










share|improve this question
















I keep getting the error message:




an exception occurred while executing a transact-sql statement or batch




when trying to do anything in SQL Server Management Studio 2016.



This occurs when I try to create or edit a login, when I try to create a new database, basically when I do anything.



I tried the solution given in SQL Server 2008 R2 Express permissions -- cannot create database or modify users but I can't edit the Startup Parameters specified in step 6.



Can anyone explain what the issue is and how to solve it?







sql-server tsql ssms ssms-2016






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited May 23 '17 at 11:47









Community

11




11










asked Dec 28 '16 at 22:00









krishnakrishna

118115




118115








  • 2





    can you post the exact code you attempt to run in the batch. You say when you "do anything", what about select 1?

    – scsimon
    Dec 28 '16 at 22:02











  • that's the thing. i haven't even created a database yet or coded anything. i have just installed the software and this error keeps happening from the get-go.

    – krishna
    Dec 28 '16 at 22:04






  • 1





    you are logging in as the sa account you set up during installation?

    – scsimon
    Dec 28 '16 at 22:08











  • Did you right-click the installation and choose "Run as Administrator"? Also, check your permissions for each SQL service you're installing, especially the db-engine--best to use an Adminstrator-type account cheers

    – mike morris
    Dec 29 '16 at 1:43











  • Service account don't have permissions. Open configuration manager and get account name. Right click on folders (where is sql server, your default paths) and go to security and add user from conf. manager. Other options are firewall, security software, port config or there are missing system databases (like tempdb). Need more info.

    – Deadsheep39
    Dec 29 '16 at 13:42
















  • 2





    can you post the exact code you attempt to run in the batch. You say when you "do anything", what about select 1?

    – scsimon
    Dec 28 '16 at 22:02











  • that's the thing. i haven't even created a database yet or coded anything. i have just installed the software and this error keeps happening from the get-go.

    – krishna
    Dec 28 '16 at 22:04






  • 1





    you are logging in as the sa account you set up during installation?

    – scsimon
    Dec 28 '16 at 22:08











  • Did you right-click the installation and choose "Run as Administrator"? Also, check your permissions for each SQL service you're installing, especially the db-engine--best to use an Adminstrator-type account cheers

    – mike morris
    Dec 29 '16 at 1:43











  • Service account don't have permissions. Open configuration manager and get account name. Right click on folders (where is sql server, your default paths) and go to security and add user from conf. manager. Other options are firewall, security software, port config or there are missing system databases (like tempdb). Need more info.

    – Deadsheep39
    Dec 29 '16 at 13:42










2




2





can you post the exact code you attempt to run in the batch. You say when you "do anything", what about select 1?

– scsimon
Dec 28 '16 at 22:02





can you post the exact code you attempt to run in the batch. You say when you "do anything", what about select 1?

– scsimon
Dec 28 '16 at 22:02













that's the thing. i haven't even created a database yet or coded anything. i have just installed the software and this error keeps happening from the get-go.

– krishna
Dec 28 '16 at 22:04





that's the thing. i haven't even created a database yet or coded anything. i have just installed the software and this error keeps happening from the get-go.

– krishna
Dec 28 '16 at 22:04




1




1





you are logging in as the sa account you set up during installation?

– scsimon
Dec 28 '16 at 22:08





you are logging in as the sa account you set up during installation?

– scsimon
Dec 28 '16 at 22:08













Did you right-click the installation and choose "Run as Administrator"? Also, check your permissions for each SQL service you're installing, especially the db-engine--best to use an Adminstrator-type account cheers

– mike morris
Dec 29 '16 at 1:43





Did you right-click the installation and choose "Run as Administrator"? Also, check your permissions for each SQL service you're installing, especially the db-engine--best to use an Adminstrator-type account cheers

– mike morris
Dec 29 '16 at 1:43













Service account don't have permissions. Open configuration manager and get account name. Right click on folders (where is sql server, your default paths) and go to security and add user from conf. manager. Other options are firewall, security software, port config or there are missing system databases (like tempdb). Need more info.

– Deadsheep39
Dec 29 '16 at 13:42







Service account don't have permissions. Open configuration manager and get account name. Right click on folders (where is sql server, your default paths) and go to security and add user from conf. manager. Other options are firewall, security software, port config or there are missing system databases (like tempdb). Need more info.

– Deadsheep39
Dec 29 '16 at 13:42














2 Answers
2






active

oldest

votes


















0














Thanks to everyone who tried to answer the question, but I was able to solve it. It is the same procedure mentioned in SQL Server 2008 R2 Express permissions -- cannot create database or modify users. However, in step 6 instead of adding "-m" to an existing parameter, you have to create a new parameter called "-m" and follow the remaining steps. This resolved the issue.






share|improve this answer

































    0














    I got same issue but when i tried with query it was succeeded. try below



    CREATE DATABASE databasename;





    share|improve this answer























      Your Answer






      StackExchange.ifUsing("editor", function () {
      StackExchange.using("externalEditor", function () {
      StackExchange.using("snippets", function () {
      StackExchange.snippets.init();
      });
      });
      }, "code-snippets");

      StackExchange.ready(function() {
      var channelOptions = {
      tags: "".split(" "),
      id: "1"
      };
      initTagRenderer("".split(" "), "".split(" "), channelOptions);

      StackExchange.using("externalEditor", function() {
      // Have to fire editor after snippets, if snippets enabled
      if (StackExchange.settings.snippets.snippetsEnabled) {
      StackExchange.using("snippets", function() {
      createEditor();
      });
      }
      else {
      createEditor();
      }
      });

      function createEditor() {
      StackExchange.prepareEditor({
      heartbeatType: 'answer',
      autoActivateHeartbeat: false,
      convertImagesToLinks: true,
      noModals: true,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: 10,
      bindNavPrevention: true,
      postfix: "",
      imageUploader: {
      brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
      contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
      allowUrls: true
      },
      onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      });


      }
      });














      draft saved

      draft discarded


















      StackExchange.ready(
      function () {
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f41370308%2fan-exception-occurred-while-executing-a-transact-sql-statement-or-batch%23new-answer', 'question_page');
      }
      );

      Post as a guest















      Required, but never shown

























      2 Answers
      2






      active

      oldest

      votes








      2 Answers
      2






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      0














      Thanks to everyone who tried to answer the question, but I was able to solve it. It is the same procedure mentioned in SQL Server 2008 R2 Express permissions -- cannot create database or modify users. However, in step 6 instead of adding "-m" to an existing parameter, you have to create a new parameter called "-m" and follow the remaining steps. This resolved the issue.






      share|improve this answer






























        0














        Thanks to everyone who tried to answer the question, but I was able to solve it. It is the same procedure mentioned in SQL Server 2008 R2 Express permissions -- cannot create database or modify users. However, in step 6 instead of adding "-m" to an existing parameter, you have to create a new parameter called "-m" and follow the remaining steps. This resolved the issue.






        share|improve this answer




























          0












          0








          0







          Thanks to everyone who tried to answer the question, but I was able to solve it. It is the same procedure mentioned in SQL Server 2008 R2 Express permissions -- cannot create database or modify users. However, in step 6 instead of adding "-m" to an existing parameter, you have to create a new parameter called "-m" and follow the remaining steps. This resolved the issue.






          share|improve this answer















          Thanks to everyone who tried to answer the question, but I was able to solve it. It is the same procedure mentioned in SQL Server 2008 R2 Express permissions -- cannot create database or modify users. However, in step 6 instead of adding "-m" to an existing parameter, you have to create a new parameter called "-m" and follow the remaining steps. This resolved the issue.







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited May 23 '17 at 10:30









          Community

          11




          11










          answered Dec 29 '16 at 16:39









          krishnakrishna

          118115




          118115

























              0














              I got same issue but when i tried with query it was succeeded. try below



              CREATE DATABASE databasename;





              share|improve this answer




























                0














                I got same issue but when i tried with query it was succeeded. try below



                CREATE DATABASE databasename;





                share|improve this answer


























                  0












                  0








                  0







                  I got same issue but when i tried with query it was succeeded. try below



                  CREATE DATABASE databasename;





                  share|improve this answer













                  I got same issue but when i tried with query it was succeeded. try below



                  CREATE DATABASE databasename;






                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Feb 5 at 16:24









                  Lahiru GamageLahiru Gamage

                  153421




                  153421






























                      draft saved

                      draft discarded




















































                      Thanks for contributing an answer to Stack Overflow!


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid



                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.


                      To learn more, see our tips on writing great answers.




                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function () {
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f41370308%2fan-exception-occurred-while-executing-a-transact-sql-statement-or-batch%23new-answer', 'question_page');
                      }
                      );

                      Post as a guest















                      Required, but never shown





















































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown

































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown







                      Popular posts from this blog

                      Create new schema in PostgreSQL using DBeaver

                      Deepest pit of an array with Javascript: test on Codility

                      Costa Masnaga