create linked server without management studio - sql-server

I've installed Microsoft SQL Server 2008 and only got the Database Engine, not sure what to do with it.
Is it possible to create linked server without Microsoft SQL Server Management Studio? Without the MSSMS, there is no GUI to create the linked server, so it could be script or command I guess. So how should I do it?

Why choose? For as long as I can remember (going back to SSMS 2005), most dialogs have had a script button on them. So fill out the form and instead of hitting okay, hit the Script button and SSMS will show you the commands it would have ran. I often use this as a boostrap when I'm doing something I haven't done before. That is, I'll fill in the wizard, hit the script button, and then read the docs to see if I agree with everything it's doing.

Related

Can't find Microsoft SQL Server even if it is installed?

Regarding the following images, I have obviously installed the Microsoft SQL Server, but I can't find the exe-file or anything named Microsoft SQL Server in the start menu.
Anyone who knows what to do to solve this, or do I need to install something more?
SQL Server runs as a service. You can start and stop it from windows services. SSMS is a gui tool for managing ddl (creating and altering tables and index's for example) and dml (writing queries to inquire, update or add data to databases).SSMS comes free with every edition of SQL server - perhaps you didn't tick a box when installing? You can also do this stuff the old fashioned way using sqlcmd from command line(DBAs love this for some reason) but for us mortals SSMS is much less of a struggle. As an aside there are other guis such as Toad (expensive) and Heidisql (free) amongst others which will do the job.
Looks like you have the engine. What you've got to do now is install SQL Server Management Studio: https://msdn.microsoft.com/hr-hr/library/mt238290.aspx
Looks like you have the various SQL Server components that are installed by Visual Studio (recent version) or SQL Server Data Tools (as used by VS).

Can Visual Studio replace MS Sql Server Manager?

I've been using Dreamweaver and MS SQL Server Management tool. I've recently got Visual Studio 12. I would like to only use Visual Studio.
When I right click on a table in the db I don't get the Script Table As options.
No, and it's not intended to. SSMS has a lot of functionality which Visual Studio's Server Explorer doesn't, and shouldn't, attempt to reproduce.
For certain use cases, you may only need the functionality exposed within Visual Studio. But I wouldn't want to be without SSMS and all of the tools it includes. Trying to limit your usage to only VS sounds like cutting off your nose to spite your face.
If you want to have a complete administration of your database I would recommend you to use MS SQL Server Management tool, because you can to do tasks like:
Administrator privileges
Security
Maintenance plans
(Only mentioning a couple of tasks. There are more.)
If you want to create a fast DB with the basic tasks with VStudio will be enough.
I will write a couple of links that you can visit, I hope this can help you more:
SQL Server- video tutorials
MsSQL - Tutorials

Missing Diagram folder in Database Explorer at Visual Studio 2012

I was in a middle of designing a website when suddenly Database Diagram folder just disappeared from the Database Explorer. I have no idea what happened and what to do right now, as I desperately need it to continue my work - adding tables to database manually are not an option for me.
I've been seeking for the solution for a whole day, and I even re-installed the Visual Studio and local IIS server, but it wasn't helpfull at all.
Is there any way to bring the feature back or at least is there any free tool that would work on Windows 8 x64 and has diagram-based database designer for MSSQL 2008?
EDIT
It seems that Microsoft removed the diagramming for purpose. Which is pretty logical in a business logic - why would somebody buy Server Management Studio if they have basic tool (diagramming) built in Visual Studio?
1) Database Diagram is a feature of SQL Server, not Visual Studio. I am not sure what VS uses to display that folder but you might want to verify with your DBA or check the configuration of the database to see if someone has not just disabled the ability to use diagrams. Have you tried refreshing your connection to the database server as well?
2) How is adding tables to a database manually not an option? If you get yourself dependent on doing things one way and only that one way you are setting yourself up for disaster in future projects, as you are in your current one. There are other ways from within VS to create a table, it just may not be a graphical picture that diagrams offers.
3) Have you looked at the database through SSMS to see if the diagrams folder shows up there?
Hello this has been my solution that worked for me and enabled me to use database diagram ide in visual studio 2012!!
First i installed SQL Server Management Studio. I then noticed that i still did not have SQLEXPRESS Service or SQL Agent Browser in my computer services either.. This was why i assume i couldn't login to any of the SSMS which was annoying. I then downloaded SQL Server Express R2 which then ran me though another setup which was fine. I did also choose to put a sql server password for SQL Server Express.
Once installed I double checked to make sure the services where running by right clicking MY COMPUTER / MANAGE / SERVICES -- scroll down till you see "SQL Server (SQLEXPRESS)" and make sure that the service has started and also "SQL Server Agent (SQLEXPRESS)" (this one was turned off when i checked) .. i was then able to login to SSMS without a problem.
I then created a new database, right clicked diagram like we always do in VS and created a diagram with two tables, created their relationships blah blah..
i then created a new website in vs 2012, i clicked "Connect To Database" in the SERVER EXPLORER"
I choose my server name, used windows authenication and selected the database i just created in SSMS.
Then to my suprise i now have database diagram designing in Visual Studio 2012.. Finally!
Thankyou microsoft for removing such a cool feature which now gives us developers a few things to do.
Hope this helps.

