SQL Server 2012 Script files and Projects :-
SSMS allows you to create and save T-SQL code in text files, typically given a .sql file extension. Like other Windows applications that open, edit, and save files, SSMS provides access to file management through the File menu and through standard toolbar buttons.In addition to directly manipulating individual script files, SSMS provides a mechanism for initially saving groups of files together and for opening, saving, and closing them together. This mechanism uses several conceptual layers to work with T-SQL script files and related documents, and uses the Solution Explorer pane to display and control them:
Differences of SQL Server 2012 Solution,Project and Script :-
Object
|
Parent
|
Description
|
Solution
|
None
|
Top-level container for projects. Stored as a text file with an
.ssmssln
extension, which references components contained within it.
May contain multiple projects.
Displayed in Solution Explorer at the top of the object hierarchy.
|
Project
|
Solution
|
Container for T-SQL scripts
(called queries), stored database connection metadata, and miscellaneous files.
Stored as a text file with an
ssmssqlproj extension, which references component scripts and other files.
|
Script
|
Project
|
T-SQL script file with a
.sql extension. The core item of work in SSMS.
|
How to Create SQL Server 2012 Solution :-
To create a new solution, click the File menu and click New Project. (There is no “New Solution” command.)
Specify a name for the initial project, its parent solution, and whether you want the project to be
stored in a subfolder below the solution file in the location you indicate. Click OK to create the objects.
new script that will be stored as part of the project, right-click the Queries folder in the project and click New Query.
Using the New Query toolbar button or the new query commands on the File menu
This will create a new script temporarily stored with the solution in the Miscellaneous Files folder.
If you wish to move an existing open query document into a solution currently open in
Solution Explorer, you will need to save the file. Then you can drag the query into the
project tree to save it in the Queries folder. This will make a copy of the script file and place
it into the solution.
Shortcut Key to Save SQL Server 2012 Query : Ctrl + S






No comments:
Post a Comment