SQL 2012 :: Using Latitude And Longitude To Get Name Of A State

Oct 19, 2015

I have been plugging away at this for a bit, and I am curious if there are any methods, functions, code, etc. to plug in latitude and longitude coordinates and get the name of a state as a result.

I have tried using the geography type and its "functions" to no avail.

View 4 Replies


ADVERTISEMENT

Australian Postcode Db With Longitude/latitude

Jul 23, 2005

not sure exactly where I should ask this question, but im looking fora database of Australian Postcodes that included thelongitude/latitude.Does anyone know of such a thing? Preferably free...fingers crossed.many thanksjack

View 1 Replies View Related

Calculating Distance Based On Latitude And Longitude

Jun 14, 2006

I need to be able to take the latitude and logitude of two locations and compare then to determine the number of miles between each point. It doesn't need to account for elevation, but assumes a flat plane with lat and long.

Does anyone have any algorithms in T-SQL to do this?

View 5 Replies View Related

T-SQL (SS2K8) :: Returning Rows Within Certain Distance In Miles From City Using Longitude And Latitude

Nov 19, 2014

I've got a working query which returns all leads within a supplied proximity to a city. I followed a tutorial I googled a couple months ago (can't find it now). It works, but would love others to look the query over (provided DDL and sample data) and tell me if it's as it should be.

Two things I don't like about query:

1. I have to do a UNION to another query that retrieves everything that is in the same city in order to have complete results.
2. very slow to retrieve results (> 1 minute)

