Accessing Information from a SQL Dataset - sql-server

I have recently started working with SQL databases of which I have no previous experience with. I have added the datasource to my project using the Visual Studio wizard and the DataSet appears in my solution explorer.
Everything that I have read thus far has shown connecting to the SQL server and then sending query commands, but since I have added the direct reference to my project is this necessary. I thought since I had added the reference to my project I would have direct accesbility to it, but it appears that is not so.
Also to help the searching process a view has been created on the SQL server that polls all of my desired fields in a single shot. I have linked this view to my dataset after utilized the datasource wizard. Any recommendations on how I can access the data from that view?
I apologize for the vagueness of my questions, but I am not really 100% sure the questions I need to be asking. I appreciate the help.
Thanks

Turns out the best means to solve this problem was to ditch the Data Source Wizard and use standard SQL queries.

Related

Is it possible to add favorite tables in SQL Server Management Studio?

I am working with 8 databases and lots of tables in each one of them.
It would be convenient for me to have a list of favorite tables and views that I can quickly access.
Does anyone know of such a feature or an idea how to achieve the same?
Thanks
Using the latest SQL Server 2014.
There is no exact thing called favorites that you are asking for. But you will find many add-ins that will be very helpful to you.
SQL Search:- You can type the name of the object, it quickly navigates to the object anywhere on the server.
SSMSBoost add-in:- I have not tried this myself, but heard good things about this.
Use Auto Hot Key:- This is my favorite. It is a keyboard macro program, You can create bunch of scripts and automate those scripts. For example:- I have keyboard shortcuts to connect to a particular database and then write
Select * from my favoriteTable

Sql Server Migration Assistant for Access

I have been tasked with migrating an existing MS Access database to SQL Server 2012. It appears that using the SSMA for Access is the best choice for completing this migration. I have done some review of the migration assistant and it seems to be pretty straight forward. The kicker is that this client wants to use the existing Access forms with the data that has been migrated to SQL Server. So once the migration is complete, I need to point all of the current Access forms, queries, and reports at the new data source. I am not sure of the best way to accomplish this. I see that there is an option to 'link tables' when using the migration assistant but I am guessing there is more work to do to get the entire access front end working with the SQL backend. I don't have much Access experience so any help or advice on the best way to accomplish this would be much appreciated. Thanks!
The SSMA tool can also redirect its table definitions (the entries under the 'Tables' tab in the database window) so that they reference the migrated data in SQL Server. Forms, queries and reports all use these table definitions, so you may well find that most things work as expected immediately after migration. However, there are some aspects that do not move successfully, and you are likely to hit some of these if there is much VBA code in your application.

Can I dump an entire Microsoft SQL Server database from Linux?

I've got a linux server that already connects happily to a MS SQL Server and I want to know if there is a way to dump the whole thing into a format I can read. I don't have access to the desktop, but I can connect using PHP and I can issue whatever commands I want. I have admin access to the SQL Server, so no problem there.
My main goal is to understand how the people before me set this thing up. I already know how to get the stored procedures as text (SELECT * FROM sys.procedures), but I was wondering if there is a way to get the whole database. I'm not very familiar with SQL Server so I don't know what important bits I might be missing.
And I don't care if the solution is in PHP or not. That's just the thing I've got working right now. Any SQL-ish command that dumps the entire database would solve my world.
To summarize:
I don't have access to the actual machine/desktop
I have admin access to the DB using PHP's mssql libs
I'm on linux
I want a text file I can look at that tells me everything in the database
My goal is not to answer a specific question - I'm looking to understand what the people before me did when they set up this database. Unknown unknowns, and all that.
Okay, hopefully I've made sense. I'm sorry if I've been a complete idiot. Be gentle. Thanks!
I would backup (http://msdn.microsoft.com/en-us/library/ms186865.aspx) the database to file and then download it, restore it on Windows and then use SQL Server tools like SQL Server Management Studio etc. to look at it.
There is plenty you can do with the metadata, but you could spend a lot of time writing queries instead of using existing off-the-shelf documentation tools.
You can use this script to create insert statements for any given table.
This stackoverflow question will tell you how to generate create table statements.
SELECT NAME FROM sys.tables will give you a list of table names.
You would probably save a LOT of time and pain by just using native SQL SErver Windows tools that work with it.

Getting started with VB.NET Databases

I'm having trouble figuring out databases in VB.NET. (VS 2008)
What control(s) do I need to use and how do I use them? I am ,looking for tutorials and sample code too.
I'm working on a trivia game where the admin can remove and add questions to a database.
EDIT:
The program must be able to do all of the DB interactions itself through code.
Regarding DB portability...
I do not intend to install it on many machines, so portability is not a major issue, but I's rather not be bound to Access or SQL Server. (Is that possible? - A portable database file?)
A bit more complaining...
I really need help with connection strings and the whole DB gamut in VB. I've done DBs in PHP so I'm not completely ignorant. It's the VB side of things that's confusing.
Thanks.
Have you considered SQLite DB? It's a very small DB and is used my many vendors. I have not used SQLite personally, but I do know that Firefox uses it and so does iPhone (from what i've read).
SQLite does not require you to install anything (as per the post below). It's a nice alternative to Access or carrying around SQL Server Express.
If you do decide to use SQL Server Express, you will be required to install the run-time, from here for each machine it's used on.
Below are some links which may help you get started
Google for SQLite DB
ADO.NET 2.0 Provider for SQLite
And finally, here's a blog post outlining how to get it done, and quickly.
Cheers!
I would suggest Microsoft's Enterprise Library - The hands on labs available make it a breeze to setup access to a database, and can make it as simple as a config change to point to a new/different DB.
Also, check out http://connectionstrings.com/ for related info.

SQL Server Object Organisation

I'm not sure if this is valid, however I have a bug bear with SQL Server, and that is that I cannot organise objects in to a group of objects.
Imagine I'm working on a new section of work in a large database and I perhaps have 15 objects that I will be regularly using. What I want to do is sort of "Favourite" them in to a folder so that I don't have to trawl through all objects in my databases.
I know I could organise objects by schema, however these objects aren't necessarily schema specific, they cross boundaries.
Has anyone come across a method for organising objects in to a favourites group? I know SQL Server Projects organise scripts, but I can't see that they can organises tables?
Thanks
You can't do that with the native tools (SQL Server Management Studio) but there's a workaround: create a new empty database with those 15 tables - just the schema, not the data. Then when you're writing T-SQL code, you can quickly drag and drop elements out of those tables into your code.
The downside is that changes made in the real database won't be reflected in your working database, but you can automate that with a script to pull out the objects you need and recreate them in your working database. You can run that as often as you like (like every X hours, or as a SQL Agent job that runs when your local dev server starts up) without losing data, since you won't be modifying the structure in your "favorites" database.
I know I'm really late to the party, but the question showed up on the right under "Related" and I was curious enough to look.
There is a free add-in for Management Studio that seems to do exactly what you're asking:
http://www.sqltreeo.com/wp/dowload-free-ssms-add-in-to-create-own-folder-for-database-objects/
There is also a $65 commercial add-in which you may want to try as well. I haven't tried either so I'm not sure how well they work or what the paid version offers over the free add-in (if anything).
http://www.skilledsoftware.com/
Also can't hurt to vote for this Connect item and add a comment describing your business use case. While you may find it discouraging that it's been closed as Won't Fix, that is not necessarily a permanent decision:
http://connect.microsoft.com/SQLServer/feedback/details/209340

Resources