{"id":952,"date":"2008-12-09T08:00:38","date_gmt":"2008-12-09T16:00:38","guid":{"rendered":"http:\/\/www.sapien.com\/blog\/2008\/12\/08\/primalscript-2009-and-sql-2\/"},"modified":"2009-01-20T10:40:26","modified_gmt":"2009-01-20T18:40:26","slug":"primalscript-2009-and-sql-2","status":"publish","type":"post","link":"https:\/\/dev.sapien.com\/blog\/2008\/12\/09\/primalscript-2009-and-sql-2\/","title":{"rendered":"PrimalScript 2009 and SQL"},"content":{"rendered":"<p><a href=\"http:\/\/www.primaltools.com\">PrimalScript 2009<\/a> has expanded its support for SQL in several major ways. Primary among these are the addition of SQL PrimalSense and the ability to edit and save stored procedures directly within a database. Let\u2019s take a quick look at some of these new features.<\/p>\n<p>Before you can work with SQL, you should first create a connection to a database. Open the Database Browser in PrimalScript and right click in the pane. Select \u201cCreate a new connection.\u201d Immediately name the connection. Fill in the connection dialog boxes and press OK.\u00a0 (If you are connecting to a SQL Server 2008 database you may want to select the \u201cAll\u201d tab and set \u201cPersistent Security Info\u201d to TRUE in order for the connection to remember your password.) Your new connection is now ready to go!<br \/>\nSo what can you do with this connection? One thing you can do is to drag that connection onto your script to add a connection string. It will place the full connection string right at the caret position. (The text below is split across two lines using the PowerShell line continuation character for clarity.\u201d)<\/p>\n<p><a href=\"http:\/\/www.sapien.com\/blog\/wp-content\/uploads\/2008\/12\/picture22.png\"><img loading=\"lazy\" decoding=\"async\" style=\"border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px\" title=\"Picture 2\" src=\"http:\/\/www.sapien.com\/blog\/wp-content\/uploads\/2008\/12\/picture2-thumb2.png\" border=\"0\" alt=\"Picture 2\" width=\"244\" height=\"122\" \/><\/a>\u00a0<\/p>\n<p>You can also work directly with the tables in your connection. Go ahead and click on the + sign next to the connection name. Below you will see \u201cProcedures\u201d, \u201cViews\u201d and \u201cTables\u201d.\u00a0 Expand the \u201cProcedures\u201d node and take a look at the stored procedures in your database. Double click on one and the proc will be displayed in a document window as an \u201cAlter Procedure\u201d script.<\/p>\n<p>\u00a0<a href=\"http:\/\/www.sapien.com\/blog\/wp-content\/uploads\/2008\/12\/image4.png\"><img loading=\"lazy\" decoding=\"async\" style=\"border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px\" title=\"image\" src=\"http:\/\/www.sapien.com\/blog\/wp-content\/uploads\/2008\/12\/image-thumb2.png\" border=\"0\" alt=\"image\" width=\"380\" height=\"339\" \/><\/a><br \/>\nAt this point, you can easily alter your stored procedure. PrimalScript 2009 has added SQL PrimalSense support, so at any time you can press CTRL+space to pop up a list of tables, views and stored procedures that are available within your database.<br \/>\nBut PrimalSense works even better! Bring up the database toolbar to set the current connection to the connection you want to use. In a new (or opened) SQL document start typing a SQL statement. After typing four characters, if PrimalSense recognizes the characters as belonging to an object in that connection, it will pop up a list of tables, procs, columns, etc. and select the first match.<\/p>\n<p><a href=\"http:\/\/www.sapien.com\/blog\/wp-content\/uploads\/2008\/12\/picture6.png\"><img loading=\"lazy\" decoding=\"async\" style=\"border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px\" title=\"Picture 6\" src=\"http:\/\/www.sapien.com\/blog\/wp-content\/uploads\/2008\/12\/picture6-thumb.png\" border=\"0\" alt=\"Picture 6\" width=\"380\" height=\"270\" \/><\/a><\/p>\n<p>Also, typing a table name and then a period will pop up a list of fields in that table.<\/p>\n<p><a href=\"http:\/\/www.sapien.com\/blog\/wp-content\/uploads\/2008\/12\/picture5.png\"><img loading=\"lazy\" decoding=\"async\" style=\"border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px\" title=\"Picture 5\" src=\"http:\/\/www.sapien.com\/blog\/wp-content\/uploads\/2008\/12\/picture5-thumb.png\" border=\"0\" alt=\"Picture 5\" width=\"380\" height=\"270\" \/><\/a><\/p>\n<p>In response to user feedback, we moved the Visual Query Builder out of PrimalScript 2009. But don\u2019t fret, PrimalScript 2009 does offer a new Live SQL query window that enables ad-hoc query testing and live data manipulation. Simply type the query in the edit control and press Enter. Viola! Your results appear in a nicely formatted and editable table below.<\/p>\n<p><a href=\"http:\/\/www.sapien.com\/blog\/wp-content\/uploads\/2008\/12\/picture4.png\"><img loading=\"lazy\" decoding=\"async\" style=\"border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px\" title=\"Picture 4\" src=\"http:\/\/www.sapien.com\/blog\/wp-content\/uploads\/2008\/12\/picture4-thumb.png\" border=\"0\" alt=\"Picture 4\" width=\"380\" height=\"112\" \/><\/a><\/p>\n<p>The previously mentioned Visual Query Builder capability is now included in our stand-alone database front-end tool, <a href=\"http:\/\/www.primalsql.com\">PrimalSQL 2009.<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>PrimalScript 2009 has expanded its support for SQL in several major ways. Primary among these are the addition of SQL PrimalSense and the ability to edit and save stored procedures directly within a database. Let\u2019s take a quick look at some of these new features. Before you can work with SQL, you should first create [&hellip;]<\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[2,283,176,311],"tags":[415,168,38],"class_list":["post-952","post","type-post","status-publish","format-standard","hentry","category-general","category-howto","category-sneak-peeks-at-the-next-version-of-primalscript","category-primaltools","tag-primalscript-2009","tag-primalsense","tag-sql"],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/posts\/952","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/comments?post=952"}],"version-history":[{"count":8,"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/posts\/952\/revisions"}],"predecessor-version":[{"id":1055,"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/posts\/952\/revisions\/1055"}],"wp:attachment":[{"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/media?parent=952"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/categories?post=952"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/tags?post=952"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}