restore tabs after reopening SQL Server Management Studio

I don't suppose there's a way to emulate a FireFox-type of setup, whereby if I close SQL Server Management Studio (2008) my open tabs will be there again when I restart? I know I can save the individual windows into a .sql file but was wondering if there was a way for those tabs to reopen with the text in them on their own.
Any third party tools that do something like this, perhaps? Thanks for the advice.
-Larry
There is a built-in way to do mostly this, but it is not going to open any random tabs that were there when you closed SSMS.
You can create a Solution in SSMS and save it with any set of SQL scripts. This works much like Visual Studio. You can even save connections (server + login info). The FILE menu has options to "Close Solution" as well as "Open Project/Solution" and "Recent Projects and Solutions".
So, if you create a Solution, add some Queries (i.e. .sql scripts), and then close the solution either via the FILE menu or just closing SSMS, when you open that Solution again it will restore the tabs that you had open at the time the Solution / SSMS was closed.
I just tested this in SSMS 2012, though it might have started as far back as SQL Server 2005. Even if not in 2005, this feature should definitely be in 2008 / 2008 R2.
Not exactly as open-ended as the FireFox / Chrome feature as it requires a defined Solution with defined .sql files, but definitely close.
SSMS Tools pack (free up to SSMS 2008, for SSMS 2012 as paid upgrade)
Red Gate Tab Magic (no more standalone)
SQL Prompt
How about running the Studio inside a VMWare and simply suspend the VMWare between sessions?
For my development purposes I use a VMWare that only runs an instance of SQL Server and the Mangement Studio. Maybe it's overkill for DB development but it helps in testing the integration of the database into a networked environment.
Redgates SQLPrompt does exactly this. When you close you session (on purpose or if the session crashes), all previously open tabs will launch automatically when SSMS is reopened. If you choose not to automatically launch these tabs, they’re still available via the Tab History option.
The tool does cost money but the intellisense and Snippets feature that accompany it makes it value for money.

ASP.NET MVC Tutorials using SQLServer?

How can I use SQLServer (instead of SQL Express) as my database?
I'm trying to go thru the ContactManager tutorial, but I can't seem to get it to use SQLServer - when I pick SQLServer from the "Add New Item" dialog, I get an error telling me that SQL Express isn't installed.
I know I must be missing something basic...
Most tutorials on the ASP.NET site are written in such a way, that you don't have to buy any software to do them. They use Visual Studio Express and SQL Express in their examples.
However, You can still follow along with the tutorial. Just make a few adjustments. Go to the Server Explorer to create a Connection to your SQL Server, and create the database and tables.
Then when it comes to the step of creating the EntityDataModel, create a new connection to the database you just created.
Only SQL Express can attach your database at runtime. If you have a non express version of SQL Server you will need to create the SQL Server using SSMS. If you want the file to physically live in app_data then when asked where to put the database file and the ldf indicate the app_data folder. Once you have created it, it is easy enough to simply add it as an exsisting item, although it can't be checked into source safe without creating obvious issues. I hope this helps.
If you're using a full-fledged instance of SQL Server, you don't need to use the "Add New Item" dialog at all. Rather, connect to your SQL Server instance (via Visual Studio or SQL Server Management Studio), and create the new database there.

Resources