Sample DDL: 2 tables
create table dim_lead
(
date_created datetime,
[contact_first_name] varchar(20),
[contact_last_name] varchar(20),
lead_id int,

[Code] .....

View 9 Replies View Related

Reporting Services :: Plotting Longitude And Latitude With Power View From Multidimensional Source

Sep 2, 2014

I have a SQL 2012 SP1 environment integrated with SharePoint 2013. I have deployed a Multi-Dimensional Cube, due to the need for role playing dimensions and numerous parent-child hierarchies that can't be 'flattened' out easily, it's for this reason that we have gone multi-dimensional, rather than tabular.

The issue I now face is trying to plot the data on a map in Power View. It has to via Longitude and Latitude or easting and northing if possible. I know if I use PowerPivot, I can query the MD Cube, get my dataset and make sure the model views the lat/long as coordinates and this method works just fine - however, it involves an extra step, the end user must pre-build their query in PowerPivot before they can use the Power View maps and adhoc analysis, this can create a lot of back and forth when refining your query or performing additional 'what if' analysis.

When I create the Report Data Source in SharePoint to connect directly to the MD Cube, rather than going through Power Pivot, it's able to connect, but does not recognise the lat and long fields as Latitude and longitude, nor will it let me manually drag it into the lat and long fields on the field list. If I drag them into the 'location' section, it does not plot correctly.

How to get Power View to plot Latitude and Longitude from a Multi-Dimensional Source without having to go through PowerPivot?

View 7 Replies View Related

SQL 2012 :: AlwaysOn Secondary Replica - Resolving State

May 21, 2013

I have an AlwaysOn Availability group configured between 2 nodes (Synchronous)

Automatic failover was working fine until recently

I can failover between the nodes manually but automatic failover doesn't seem to be working. In my earlier test, I would shut down the SQL Service on the primary and within seconds, the secondary replica would take over. Recently I have performed the same test and the secondary replica enters the resolving state and the DB in unavailable.

I have tried everything here: [URL] ....

The only change I made was changing the availability mode from Synchronous to Asynchronous - Could that be the cause?

View 3 Replies View Related

SQL 2012 :: Service Broker Endpoint Is In Disabled Or Stopped State

May 5, 2014

I have a SQL 2012 Enterprise edition HADR cluster with 2 nodes and my event log on the second node (current primary for the AG) is being filled with these messages

The Service Broker endpoint is in disabled or stopped state

I wasn't able to find too much on the issue. I did find this one open Microsoft connect bug report from back in April 2013 [URL] .....

O/S: Windows 2012
SQL Server 2012 v11.0.3412
Currently 1 AG with 1 DB

View 3 Replies View Related

SQL Server Session State - Using A 1.1 Database Schema For 2.0 Session State Storage

Aug 3, 2006

The 2.0 version of ASPSTATE is slightly different than the 1.1 version in that one table has one additional column and another table uses a different data type and size for the key. The 2.0 version also has a couple additional stored procedures.

We'd like to manage just one session state database if possible so we're trying to figure out if Microsoft supports using the new schema for 1.1 session state access (it seems to work, but our testing has been very light).

Is there any official support line on this? If not, can anyone comment on whether or not you'd expect it to work and why?

Thanks.

View 1 Replies View Related

Principal Db In Principal, Synchronizing State, The Mirror In Restoring State

Sep 26, 2007

We have mirroring setup for 5 dbs, 4 of which are synchronized and 1 which is in "synchronizing" state on the principal and "restoring" state on the mirror. Mirroring for all dbs has been working fine for the past several months and we have a witness that has allowed automatic failover in the past without problems.

This database has several bulk inserts performed throughout the day and am sure there is some latency due to the size of these transactions.

Not sure as to why this is happening all of a sudden, but the db in question has been in this state for the past 12 hrs. I checked the mirroring status on the principal and it states that it is "synchronizing: data is being transferred from principal to mirror", but the mirror server states that db is in "restoring" state. Can anyone suggest as to how I can get the database on the mirroring server to get back to "mirror, synchronizing/restoring..." state? Or suggest on how I can troubleshoot this?

Thanks in advance.

View 3 Replies View Related

How To Go To Next State?

Oct 25, 2007



I am creating an external application that will be used for hiring applicants and i used MOSS Workflow for this.

I can programmatically start the workflow but the problem is how can i go to next state programmatically? scenario is the next state might trigger after a day or week.


Thanks in advance.

View 1 Replies View Related

Time In State

May 10, 2006

I've got a SQL that registers people passing in and out via their acess cards. Basically passing in means they set a discrete tag to 1 and out tag to 0. SQL logs delta so change is logged. I would now want to Query the database and just want the monthly time they've been in i.e. how long has the tag been 1.
I can pull a monthly list of the tags all statuses (1 and 0) and times but how do I put together a query that just gives me the time it been in 1 status?

following to pull a delta list i.e changes:

SET NOCOUNT ON
DECLARE @StartDate DateTime
DECLARE @EndDate DateTime
SET @StartDate = DateAdd(wk,-1,GetDate())
SET @EndDate = GetDate()
SET NOCOUNT OFF
SELECT TagName, DateTime = convert(nvarchar, DateTime, 113), vValue, Quality, QualityDetail = v_History.QualityDetail, QualityString
FROM v_History
LEFT JOIN QualityMap ON QualityMap.QualityDetail = v_History.QualityDetail
WHERE TagName IN ('Pete_Smith')
AND vValue <= 1
AND wwVersion = 'Original'
AND wwRetrievalMode = 'Delta'
AND wwRowCount = 1000
AND DateTime >= @StartDate
AND DateTime <= @EndDate




heson1

View 6 Replies View Related

State Count

May 9, 2007

Hi All,

I ckecked other posts before posting, and I found one that applies but doesn't quite work for me. I have a database with Address records and want to know how many records are in each state.

Ex,

State Count
AL 26
CA 45
FL 16
NY 75

I tried using this previous post but changing to state if that helps:

Select Count(Name) as [Count], City
From Table
Group by City

Thanks in advance.

View 13 Replies View Related

How To Check SQL Server State Using ASP.net 2.0

Apr 29, 2007

Hi
I want to build a class in ASP.Net 2.0 which will lookup if SQL server is up & running & whther connection is getting establish to the Database. if it fails it will try 3 time to reconnect. if no sucess then it will shoot a mail to Admin. 
Please help me to achive this.
Thanks
Vishal. 
 
 

View 1 Replies View Related

Connection State Problem

Apr 23, 2008

Hi to all, protected void Page_Load(object sender, EventArgs e)    {        try        {            Label1.Text = Convert.ToString(DateTime.Now);            //string con = System.Configuration.ConfigurationSettings.AppSettings["AJS_CMSConnectionString2"];            ConnectionStringSettings ConstrSettings = ConfigurationManager.ConnectionStrings["AJS_CMSConnectionString2"];            SqlConnection cn = new SqlConnection(ConstrSettings.ConnectionString);            if (cn.State == ConnectionState.Open || cn == null || cn.State == ConnectionState.Broken)            {                cn.Close();            }            cn.Open();            SqlDataAdapter sda = new SqlDataAdapter("Select * from user_master", cn);            DataSet ds = new DataSet();            sda.Fill(ds,"table1");            GridView1.DataSource = ds.Tables[0];            GridView1.DataBind();                    }        catch (Exception ex)        {            Response.Write(ex.Message);        }    }    protected void Button1_Click(object sender, EventArgs e)    {        try        {            Label1.Text = Convert.ToString(DateTime.Now);            //string con = System.Configuration.ConfigurationSettings.AppSettings["AJS_CMSConnectionString2"];            ConnectionStringSettings ConstrSettings = ConfigurationManager.ConnectionStrings["AJS_CMSConnectionString2"];            SqlConnection cn = new SqlConnection(ConstrSettings.ConnectionString);            if (cn.State == ConnectionState.Open || cn == null || cn.State == ConnectionState.Broken)            {                cn.Close();            }            cn.Open();            SqlDataAdapter sda = new SqlDataAdapter("Select * from user_master", cn);            DataSet ds = new DataSet();            sda.Fill(ds, "table1");            GridView1.DataSource = ds.Tables[0];            GridView1.DataBind();        }        catch (Exception ex)        {            Response.Write(ex.Message);        }    } This is my code. During page load i open the connection and read some records from my database, afterwards i click the button and check the connectionstring state now it is closed, my question is why it was closed, i want to set my connectionstring will always opened how to set it ?

View 2 Replies View Related

SQL Licensing For State Server

Mar 10, 2006

Hello all,
I have a question concerning the ridiculous quagmire of SQL Server licensing…
How is SQL Server licensed when used to store session state information?  Is MS claiming that this is an end user use of SQL Server functionality?  Or, can we be realistic and say that I need a server license plus a device license for each web server?
 
Personally, I like everything about SQL Server except the licensing.  Management at my company has already said that we’ll most likely be moving to either Firebird or Postgres after they found out how much it would cost to move from SQL 2k to SQL 2005.  If MS wants us to buy processor licenses for SQL state servers, I guarantee we’ll be doing something else there as well.  I wonder if Microsoft has any clue how much business they’re losing.  Not just in SQL Server, but in their OS business as well.

View 1 Replies View Related

Database In Loading State

Jul 31, 2002

while loading the transaction log dump on a 'STANDBY' database the connection got terminated. as a result the database was marked 'LOADING' and inaccesible. i would like to know if there is a way to get the db out of this mode without having to reapply a full database dump.

P.S. please ignore the previous two messages posted with the same subject line. i inadvertently pressed post twice. sorry for the spam.

View 1 Replies View Related

Server: Msg 229, Level 14, State 5???

Jun 23, 2000

Server: Msg 229, Level 14, State 5, Procedure sp_monitor, Line 167
EXECUTE permission denied on object 'sp_monitor', database 'master', owner 'dbo'.


How do I fix this? which roles, or permission is that? Is there a
easier way to find out solutions for these problems, as books online
does not seem to provide much help.

Thanks,

Vijay

View 2 Replies View Related

Invalid Cursor State

Feb 11, 2000

Does anyone know what this means ??

thanks

View 1 Replies View Related

Sql 6.5: Error : 605, Severity: 21, State: 1

Oct 2, 1999

I have a big problem with a SQL 6.5 (no SP) running
in a production environment on NT 3.51 SP 4 since
2,5 years.

Suddenly Friday at 99/10/01 14:17:38.93 we started
having problems and we could'nt connect to the
DB from our client server application written in VB4.

We rebooted the server and we had other errors at
99/10/01 16:15:40.96.

The error code is 605-21-1 and it seems like the main
table (FILMS) of our db (VISPO) has phisical allocation
problems.

here is en extract from the SQLServer error log
of the first problem:

99/10/01 14:17:38.93 kernel udread: Operating system error 23(Data error (cyclic redundancy check)) on device 'E:MSSQLDATAvispodat.DAT' (virtpage 0x05000f35).
99/10/01 14:17:43.62 spid13 Buffer 9531a0 from database 'vispo' has page number -1 in the page header and page number 3893 in the buffer header
99/10/01 14:17:43.69 kernel mirrorproc: i/o error on primary device 'E:MSSQLDATAvispodat.DAT'


And here is what we had at 16:15

99/10/01 16:15:40.96 spid11 Getpage: bstat=0x1008/0, sstat=0x80010130, disk99/10/01 16:15:40.96 spid11 pageno is/should be:objid is/should be:99/10/01 16:15:40.96 spid11 0xffffffff(-1)0xffffffff(-1)99/10/01 16:15:40.96 spid11 0xf34(3892)0xe4e2b2e(240003886)99/10/01 16:15:40.96 spid11 ... retry bufget after purging bp 0x943a8099/10/01 16:15:40.98 spid11 Error : 605, Severity: 21, State: 1
99/10/01 16:15:40.98 spid11 Attempt to fetch logical page 3892 in database 'vispo' belongs to object '-1', not to object 'FILMS'.

We are thinking about restoring the BackUp of the previous night that should be OK,
but I would like what we can try to do in order to have the
db working properly.

Even if the restore would be fine, maybe we are starting
to have problems on the disk subsystems?

What can we check, something like scandisk in DOS?


I attach here in ZIP format the 2 log files and plese ignore the MAPI errors
that are "normal", we just don't care.
I don't know if it's possible to attach files to a newsgroup or a discussion
group but I will try

Any help would be appreciated.

Thanks in advance.


Eugenio La Mesa
Publisoft
Rome - Italy

View 1 Replies View Related

Invalid Cursor State

Feb 23, 2004

When I change the Identity in a table in EM (undependend on which DB and table) the result is: invalid cursor state.

I have a productive server running SQL Standard version and an play area running SQL Personal.

The funny thing is, when I run the update over QA it works without a problem.

With EM the Profiler tells me an error 16954 after droping a table, and it start to roll back.

I tried hunderts of things to make it work but with no success. Except one thing. I've reinstalled the Personal SQL, restored my DB's and everything works fine now.

This happened first after installing the latest security update from Microsoft on the 10th of February.

I don't want necessarily to reeinstall the SQL server on the productive server, because there are hundreds of Databases on it, and a lot of security settings.

Any help is very appreciated.

View 2 Replies View Related

Help For Error: 602, Severity: 21, State: 4

Sep 14, 2007

Please help me the cause and solution for Error: 602, Severity: 21, State: 4 which is raised while trying to excute a select query on a particular table.

This does not occur every time i excute the query

thanks in advance

View 4 Replies View Related

Msg 1509, Level 20, State 1....

Apr 26, 1999

Hi,

Running NT 4 Svc Pack 4, SQL Server 6.5 Svc Pack 5a. I have an sp to build indexes and it is no longer running...after a couple moments I get the error(s) "Msg 1509, Lvl20, State 2, Row Compare Error". The "State" is 2 on most of the messages and 1 on 1...I get 5 messages at once. I looked through the support information at Microsoft's site and found 1 article on this but...it was for 6.0, it stated that it was fixed in Svc Pack 3, and provided a workaround of increasing the "sort pages" value in the SQL configuration. I was unable to find the "sort pages" option so I am assuming it is no longer available. I then installed the SQL Svc Pack 5a but still no resolution. At this point I have no indexes on my tables and can't find a way to rebuild them. Any help would be appreciated...The only thing I can think of is that I installed the NT svc pack last week and this might have caused it...the indexes sp runs over the weekend so I did not notice this until this morning.


Thanks in Advance,

Kevin

View 1 Replies View Related

Error Msg. 605 Level 21 State 1

Jun 14, 2001

Attempt to fetch logical page ' ' in database ' '. Object belongs to ' ' not object ' '.

Please someone help me fix this. My table is corrupt and I cannot drop it and restore it because I keep getting an error message that says:

Cannot drop table ' ' there is not enough space in syslogs. blah, blah, blah.

Can anyone help me? It woould be much appreciated.

Christine

View 1 Replies View Related

Error 823, Severity 24, State 2 (Again)

Oct 1, 2004

I synch 4 databases everyday and on one of them I get the Error 823, Severity 24, State 2 error (Yes I know you have heard this before but I am a new, LOL). I have tried detaching the database and copying it, renaming that database and then copying back to the original name with the same error; therefore, I think the error is somewhere in the database structure. If it is the database structure would it still give the error above or is that simply a hardware error? I have been searching for solution and I am at a loss. Any help would be appreciated.

Thanks.

N. Adkins

View 3 Replies View Related

Error: 644, Severity: 21, State: 6

Nov 11, 2004

Hi All

Ignore the error below, It's got to do with isolation levels (nolock in this case): refer http://support.microsoft.com/?kbid=834290 for details.

Error: 644, Severity: 21, State: 6
Could not find the index entry for RID '1631393920202020202020202020202033392020202020202 020202020202019bcd3113230303037333120202020202020' in index page (1:420134), index ID 0, database 'DBName'..

What I'd like to know is how to get the table name that was affected out of this error message. Do I query sysindexes, sysobjects, use a function or something else?

Thanks in advance.

Graham

View 1 Replies View Related

Invalid Cursor State

Feb 25, 2005

Hi,

I have a stored procedure that calls 2 other stored procedures and combines the results into a temporary table. The results of the temporary table is then returned from the stored procedure.

When I execute the stored procedure in Query Analyzer, I get the exact data I want in the correct format - no errors.

When I execute that stored procedure in Omnivex SQL Link 3, I get an "Invalid Cursor State" error.

I did some digging on that error, and found that it could be related to print statements within the stored procedures. I removed all print statements from all 3 stored procedures and the error is still occuring.

Any suggestions?

View 5 Replies View Related

Recovering DBs With A Suspect State

Aug 28, 2007

Hello

(SQL Server 2000)

I have databases that appear as "Suspect" in the Enteprise Manager. What can I do to recover them or put them in a normal state?

Thanks a lot.

View 2 Replies View Related

Error: 0, Severity: 19, State: 0

Mar 31, 2008

Hi, i encounter a problem with my sql.
What my system does is that it restore/dump database from some backup.
it will then send email using the xp_sendmail. After that it will send out sms using a command line script.

The timing as per the attachment i put in here. Pls kindly help. production issue.

Here are some other events that caused the error

Using 'dbghelp.dll' version '4.0.5'
*Stack Dump being sent to C:Program FilesMicrosoft SQL ServerMSSQLlogSQLDump0003.txt

Error: 0, Severity: 19, State: 0

SqlDumpExceptionHandler: Process 55 generated fatal exception c0000005 EXCEPTION_ACCESS_VIOLATION. SQL Server is terminating this process..

Stack Signature for the dump is 0xF107CBA8


Pls let me know if you need any information

View 1 Replies View Related

Display Duplicates Which Have A Different State

Jan 29, 2012

I have this query here which displays all duplicates which have the same phone number but i am trying to modify it to display only fields that have the same phone number but have different state

SELECT *
FROM businesses t1
join (SELECT ce_phone FROM businesses GROUP BY ce_phone HAVING COUNT(*)>1) t2
ON t1.ce_phone = t2.ce_phone
WHERE t1.ce_phone is not null
ORDER BY t1.ce_phone

So what I would try to do would be to group state within the ce_phone group and count the state duplicates and if it is less than the count of phone then i would display it but i am just not sure how to write the syntax for it.

View 2 Replies View Related

18456 Error With State 38

Jul 31, 2015

Login failed for user ''. Reason: Failed to open the explicitly specified database. [CLIENT:xx.xx.xx.xx]

No missing database & having sysadmin permission.

why this error coming?

View 3 Replies View Related

State Table Script

Aug 12, 2002

Anyone have a script to create a table of US States?
I'd rather not type in all 50 states if possible :)

Thanks!
The forums search page returned no such script :(

Michael

<Yoda>Use the Search page you must. Find the answer you will.</Yoda>

View 5 Replies View Related

Add A State To Table That Is Already Created?

Feb 16, 2015

I have this table that I thought I could just do a normal update to because I need to add a state and ID.

How do I add a state to a table that is already created?

Here is the behind the scenes. I have never had to deal with something like this.

This is what it looks like

SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[RegionStates](
[RegionID] [smallint] NOT NULL,

[code]....

View 1 Replies View Related

Severity: 14, State: 8 Error... Need Help

Jan 9, 2007

Hello guys,

Error: 18456, Severity: 14, State: 8.
Login failed for user 'sa'. [CLIENT: <ip address>]

With what Ive searched.. State: 8 is wrong password. What Ive
encountered I believed is not State: 8 I guess... I have 2 pc..
PCX and PCY.. PCY has SQL Server 2005 so does PCX.. when I run my application that stores data to PCY DB it prompts me an error just
like the one above.. but what seems to be confusing me is both of them have the same DB password. Did I miss something... please help..


-------------------
Real Programmer dont document

If its hard to write Then
its easy to undertand.
End If

View 19 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved