Learning SQL in Microsoft Visual Studio - sql

Firstly, apologies if this question is in the wrong place.
I'm a student who has literally just started learning SQL yesterday, using the SQL*Plus command-line interface. This is fine so far - I've created and populated tables, run simple queries and can spool to files etc. But I'd like a more 'visual' approach to help with my understanding (i.e. I'd like to be able to see the 'objects' as I work on them (much like BlueJ for when I started learning Java). Is this possible with any free software?
I have Microsoft Visual Studio Professional 2012 (which I'm new to) - is it possible in this? I can create a new SQL file but without a 'real world database' can I actually run commands in a similar way to the command-line SQL that I've been doing?
Any help at all would be absolutely amazing. Apologies if I'm misunderstanding anything or being simple - I've literally been using SQL*Plus etc for a few hours.

Visual Studio does support designing SQL databases. However, I think the best option for managing a database is SQL Server Management Studio.
SSMS comes with most installations of SQL Server, but if it's not installed, you will have to re-run the installer to install it.
SSMS supports running arbitrary SQL queries, as you may be used to. It also supports a powerful GUI interface (based on the VS interface) for working with all kinds of database objects. You can completely design and populate a database without manually writing any SQL. If you want, you can even make a change, and view the SQL generated to change the database.
Give it a try, and good luck learning SQL.

I was just in your boat a few months ago. I had to teach myself the .NET side of SQL with SQL Server, LINQ, and C# and wanted to share my experience with you.
The fact of the matter is, SQL Server Management Studio (SSMS) is built on top of Visual Studio. I have both SQL Server 2012, and Visual Studio 2010/2012 installed on my computer, and in my experience. Look for an extension called "SQL Connect" in Visual Studio. It supports GUI building of tables.
As far as free software, if you are a student like me, you should be eligible for the Dreamspark program. Microsoft graciously allows academic licenses for virtually all their development software (including some freebies like free copies of Windows 7 Professional, OneNote, and Lync).
Also a book I highly, highly recommend to supplement your learning is "SQL Visual Quickstart Guide (3rd Edition)" It's only ~15 dollars for the eBook. Also, the Pluralsight videos on SQL Server help a lot, which you will get a three free month trial through Dreamspark. There is also a wealth of examples on the MSDN website that teach you with the Adventureworks database, which should be on Microsoft CodePlex.
Happy learning!

Related

Is there any graphical or code first database design support in Visual Studio 2019 for non-SQL Server database?

Does Visual Studio provide any way to design a database either graphically or code-first for any database other than SQL Server apart from Entity Framework?
I'm looking at starting a new database project, possibly using Postgres (I haven't quite decided), so I'm looking for some decent tooling that supports graphical and/or code-first design, with migration support between different versions.
My inclination is to give Entity Framework a miss. I've used it before and found the abstraction to be at such a high level that it was more of a hindrence than a help when it came to optimizing and diagnosing performance issues.
I'm quite happy to use Dapper for my data access but some tooling to simplify design, versioning and migration would be very useful. If Visual Studio has some support for this I might as well check it out since I'll be using Visual Studio elsewhere on the project anyway, but I don't see anything useful in the docs.
If Visual Studio isn't going to be useful in this regard is there anything you'd recommend? Something that works with most of the main DB systems would be preferable instead of something that just works with one system.

Saving on a play SQL server?

I just started an internship position this week and I have to learn SQL to do my project. Problem is, the only server they have access to is not something I can really play around with and learn.
I asked if there was any way to make a database locally and they just told me I can add tables on to the already set up databases. I am not allowed to do anything else on it other than queries and the lesson I'm working with uses other functionalities. I can't get my program to work correctly and I'm sure the limited functionality I have has to do with it.
I would like to learn as much as possible before they are ready for me to start the actual project.
You can download SQL Server Express Edition here: https://www.microsoft.com/en-us/sql-server/sql-server-editions-express. Why not install it on your PC at home? You can then login as sa and do whatever you want. I have it installed on my PC at home. It is free.
It is worth noting that SQL Server Express does not have all the features of SQL Server Standard/Enterprise. If you require the full set of features then you can buy SQL Server Developer Edition: https://www.microsoft.com/en-us/sql-server/application-development. The Developer Edition is like the Enterprise edition, but for developers. I believe you can get it for less than £50.
I've personally not played around with these, but I keep hearing good things about them: Microsoft Virtual Labs: https://technet.microsoft.com/en-us/virtuallabs/
From what I understand, whilst designed for specific purpose, they might be flexible enough to try other concepts on as well.
Worth a short, perhaps?

Code Analysis in SQL Server

