SQL Server & Mappoint/Spatial Table/Long&Lat - sql-server

I am trying to map some data out of MS SQL Server 2008 (express) and Mappoint with the Mappoint addin for Sql server. The only issue i have is this spatial table stuff. I think i understand what a spatial data is now but i just need an example of how to go about cross referencing my states table with its spatial data. so i have a table with Vendor names, states they perform work in, type of work they do etc. States listed e.g (Florida, Montana, Puerto Rico, all 50 states) what is going to be their spatial reference. Or can i just add a Long and Lat to the table to reference the states. At this point i am giving up on the whole spatial table or query stuff. Can i just have a long and Lat colum in that table? Would Long&Lat be 2 in 2 different colums on the table?

I do not understand what you are trying to do - can you please restate. Give the overarching question you are trying to solve.

It may be worth moving to full version of SQL Server with its geospatial extensions.
Or do as you suggest use data columns for longitude & latitude. Then you'd drop using the MapPoint add-in completely, and simply use MapPoint's Data Import Wizard. (you may need to create a udl connection to SQL Server).

Related

Update data from SQL sever directly in excel

Is there anyway I can update data from my SQL server table directly in Excel?
It is easy enough to connect to my table and get updated data into Excel, but i am looking for the solution to go the other way around.
My table is being used in a Web app and updates rely heavily on me, so i would like to make it easy for others to update the data directly from excel.
excel 2016

Get Latitude Longitude from Access to MSSQL

I have an Access table with venue information. I'm toying with nearest neighbor stuff to show the website viewer the upcoming event that's nearest to them.
The main, in-house, database is Access but the website pulls the data from MSSQL. What I currently do is maintain the Access database, export the table as Excel 2003, transfer .xls to the web server, delete the table and importing the .xls (within SQL Management Studio).
It is a laborious process and I just realized that, when I import the .xls, I will have to go through and reset all the spatial information (set a primary key, set the data type for lat/lng to geography, give it a spatial index).
Is there a way to automate this process? Is there a way to set the data types and keys during the import process? Obviously, the right thing to do is use MSSQL as the back-end and forgo all the work. Unfortunately, my superiors haven't been receptive to making the change.
I found some information on a page working with basic spatial data that shows you can have lat/lng as separate float fields and/or a POINT(lng,lat) geography field.
With this being said, I could just have a separate lat/lng fields in Access and they should import into MSSQL. By that page, I don't even require a geography field (float will work with some extra code. Assumingly, I should be able to populate the geography field from the float fields with a query.

SQL Server need to partition data, but only have standard edition

Is there a way that I can in code (Sproc ,etc) distribute the data for a table into multiple filegroups without actually having SQL Server partitioning available (Only have Standard Edition)? I wanted to be able to breakout my FileStream data into different "Partitions", but without an Enterprise license I can't actually use the partitioning functionality.
Any suggestions would be greatly appreciated.
Thanks,
S
You can distribute your data into different databases and join them with views. The tricky part of that will be to keep the views updated as you add/remove data.
You need to do this "partition" on a logical key (like a calendar date) where each DB has data within a certain range. If you cluster on this field, the query analyzer will be able to determine which DB to pull data from without issue.
At my workplace we are using this technique for a very large (multi-billion row) data set that we get monthly additions to and it works great.

Can I "join" across datasources in SSRS?

I've got two datasources, one Oracle and one Sql Server. Due to circumstances that predate me (as in it was like this when I found it) some columns in the Oracle database contain PKs from lookup tables in the Sql Server database.
I am attempting to create a Sql Server Reporting Services report that will combine data from both the Oracle and Sql Server database; where the data to be reported is partially from Oracle but some of the values needs to be looked up in Sql Server.
I've got the datasources. I've got the DataSets. I just can't figure out how to show both datasets in the same tabular report.
Is this possible? If so how so? I'd rather not resort to a db link in one or the other databases as I'd like to handle this on the reporting side.
I don't think you can join directly, but you might be able to add a subreport that would query the second datasource by using the foreign key from the first datasource as a parameter. See: How to: Add a Subreport and Parameters (Reporting Services).
You could also try using the Lookup and Lookupset functions within your tablix.
Lookup is a 1 to 1 join while Lookupset is 1 to many and may need you to have your data concatenated if you want a set of strings out.
For Lookup the following is from the MSDN site with some tweaks for my simple mind
Lookup(Field you are joining from, Field you are joining to, Field you want back, Dataset of the field you want back)
The tablix should be linked to the dataset of your source (joining from).
And just realised this is from 2010, not 2014...so a necro-post!
you could also embed a table inside another table and pass the primary key to the embeded table.
You could create a linked server that would contain data from both instances. From the SSRS point of view you would have one single datasource.
You can use heterogenous services or oracle transparent gateway to run the report off the oracle side. Oracle can query the data from the SQL side.

Performing Calculations in a table's field with Transactions Table

One thing I want to do is build a personal database for myself at home to use a financial database (transaction log, checking/savings account tables, etc), and I want to do this mainly to learn more about developing databases. I am pretty familiar with MS Access, though not put to use in this context, but what I am really trying to learn is SQL Server.
SO, that being said, the first question that popped into my mind is that if I have a transactions table that I would want to use as a ledger, then is there some method to have the table automatically perform a calculation for one field (balance) based on another field(s) (expense, revenue fields)? Similar to what someone may do with Excel......
Or is this something I would have to do with an unbound form, and an UPDATE statement kinda of approach? If a table constraint exists for this type of idea, I would like to learn it....
I mentioned MS Access in the title, but a SQL Server is also most appreciated. Thanks for the help!
Derived data should not be stored except if it needs to be indexed -- you calculate the values in your SQL statements, or in the presentation layer.
In addition to computed columns in SQL Server tables, you can have them in VIEWS and you can index them. The term is "indexed view" and when you do that, the data is persisted in a hidden temp table and updated on the fly when the data the VIEW is derived from is changed. You can read about it under the TYPES OF VIEWS topic in the same link cited in #Roland Bouman's answer.
Last of all, it's not clear to me why you mention Access at all if you're using SQL Server as your back end. Are you developing your front end in Access?
In MS SQL server, you can use computed columns for this: http://msdn.microsoft.com/en-us/library/ms191250.aspx

Resources