Share via

OneNote and embedded SQL Files

Anonymous
2016-06-02T20:11:15+00:00

I have embedded a .sql file into One Note 2010.  When double clicking the file to open, it does open in SQL Server Management Studio 2012.  However, the script will not execute because it say:  

Cannot execute script

Could not find part of the path. 

–then gives a path location

Example:

D:\Users\Name\AppData\Local\OneNote\14.0\NT\2\Test.sql

I can copy and paste the script from SSMS and paste into another SSMS window and it will execute.  It seems like One note creates a temp folder and file, opens the file in SSMS then deletes it because the path it says it can not find really is not there.  So where did it get that path?  Any help would be appreciated!

-Thanks

Microsoft 365 and Office | OneNote | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

7 answers

Sort by: Most helpful
  1. Anonymous
    2016-06-20T19:18:35+00:00

    Yep, but it might not work.

    Try it out by going to default programs and setting SMSS to default for .sql files.

    I was thinking of just linking to a onedrive folder like http://onedrive/randomSQLfolder/

    That works around that problem.

    Was this answer helpful?

    0 comments No comments
  2. Anonymous
    2016-06-20T18:46:31+00:00

    I liked the idea of having th sql file on one drive and create a link to them.  I tried this but the link just opens the sql file in the text edition and doesn't open the native application SSMS.  Is there a way to have the .sql file open in a specific application on the user computer?

    Was this answer helpful?

    0 comments No comments
  3. Anonymous
    2016-06-19T15:04:51+00:00

    This is not really what OneNote is best at. Keeping SQL files.

    It happens because of that path issue which you are describing.

    Instead consider putting your SQL files in a OneDrive folder and just link to them in the notebook with a hyperlink.

    That should eliminate your issue and still keep the files avaliable. It will also be easier to share the files and prevent your notebook from growing to large.

    Was this answer helpful?

    0 comments No comments
  4. Anonymous
    2016-06-15T17:23:14+00:00
    1. It happens will all .sql files.
    2. No, I have embedded .sql files many times with the same result each time.

    3.  I have not had any issues with other files types to this point.

    This is not the first time it happened and can be reproduced with any .sql file embedded in one note.

    you can make a file called test.sql and put in the text document the following only

    select getdate()

    Save this file with the above content and place in One Note.  Double click on it to have it open in SSMS 2012 and try to execute.

    Let me know if you encounter the same issue as myself.

    Thanks.

    Was this answer helpful?

    0 comments No comments
  5. Anonymous
    2016-06-03T18:15:59+00:00

    Hi,

    Please share a few details:

    1. Is it happening with only one .sql file embedded into OneNote 2010 or does this issue happen with all such embedded .sql files?
    2. Is this the first time you have tried embedding and opening a .sql file from OneNote?
    3. Have you experienced similar issues with opening any other type of embedded file from OneNote?

    If this is the first time you are experiencing this issue then we need to reproduce this issue.

    I request you to send us a sample SQL file and also explain how you went about embedding it into OneNote and how you try opening the embedded .sql file from OneNote 2010.

    Hope this information helps. Reply us with the updated status of the issue to assist you further.

    Thank you.

    Was this answer helpful?

    0 comments No comments