Do you know of any good (and if possible free) tool for SQL Server 2005/2008 development like there is Code Analysis and ReSharper for .NET development?
I know these are completely different programming styles (unfortunately, since I wish today's SQL syntax was like that of most modern language and not just a set of "extensions" on a poorly-designed, old syntax), but anyway some tools like those would definately come in handy.
I thought Visual Studio team edition for database professionals, "Data Dude", or whatever it is called these days had a static code analysis portion, and I am fairly certain the next version (Denali / Juneau) will as well. Of course this is not free. I don't know of any others off-hand, but for such a niche market I would suggest that either it is important to you or it isn't; if you try to focus just on free solutions, you may come up empty-handed or at least short-handed.

SQL Server 2005 Reporting Services - Pros and Cons

I am developing a web application using ASP .NET 2.0, VS 2008 and SQL Server 2005. I would like to Use SSRS 2005 for the various reports I need to build for this web application. I would like to convince the team that we should adopt SSRS as the main reporting platform for most internal and external web applications we have.
What are the pros and cons of Reporting Services? I can see many pros like tight integration with IIS, SQL Server and Visual Studio, rich presentation features and export functionality, subscription etc so I am mainly interested in negatives of SSRS.
EDIT: I understand that if I am not using VS 2005 for my application development, I will be using different Visual Studio versions for application and report development. However, I am more interested in negatives (or not so good aspects) of SSRS itself.
I know you said 2005, but I will put in notes around 2008 as well.
SRS Pros:
- It is free (provided you have the SQL server license)
- Tight data integration with SQL Server, but it handles anything .NET can (Oracle, ODBC etc...) just fine. (2008 has native support for Terradata too)
- Components for Visual Studio, SharePoint and PerformancePoint all exist to make it easy to leverage it. It is just a web app though so integration into any web page or app that can talk to a web server is easy too.
- Built in tools to do subscriptions (i.e. emails that get sent out on a regular basis to a list of people with the report on them). The list of recipients can be static people or a sharepoint site or a dynamic list of people (pulled from a DB) (08 adds support for dynamic to sharepoint too)
- 3rd party vendors exist to enhance the product
- Export to a variety of formats (XML, CSV, Excel, PDF etc...)
- Ability to design templates which power users can use to build reports without knowing SQL (since the SQL is contained in the template). Power users use a special report builder tool which is delivered via click once.
- Works differently to Crystal reports (I don't like Crystal thats why this is a pro for me)
SRS Cons:
- Charting controls look like Excel 2003 and are limited. (2008 has the Dundas controls in by default so they are much more powerful, more varied and better looking)
- Kerberos issues due to it being a web app can cause annoying problems (2008 removes that as it is no longer an IIS web app. It runs it's own web server based off the IIS core but is closer to a stand alone app - so the security issues aren't a problem)
- Designer support is a pain. 2000 Reports must be developed in VS 2003, 2005 reports must be developed in VS 2005, 2008 reports must be developed in VS 2008. By Visual Studio I mean the normal one or the thin downed version you get with the SQL Management tools.
- Compatibility. Each version of reporting services can run only the current version and one version back of the reports.
- Security is limited to Integrated Windows or Anonymous (2008 has added support for forms based security and for custom providers, like you get with ASP.NET)
One of the Cons I see with your setup, is you will have to use Visual Studio 2005 for your reporting project since you are using SSRS 2005.
Since it looks like you are using Visual Studio 2008 for your other development, this means having both versions installed and having to have both open and running most the time.
I'm in the same situation and it is a hassle, but one I've gotten used to.
EDIT:
Some of the other Cons I've run across are usually designer related. They may have been fixed in 2008 (don't know for sure), but I attribute them to the infancy of SSRS compared to other more mature reporting solutions.
Datasets changing to Text even though you set them to Stored Procedure every time you enter the data tab
Web Service datasets losing their parameters when changing the query
The expression editor is very dumbed-down. Its slightly better than using notepad.
The CONS:
Rendering might be different in Firefox or other browsers. When using SSRS ReportViewer on an ASP.NET page, just make sure to verify the look/feel/layout of the report when rendered on browsers other than IE.
One con is that with SSRS, there are so many options available to the developer that it could be confusing at first. I am talking more about whether to use Local Reports or Server Reports, whether to put code inside code modules, in reusable assemblies, or use reusable Managed Code (C#) Stored Procedures.
The biggest con I could think of in SSRS is that the code module is very basic. No intellisense and no debugging features. Also it would be great if SSRS scripting supported C# instead of just VB.NET.
While expressions are great, the problem is there is no single container/place which allows you to see all the expressions defined in a report. This could present a maintenance nightmare down the road.
That said, SSRS is a powerful tool in the hands of a seasoned developer.
Pros:
Free
Probably better tied to MS SQL than most others
Works well for most types of reporting
Cons:
Free; Support access isn't like Crystal
Doesn't have every feature other, older competitors have. Being a newer piece of software, it is still getting new functionality that other products like Crystal Reports has had for years.
I often end up running reports in whatever way they're easiest. Lately I built my own web based interface that drives any combination of PDF/HTML/Crystal/SRSS reports and delivers them. Often Crystal will do some in 2 steps, or SRSS does something else better. If I had to pick one right now as a go-to for all scenarios I'd probably pick Crystal. The more I use SRSS being a few years old and still in active feature development (catching up to products like Crystal), I can see it being used a lot more... not quite yet though.
I find SSRS is very Robust and provides a very large range of capabilities to suit your reporting needs. I have tried others (Crystal) and did not like it nearly as much. (This could just be personal taste though).
Even for a beginner, SSRS has many wizards which will get you the results you desire and for the experienced developer, you can fine tune your reports with drill-throughs, colors, coding, etc.
I honestly have nothing bad to say about SSRS. The one downside that Dustin pointed out is that your VS version and SQL version are different. I have an app that is in VS2005, but uses a SQL 2000 backend and I have to have my reports separate in a VS2003 project to get them to work properly.
In order to better provide an analysis, it would be easier to if we new what alternative you are considering. For example, if it's SSRS vs nothing then the argument is simple, likewise SSRS vs bespoke reports (eg. ASP.NET). However, if you have other reporting tools under consideration, e.g. Crystal then we can be a bit more critical. Also, what kind of reports are you planning, and what features do you ideally need.
Regardless, I'd largely agree with the other posters. SSRS is free & very capable. Other systems might have extra bells & whistles, but would these be issues that mattered, and are prepared for the costs?
I suppose, given that SSRS is free and easy enough to setup, my suggestion would be to run a trial; you'll probably be able to make your own mind up through a bit of experimentation - you've got nothing to lose!
SSRS is amazingly simple to use. We've had interns writing reports the first day on the job with SSRS, and doing a good job at in.
That simplicity goes a long way with developers who just want to get reports done quick so they can get back to actual coding.
Correct me if i'm wrong but SSRS does not use Forms Authentication. For viewing reports from a web app using the built-in components will use what ever authentication is used for the application. However for subscription and using the Report Builder application (click-once) which requires access to the Report Manager its windows authentication.
[Edit] From Robert MacLean - MSSQL 2008 does support Forms Authentication, which is a good thing.
The main problem I had was setting up Reportserver in a stage/production web-environment.
I had to get the reports out of the Reportserver Webservice into the web application. The environment looks pretty simple now, but I remember at that time it was difficult to debug.
An other issue was multilanguage reports. Again: now its easy to use, but be prepared to do some googling.
The designer is crap. Who knows what =First(Fields!Sales.Value,"DataSet1") means? I also had issues with the size of reports (the report was designed to fit on a A4 page but at the end didnt).
I still like the product. After some time I got everything solved and our trainee can design and publish great reports.
SSRS 2005
Pro integrated in Sharepoint
Cons integration in Sharepoint could be a mess to set up using Kerberos etc...
I will only put some cons here as most people have already mentioned the benefits.
SSRS 2008:
Primitive user interface
little flexibility to do fancy stuff i.e. flashy charts, geo maps (w/o lat long)
user interaction is only limited to applying filters, rest is pretty static
MS seriously has to re-think what competitors are doing in the field of BI & Data visualisation.

Would you consider using an alternative to MS SQL Server Management Studio? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
At work we recently upgraded from Microsoft SQL Server 7 to SQL 2005. The database engine is a lot more advanced, but the management studio is pretty awful in a number of ways. Most of our developers decided they preferred to stick with the old Query Analyzer tool, even though it had a lot of limitations.
In my spare time, I decided to write a replacement for Query Analyzer / Management Studio that did the things our developers most needed to do. I finally got permission to release it for free: Versabanq Squel (versabanq.com/squel).
Like I said, it's free, so this isn't a sales pitch. But it got me thinking. What I'm wondering is: are most of you satisfied with SQL Studio the way it is? Do people just use it because it's what Microsoft pushes on them? Are there many people out there looking for something better? Maybe I can get some support for long-term development of this, if it looks like there might be some wider interest.
By the way, check out SQL Server Management Studio Alternatives, someone else's earlier question on this topic. What I see there is that there are surprisingly few options. Why do you think that is?
Ha, I came from exactly the same standpoint, so I made a tool, code completion and all, plus there's a free edition available. It's at http://www.atlantis-interactive.co.uk - it's basically for people who miss QA. Your tool looks nice, good job.
While I would love something better, it would have to be significantly better and free. SMS is definetly a hog but I've gotten used to it. What I miss the most is Query Analyzer. I don't mind using SSMS to manage the server but having a fast lightweight, editor for SQL queries would be awsome...
Did I mention free? Not something I'm willing to pay for right now.
EDIT
FYI I downloaded your tool looks neat but you need to add support for Windows Authentications unless I am just missing how its done.
I think Management Studio is far superior to the old SQL 2000 tools. Enterprise Manager was a shocker of a tool, forever hanging and crashing. Query Analyzer is still ok if ALL you ever do is create and run SQL queries, but to be honest once I started using Management Studio I never went back to EM/QA.
I've used Apex SQL Edit before and preferred it over Management Studio. It provided intellisense well before SQL Server 2008's Management Studio.
http://www.apexsql.com/sql_tools_edit.asp
I just moved to developing on linux with mysql and boy do I miss MS SQL Management Studio. It is a fantastic tool. I agree it takes a bit getting used to after using query analyzer, but the query tool in management studio is actually better. I really do not think there is a better alternative. I tried the Apex SQL Edit also but found MS to be superior.
I also suggest using SQL Prompt from Red-Gate to get intellisense (autocomplete). Their other tools are also excellent.
If you are currently developing (or will start developing) using the .NET 3.5 Framework, then I suggest you give your developers this little handy application: LINQPad
This will help your developers learn LINQ (an Integrated O/R Mapper that makes .net developers' lives much easier) syntax, and at the same time use a more-light weight SQL management application
This advice is only valid if you're developers are using Microsoft's .net 3.5 Framework
I was quite happy with the Enterprise Manager of 7.0 and 2000. I kind of liked the ideas of MMC snapins. As long as you remembered to hit refresh, it wasn't that bad.
The new 2005 Management Studio is ok too. I see no point in choosing anything else. I fail to see the grand improvement that could justify a move for me. Everybody seems to use the stuff that comes with SQL Server, and compared to the stuff that comes with Oracle, it is pretty good. Oracle developers have more choice, and it is no mystery!
Books Online is great, and has been since 7.0.
My favourite part about Query Analyzer is and has always been the execution plan view. It's such a Good Thing!
Every new version of SQL Server has a lot of new stuff, but sadly some stuff gets dropped too. I think it's sad that English Query is gone. I never found a project for it, pushing it in Norway was part of the problem, but I thought it was brilliant.
I have tried a handful of them including TOAD, ApexSqlEdit and a couple of others. The problem with all of them is that while they include great features Management Studio is missing they also lack critical features Management Studio already has, I always found myself with two windows open, my third party editor and Management Studio. This is one area where I think Red-Gate has really nailed it, they don't try to replace management studio, just make up for it's deficiencies by extending it, adding intellisense, light refactoring, and code formatting. So far my favorite solution by quite a margin is Management Studio with RedGate SqlPrompt Pro added in for the intellisense and formatting which boost my productivity quite a bit.
SQL Server Management Studio 2008, when used against a SQL Server 2008 database, supports Intellisense for SQL Queries. Nuff said!
edit: sorry, didn't realize you said SQL 2005. Eh, I like SSMS 2005 as well.
I, for one, would definitely like something other than Management Studio. Is it just me, or do other people feel that it is wayyyyy slower than SQL Server 2000's Enterprise Manager? More features or not, I need something that can get the job done quickly.
I was having issues determining how to set up user permissions on SSMS. Eventually I accidentally ran into the correct way to do it and it works nicely now. I never used any tools previously for SQL Server so I can't compare but I think this does everything I need it to at the moment.
Anything is better than the tripe called SQL Server Management Studio. Sorry, but it's plain awful for us non-DBA guys. Maybe you DBA and programmer types like it, but it's a major PITA for those of us who are just the Server guys who schedule backups and such. It's slow. SLOW. And the Maintenance Plan interface is a living nightmare of bugs and gotcha's. Enterprise Manager wasn't perfect, but it was far, far easier to use than SSMS.
It really reminds me of Visual Basic 4 compared to VB3 - MS was trying to go in the right direction, they just did a really poor job. Of course, we eventually got VB6, so maybe in MSSQL Server 2011 we'll have something decent again. But for now, I just wish I could run Enterprise Manager against my SQL2005 servers, as SMSS makes me batty.
However, I haven't yet had any problems running the Query Manager from 2000 against my 2005 servers, at least not for the simple queries I do. At least that still works.
Management Studio is imperfect, and has a few bugs but I find it FAR and away better than the old 2000 tools. No contest. I use SSMS 2008 to manage all my servers including the SQL Server 2000 (ack!) instances.
Even with its warts, I have yet to see someone create a tool that is better for what it does - nobody probably has time to (re)build out every feature.
My 2 cents.
Yes, but they have almost always had their own problems.
Out of all of them, I used Toad for quite a bit, but found it to be a bit less responsive compared to Management studio. Maybe it was the building of intellisense (which was also very picky - it always required me to put in the Database.owner. prefix and had trouble with aliases), but it just didn't feel as comfy.
Back to SQLMS...