SQL Server 2008 Sql snippets - sql-server-2008

I think that this is a relatively simple question. I just want to know if you are able to save or use SQL snippets like you can in Visual Studio, but within SQL Server Management Studio? I've had a browse but couldn't find anything.

Dragging a Template item into the current query is handy (You can create your own & "file" them in their own hierarchy), and the SMSS Tools Pack addin provides a Snippet function.

Related

Missing LINQ to SQL Classes (DBML designer) in Visual Studio 2017 RC

How can I add LINQ to SQL class (.dbml file) to Visual Studio 2017 RC. I can't find it. Please help, thanks.
You need to opt in to enable the designer during installation, it is not enabled by default: https://developercommunity.visualstudio.com/content/problem/4616/linq-to-sql-dbml-designer-in-not-working.html
"Editing .dbml files with a designer surface requires the LINQ to SQL tools which are not installed by default as part of any of the workloads of Visual Studio 2017. It can be installed by selecting the 'LINQ to SQL tools' item under the 'Code Tools' category in the 'Individual Components' tab of the Visual Studio installer."
By default VS 2017 installer doesn't provide LINQ to SQL tools while installing we have to select that and modify.
Follow easy steps from here:
Open VS2017 installer.
Go to Individual Components.
Select he LINQ To SQL tools from code tools.
and just modify.
or check this screenshot you will get the idea.
Steps:
Open VS 2017
Go to Tools -> Get Tools and Features
Click on Individual Components tab
Scroll down, you will find "Linq to Sql tools" under Code tools category
Check and click on Modify. It will install the component, its around 6 mb
SuperUser.com also contains a nice answer
Basically you need to modify your VS2017 installation and add the standalone Linq-to-Sql component.
Open Vs 2017 installer, go to individual components and check LINQToSQL component then click modify button.
​If, you use the DotNetCore. Linq to SQL doesn't show the option. To use Linq to SQL, you need to select DotNetFrameWork then you'll have an option to select Linq to SQL. It worked for me.

SQL server management studio review script like MySQL Workbanch

In MySQL Workbench, you are able to preview a script before it is applied. Ex:
1.) Select * from any_table
2.) Modify one a value in one of the rows returned
3.) Click apply
4.) you are presented with a review script dialogue before it is applied (See image)
Does SQL Server Management Studio have similar functionality
This seems pretty similar to the following SQL Server Management Studio functionality:
From the SQL Server Management Studio object explorer window, right click on a table then:
"Script Table as"
"Update to"
"New Query Editor Window"
Long story short: no there is nothing that allows you to view the scripted out edit of live data similar to that. The best SSMS has to offer is the "edit top 200 rows" option and then editing the SQL behind it to accomodate for where clauses etc...
It will automically script out and run the script right when you make the data change. But there is not really a "Review" piece to it.
Would be nice though...

Microsoft SQL Server Management Studio: creating scripts like in mySQLWorkbench

I just wanted to know if Microsoft's Studio has the following functionality of mySQLWorkbench:
After inserting, updating, deleting etc. cols in mySQLWorkbench using GUI, you clik on "Apply" and a new window pops up where you have your complete query according to changes you have made.
On the other side Microsoft's Server only offers that the user generates some predefined scripts, which should be changed manually each time.
So, perhaps i missed it, i want to be sure:
Does "Microsoft SQL Server Management Studio" offer the described functionality of "mySQLWorkbench" ?
mySQLWorkbench isn't primarily a Databse-Frontend, it's a Design- and Development IDE that could connect a Database-Server.
The Managementstudio is to manage and Maintain Servers. It#s intended to do a different Job though. But: you can do almost anything by drag and drop and by context menus you could get the resulting code to copy/paste or save it.
There is one important difference: With the Workbench you design in theory and might connect a server. With the MS SQL Management-Studio you always manipulate a real Server. That's why i've got here a Deploy Server, One Hot-Standby and a Developmentserver (Developeditions are quite cheap) for Development and Testing.
Transact SQL is something one should learn and understand as you will need it for stored procedures or trigger-programming. GUI clicking is nice to have, but at a certain point you will have to know what GUI is doing or will have to start your Editor. The Transact SQL Help is quite good. Just start!
Yes. Right-click on "Tables" and choose "New Table.." or right-click on an existing table and choose "Design". Make your changes in the designer, then right-click in the top pane and choose "Generate Change Script..."

SQL Server 2008 - Keyboard Shortcut Key to do SQL Query Formatting

Do you know the Keyboard shortcut key in SQL Server 2008 Management Studio to do SQL Query Formatting?
I hope this will help future readers if OP is already found the solution.
There is no built in formatting in SSMS but there are free SSMS Addins such as ApexSQL Refactor you can use for this.
Apart from this you can also try SSMS tools pack but note that it’s not free for SQL 2012.
Another great tool for this is Red-Gate SQL Prompt Pro which allows you to define your own SQL coding style, and easily reformat any crappy SQL code that gets dumped on you :-)
It's not free - but easily worth every penny it costs!
there are no built in formatting functions like a Beautifier or Formatter program.
tab (including while a section of code is selected), space, backspace, delete, etc. and the expected ones. I use alt+mouse click+drag to select "square" sections of code.
here are all of the SQL Server Management Studio Keyboard Shortcuts
Are you looking for something like this: Format SQL Beautifier
software ??
Ctrl + Shift + Q will give you a Query Designer window from which you can copy formatted query.
Their is no shortcut keys in sql server 2008,2010,2014,2015...
The simple way visit http://www.sql-format.com/ and format.

SSRS and MDX causes VStudio to crash

I am trying to generate a report using reporting services in visual studio 2005. the data source is in MDX DB and was created successfuly. When I save the query in the query builder window it closes and displays an alert : "the query cannot be read from the query window, please check for syntax errors"
and then VS crushes!
the query has no parameters and works on management studio without any problems.
I have installed all of my win updates, but sql server sp3 (that had a problem)
I also have service pack 2 for my framework
any idea what is going on?
try pasting from VS into notepad (or SSMS) and then copy from notepad (or SSMS) back into VS to make sure that there are not any "strange" characters (like smart quotes). It's vaugely possibly that SSMS is stripping these out when you paste into it.
Otherwise it may be an issue with your failed SP3 install.