Showing posts with label address. Show all posts
Showing posts with label address. Show all posts

Friday, March 23, 2012

Fuzzy Street Address Search Code

Anybody have any good code for this case...

Given @.address1 as a parameter.

Look in the providers table for providers that match that Address.

But it needs to be a fuzzy lookup. Meaning it has to find these to be matched

123 Fake St.

123 Fake Street

Even possible some misspellings like

123 Fke St would be nice as well.

I know it will possibly involve a Split function, and/or Soundex and Difference functions. But what is best?

I can't find any code when I google this subject.

Help?!?!?

You may be best served to establish FULL TEXT SEARCH for the address column.

Refer to Books Online, Topic: Full Text Search

|||

I just set up the full-text search... This does not seem to be helpful. I can't do a search like:

SELECT *

FROM providers

WHERE CONTAINS (sv_addr, '"123 Fake St"')

Because it will pull up nothing... However I would need to break up the values with some sort of Split function. Then even still it would not pull up ST as matching Street... or get me results spelled wrong like 123 Fke St.

Help?!?! Is there some functionality I'm missing for using a Full-text Search? Or does someone have code already. It would seem that this functionality is needed in all kinds of projects, and that my inquery would be answered completely immediately.

-Robert

|||

This underscores the need to have a good address validation process in place BEFORE bad and/or mis-spelled addressed are put into your server. You may wish to investigate using the US Postal Service web service for addresses and address correction.

I have assisted in incorporating the USPS web service in applications and the results have been excellent. For example, I can misspell my street name and it will still come back with the correct address. In addition, the Zip+4 is provided, there is cross-check between city and zipcode, abbreviations are standardized, etc.

https://secure.shippingapis.com/Registration/

http://www.codeproject.com/useritems/USPS_Web_Tools_Wrapper.asp

|||

umm... no. I have a legacy address database... and I'm hired to write code to search it. I'm not hired to correct the database. The code I'm looking for has to be out there, I just have to look hard enough... or someone will help me and post it.

Thank you for your suggestions.

|||

I've been there, spent quite a bit of time researching Name and Address issues (on a client's nickel of course.)

There are excellent third party 'add-ins' -very expensive though ($100k+) But not too much that really solves the problems.

Deconstruction can help, storing the address components in separate columns -but still a groaner...

Good luck, and keep us posted. Perhaps there is a new approach out there that would be wonderful to share.

|||bump|||There is no "good" way to do what you want with one field called "Address", with any number of values in it.

What I have done in the past is use an exact search for the value and if that does not return any values, use the SOUNDEX() function to try to match something. On large string lengths, this will have a very large number of hits.

Good luck
|||

Here is a beginning to what I want

Code Snippet

CREATE Function [dbo].[AddressFuzzy] (

@.var1 as Varchar(200),

@.var2 as Varchar(200))

RETURNS int AS

--

-- Function Address --

-- ? Matches street name

--

BEGIN

DECLARE

@.a varchar(100), -- street name in var1

@.b varchar(100), -- street name in var2

@.i int

select @.a = Value from dbo.Split(@.var1, ' ') where TokenID = 2

select @.b = Value from dbo.Split(@.var2, ' ') where TokenID = 2

set @.i = difference(@.a, @.b)

RETURN (@.i)

END

The Split function is available as well, if you don't have or understand. This will do a fuzzy match on whatever the second word in the street address is.

so 1) 123 2) Fake 3) Street

It'll fuzzy match 2. I think I can work with this till I get somewhere...

|||

Code Snippet

ALTER Function [dbo].[AddressFuzzy] (

@.var1 as Varchar(200),

@.var2 as Varchar(200))

RETURNS int AS

--

-- Function Address --

-- ? Matches street name

--

BEGIN

DECLARE

@.a varchar(100), -- street name in var1

@.b varchar(100), -- street name in var2

@.c varchar(100), -- street name in var1

@.d varchar(100), -- street name in var2

@.e varchar(100), -- street name in var1

@.f varchar(100), -- street name in var2

@.i char(1),

@.j char(1),

@.k char(1),

@.var1Tokens int,

@.var2Tokens int,

@.var1Plus int,

@.var2Plus int

set @.var1Plus = 0

set @.var2Plus = 0

select @.var1tokens = TokenID from dbo.Split(@.var1, ' ')

select @.var2tokens = TokenID from dbo.Split(@.var2, ' ')

set @.k = '0'

select @.a = Value from dbo.Split(@.var1, ' ') where TokenID = 1

select @.b = Value from dbo.Split(@.var2, ' ') where TokenID = 1

if @.a = @.b set @.k = '1'

select @.c = value from dbo.Split(@.var1, ' ') where TokenID = 2

select @.d = Value from dbo.Split(@.var2, ' ') where TokenID = 2

set @.i = Convert(varchar, difference(@.c, @.d))

if Convert(int, @.i) < 3 begin

if @.var1tokens > 3 begin

-- select @.c = @.c + ' ' + value from dbo.Split(@.var1, ' ') where TokenID = 3

select @.c = value from dbo.Split(@.var1, ' ') where TokenID = 3

set @.var1Plus = 1

end

if @.var2tokens > 3 begin

-- select @.d = @.d + ' ' + Value from dbo.Split(@.var2, ' ') where TokenID = 3

select @.d = value from dbo.Split(@.var1, ' ') where TokenID = 3

set @.var2Plus = 1

end

set @.i = Convert(varchar, difference(@.c, @.d))

end

select @.e = Value from dbo.Split(@.var1, ' ') where TokenID = 3 + @.var1Plus

select @.f = Value from dbo.Split(@.var2, ' ') where TokenID = 3 + @.var2Plus

if @.e is null or @.f is null or @.e = '' or @.f = ''

set @.j = '4'

else

set @.j = Convert(varchar, difference(@.e, @.f))

RETURN Convert(int, (@.k + @.i + @.j))

END

It works fine...

|||

And then, without address standardization, there will be:

123 N Fake St

123 N E Fake St

123 North East Fake St

123 Fake N

123 N Fake St S

As you will discover, there is no 'easy or simple' way to handle addresses unless you follow the USPS rules of standardization -and even then it will still be a major headache. (That's partially why the third party tools are so expensive.) Almost all situations where addressing is a mission critical part of the database structure, addresses are deconstructed into constuitent parts, Number, Direction, StreetName, StreetType, etc. -Think Fire, Police, 911 services. Fuzzy doesn't handle it.

A great many of us have had to tackle this problem. If you 'blow off' our suggestions, you most likely won't find a workable solution.

You would do your client a better service by opening the conversation about why and how to standardize the existing data. It is not a complex process.

|||

The above solution I have found does work. I complained of it's slow-ness but once you narrow down the field using Zip &/or city,state it becomes manageable and an acceptable slowness.

I understand your concerns about the USPS address. Our company has had clients that give us raw addresses from there database, and I've been on the task of turning those into distinct locations.

A lot of the time I have to eye-ball address after address and assign them the same location-id because of the above...
123 N fake st = 123 fake st = .... and so on.

In the future your suggestion does make sense... But for now a fuzzy search on the current database is acceptable.

Now you bring up another point however, a bit unrelated to the question.

The USPS would standardize the database and make it...

123 N Fake St...

And i have a guy search for 123 Fake St... and I would send that to get standarized...

How would the USPS system resolve the two above to be equal?

Would I then take the searched address and see if USPS has it on file? Because it would not match my now standardized database. Or would I take each search and get USPS to tell me the correct way to represent the search and then match it to my database?

-Robert

|||

If there was only a N Fake Street, the return is a standardized address.

If there is both a N and S Fake St, usually 123 would be one North (or South), and 125 would be the other. Rarely would exact same numbering scheme be both North and South. Or the ZIP will be used to determine which is correct.

Again, if address searching is mission critical, you MUST deconstruct

|||I agree with Arnie.

The way the USPS standardization service will return a standard address in the form:
House Number, Direction, Street Name, Modifier (DR, ST, AVE, etc), and city/st/zip, etc

The only way to do any kind of search is you have to know if you are looking for N or S or ST or DR or Ave or whatever. Then you prompt the user for 4 fields, which can have blanks representing "any". Then you can use SOUNDEX on the street name to find something similar.

|||

I spent quite a bit of time for several clients working out the name/address matching possibilities for very large databases. Here is a summary of the super-condensed executive briefing abstract. Wink

None of the available 'free' options can hold a candle to some of the third party products (a couple of which are 'Homeland Securty certified' and often paid for by Homeland Security for governmental requirements). But the cost is high. Obviously, some of these folks have made a large investment in working out name search algorythms, and they rightfully expect a 'good' ROI -and with HS's backing, they are getting it.

Soundex was created to solve a Census Bureau problem at the 20th century, and is biased toward northern european names (primary immigrant influx at the time.) That bias still exists and soundex does NOT handle asian, eastern european, and arabic names worth a crap.

Double Metaphone and NYSIIS are a 'recent' alternatives to soundex (there is documentation and SQL functions available on the 'interweb'.) Double Metaphone and NYSIIS are more robust than soundex(), doing a 'plausible' job handling eastern european, asian, and arabic names.

If you are attempting to 'roll you own' name/address search algorythms, DON"T! Explore using Double Metaphone instead. Don't use soundex() -you will be disappointed.

The Double Metaphone code is publically available, expand on it and publish your enhancements to the larger SQL Community. For addresses, use the USPS web service to standardize the address, and deconstruct the address, storing the 'street' name in its own column.

Fuzzy Street Address Search Code

Anybody have any good code for this case...

Given @.address1 as a parameter.

Look in the providers table for providers that match that Address.

But it needs to be a fuzzy lookup. Meaning it has to find these to be matched

123 Fake St.

123 Fake Street

Even possible some misspellings like

123 Fke St would be nice as well.

I know it will possibly involve a Split function, and/or Soundex and Difference functions. But what is best?

I can't find any code when I google this subject.

Help?!?!?

You may be best served to establish FULL TEXT SEARCH for the address column.

Refer to Books Online, Topic: Full Text Search

|||

I just set up the full-text search... This does not seem to be helpful. I can't do a search like:

SELECT*

FROM providers

WHERECONTAINS(sv_addr,'"123 Fake St"')

Because it will pull up nothing... However I would need to break up the values with some sort of Split function. Then even still it would not pull up ST as matching Street... or get me results spelled wrong like 123 Fke St.

Help?!?! Is there some functionality I'm missing for using a Full-text Search? Or does someone have code already. It would seem that this functionality is needed in all kinds of projects, and that my inquery would be answered completely immediately.

-Robert

|||

This underscores the need to have a good address validation process in place BEFORE bad and/or mis-spelled addressed are put into your server. You may wish to investigate using the US Postal Service web service for addresses and address correction.

I have assisted in incorporating the USPS web service in applications and the results have been excellent. For example, I can misspell my street name and it will still come back with the correct address. In addition, the Zip+4 is provided, there is cross-check between city and zipcode, abbreviations are standardized, etc.

https://secure.shippingapis.com/Registration/

http://www.codeproject.com/useritems/USPS_Web_Tools_Wrapper.asp

|||

umm... no. I have a legacy address database... and I'm hired to write code to search it. I'm not hired to correct the database. The code I'm looking for has to be out there, I just have to look hard enough... or someone will help me and post it.

Thank you for your suggestions.

|||

I've been there, spent quite a bit of time researching Name and Address issues (on a client's nickel of course.)

There are excellent third party 'add-ins' -very expensive though ($100k+) But not too much that really solves the problems.

Deconstruction can help, storing the address components in separate columns -but still a groaner...

Good luck, and keep us posted. Perhaps there is a new approach out there that would be wonderful to share.

|||bump|||There is no "good" way to do what you want with one field called "Address", with any number of values in it.

What I have done in the past is use an exact search for the value and if that does not return any values, use the SOUNDEX() function to try to match something. On large string lengths, this will have a very large number of hits.

Good luck
|||

Here is a beginning to what I want

Code Snippet

CREATEFunction [dbo].[AddressFuzzy] (

@.var1 as Varchar(200),

@.var2 as Varchar(200))

RETURNS intAS

--

-- Function Address --

-- ? Matches street name

--

BEGIN

DECLARE

@.a varchar(100),-- street name in var1

@.b varchar(100),-- street name in var2

@.i int

select @.a = Value from dbo.Split(@.var1,' ')where TokenID = 2

select @.b = Value from dbo.Split(@.var2,' ')where TokenID = 2

set @.i =difference(@.a, @.b)

RETURN(@.i)

END

The Split function is available as well, if you don't have or understand. This will do a fuzzy match on whatever the second word in the street address is.

so 1) 123 2) Fake 3) Street

It'll fuzzy match 2. I think I can work with this till I get somewhere...

|||

Code Snippet

ALTERFunction [dbo].[AddressFuzzy] (

@.var1 as Varchar(200),

@.var2 as Varchar(200))

RETURNS intAS

--

-- Function Address --

-- ? Matches street name

--

BEGIN

DECLARE

@.a varchar(100),-- street name in var1

@.b varchar(100),-- street name in var2

@.c varchar(100),-- street name in var1

@.d varchar(100),-- street name in var2

@.e varchar(100),-- street name in var1

@.f varchar(100),-- street name in var2

@.i char(1),

@.j char(1),

@.k char(1),

@.var1Tokens int,

@.var2Tokens int,

@.var1Plus int,

@.var2Plus int

set @.var1Plus = 0

set @.var2Plus = 0

select @.var1tokens = TokenID from dbo.Split(@.var1,' ')

select @.var2tokens = TokenID from dbo.Split(@.var2,' ')

set @.k ='0'

select @.a = Value from dbo.Split(@.var1,' ')where TokenID = 1

select @.b = Value from dbo.Split(@.var2,' ')where TokenID = 1

if @.a = @.b set @.k ='1'

select @.c = value from dbo.Split(@.var1,' ')where TokenID = 2

select @.d = Value from dbo.Split(@.var2,' ')where TokenID = 2

set @.i =Convert(varchar,difference(@.c, @.d))

ifConvert(int, @.i)< 3 begin

if @.var1tokens > 3 begin

-- select @.c = @.c + ' ' + value from dbo.Split(@.var1, ' ') where TokenID = 3

select @.c = value from dbo.Split(@.var1,' ')where TokenID = 3

set @.var1Plus = 1

end

if @.var2tokens > 3 begin

-- select @.d = @.d + ' ' + Value from dbo.Split(@.var2, ' ') where TokenID = 3

select @.d = value from dbo.Split(@.var1,' ')where TokenID = 3

set @.var2Plus = 1

end

set @.i =Convert(varchar,difference(@.c, @.d))

end

select @.e = Value from dbo.Split(@.var1,' ')where TokenID = 3 + @.var1Plus

select @.f = Value from dbo.Split(@.var2,' ')where TokenID = 3 + @.var2Plus

if @.e isnullor @.f isnullor @.e =''or @.f =''

set @.j ='4'

else

set @.j =Convert(varchar,difference(@.e, @.f))

RETURNConvert(int,(@.k + @.i + @.j))

END

It works fine...

|||

And then, without address standardization, there will be:

123 N Fake St

123 N E Fake St

123 North East Fake St

123 Fake N

123 N Fake St S

As you will discover, there is no 'easy or simple' way to handle addresses unless you follow the USPS rules of standardization -and even then it will still be a major headache. (That's partially why the third party tools are so expensive.) Almost all situations where addressing is a mission critical part of the database structure, addresses are deconstructed into constuitent parts, Number, Direction, StreetName, StreetType, etc. -Think Fire, Police, 911 services. Fuzzy doesn't handle it.

A great many of us have had to tackle this problem. If you 'blow off' our suggestions, you most likely won't find a workable solution.

You would do your client a better service by opening the conversation about why and how to standardize the existing data. It is not a complex process.

|||

The above solution I have found does work. I complained of it's slow-ness but once you narrow down the field using Zip &/or city,state it becomes manageable and an acceptable slowness.

I understand your concerns about the USPS address. Our company has had clients that give us raw addresses from there database, and I've been on the task of turning those into distinct locations.

A lot of the time I have to eye-ball address after address and assign them the same location-id because of the above...
123 N fake st = 123 fake st = .... and so on.

In the future your suggestion does make sense... But for now a fuzzy search on the current database is acceptable.

Now you bring up another point however, a bit unrelated to the question.

The USPS would standardize the database and make it...

123 N Fake St...

And i have a guy search for 123 Fake St... and I would send that to get standarized...

How would the USPS system resolve the two above to be equal?

Would I then take the searched address and see if USPS has it on file? Because it would not match my now standardized database. Or would I take each search and get USPS to tell me the correct way to represent the search and then match it to my database?

-Robert

|||

If there was only a N Fake Street, the return is a standardized address.

If there is both a N and S Fake St, usually 123 would be one North (or South), and 125 would be the other. Rarely would exact same numbering scheme be both North and South. Or the ZIP will be used to determine which is correct.

Again, if address searching is mission critical, you MUST deconstruct

|||I agree with Arnie.

The way the USPS standardization service will return a standard address in the form:
House Number, Direction, Street Name, Modifier (DR, ST, AVE, etc), and city/st/zip, etc

The only way to do any kind of search is you have to know if you are looking for N or S or ST or DR or Ave or whatever. Then you prompt the user for 4 fields, which can have blanks representing "any". Then you can use SOUNDEX on the street name to find something similar.

|||

I spent quite a bit of time for several clients working out the name/address matching possibilities for very large databases. Here is a summary of the super-condensed executive briefing abstract. Wink

None of the available 'free' options can hold a candle to some of the third party products (a couple of which are 'Homeland Securty certified' and often paid for by Homeland Security for governmental requirements). But the cost is high. Obviously, some of these folks have made a large investment in working out name search algorythms, and they rightfully expect a 'good' ROI -and with HS's backing, they are getting it.

Soundex was created to solve a Census Bureau problem at the 20th century, and is biased toward northern european names (primary immigrant influx at the time.) That bias still exists and soundex does NOT handle asian, eastern european, and arabic names worth a crap.

Double Metaphone and NYSIIS are a 'recent' alternatives to soundex (there is documentation and SQL functions available on the 'interweb'.) Double Metaphone and NYSIIS are more robust than soundex(), doing a 'plausible' job handling eastern european, asian, and arabic names.

If you are attempting to 'roll you own' name/address search algorythms, DON"T! Explore using Double Metaphone instead. Don't use soundex() -you will be disappointed.

The Double Metaphone code is publically available, expand on it and publish your enhancements to the larger SQL Community. For addresses, use the USPS web service to standardize the address, and deconstruct the address, storing the 'street' name in its own column.

Fuzzy Matching - Address Cleansing

Hi *,

does anyone know if MS supports some kind of breaking strategy within Fuzzy Lookup/Grouping?

Besides that, I'd like to perform a address cleansing operation on a CRM database. I don't have a reference table (Street, Zip, LastLine, etc.) for that. Where can I get an appropriate database? Anyone has some experience with this issue?

Thanks a lot.
S.Is there no one who uses SSIS for address validation?!|||

I don't really understand what you mean by a breaking strategy, do you mean splitting an address out into its component parts, such as street, city, post code? If so then there is nothing in the stock components that does this. You would really want some third-party address verification software. Many of them will have their own API that could then be used to integrate this into a SSIS data flow, in fact we did this for a client recently. They key to provide effective address cleansing is the reference system, more than just a table of data really. If this is a one off or an infrequent requirement then I would just use a bureau type service rather than anything integrated into SSIS, but on the other hand if this is an ongoing requirement then purchasing a product and integrating it would make sense.

The Fuzzy Lookup could be used to try and find a match between an existing table of addresses and a source address, but unless you are looking for existing customers or such like, you would have to purchase an address "file". That is generally what you are paying for in a third-party address product, so I think it would make sense to actually use the address software API rather than the Fuzzy.

|||My experience is that many 3rd party data quality tools (i.e. Firstlogic IQ) have some very impressive features like the mentioned breaking groups (breaking the source data into several parts and perform cleansing only within these parts --> saves a lot processing time).

I think the fuzzy search capabilities of SSIS are really powerful. Other products, like the mentioned firstlogic iq, doesn't perform very well in this respect. So I was thinking why not use SSIS and a comprehensive postal database to take advantage of both worlds. My biggest concerns are a really big slow down in performance and the lack of parsing features.

Regards, S.|||Ok, let me get this straight. Nobody ever tried to use fuzzy matching for adress verification?! What do you use fuzzy matching for instead?|||Have you looked at Intelligent Search Technology SSIS components. Their fuzzy matching components are really good. They also provide address correction and all of that within SSIS. The link is: http://www.intelligentsearch.com/ssis-data-quality/index.html

Wednesday, March 21, 2012

Funny search error

I have two fields I am searching on ... address and zipCode

When I have both pieces of data, everything is fine, i get back the expected results, but i am unable able to search on the individual pieces. Here is the SQL I am using. It's placed within a store procedure in Sqlserver that I amreferencing from my VB.net code... any help??


IF ((NOT @.address IS NULL) AND( NOT @.zipCode IS NULL))
BEGIN
SELECT OrderNumber FROM Orders WHERE ShpAddr_Address1 = @.address AND ShpAddr_ZipCode = @.zipCode
END

ELSE IF NOT @.address IS NULL
BEGIN
SELECT OrderNumber FROM Orders WHERE ShpAddr_Address1 = @.address
END

ELSE IF NOT @.zipCode IS NULL
BEGIN
SELECT OrderNumber FROM Orders WHERE ShpAddr_ZipCode = @.zipCode
END

any help would be great. thanksMy guess is that your parameters (@.address and @.zipCode) contain empty strings, not NULLs.

You VB.NET code should be setting the parameter value to SQLString.Null if the user did not choose to use the parameter.

I would then also consider changing your stored procedure to simply this:


SELECT OrderNumber FROM Orders WHERE ShpAddr_Address1 = ISNULL(@.address,ShpAddr_Address1) AND ShpAddr_ZipCode = ISNULL(@.zipCode,ShpAddr_ZipCode)

I make this suggestion for ease of code maintenance. I myself have gotten burned several times over the past month by not changing all relevant similar blocks of code in a stored procedure when the logic needed to change.

Terri|||I'm trying this right now as we speak, but my program refuses to reconize what a "SqlString" is. Is there anything special i have to import?|||It's in the System.Data.SqlTypes namespace, so you can either import the namespace or reference it with the fully qualified name: System.Data.SqlTypes.SqlString.Null.

Terri

Monday, March 12, 2012

Function to validate e-mail address

does anyone have a funciton or Stored PRoc to validate internet e-mail addresses?

I have a table of e-mail addresses, many of which are junk (the web programmer did not enforce validation on the survey form) and now i have to filter the junk out of the list.

Can any one help with this? Is there a UDF or SP floating out there I could use?These links may give you some ideas:

One that does it in the database

One that does it in C#

Sunday, February 26, 2012

fully qualified names with named instances

hallo it's unclear to me how to address a named instance using a fully
qualified name (server-name.database-name.owner-name.object-name)
In this syntax, where does the instance name fit?
thanks in advance
Raffaele,
server-name is actually linkedserver-name, which may not actually be the
name of a physical serve. Here is some code from SQL 2005 Books Online
EXEC sp_addlinkedserver
@.server='S1_instance1',
@.srvproduct='',
@.provider='SQLNCLI',
@.datasrc='S1\instance1'
You can see that the instance name is defined in the data source as the
server 'S1' and the instance '\instance1'. The server name of
'S1_instance1' reflects that name, but it could be named
'MyFavoriteLinkedServer' or anything else.
So, then: SELECT * FROM S1_instance1.mydatabase.myowner.MyTable
RLF
"Raffaele" <Raffaele@.discussions.microsoft.com> wrote in message
news:BFDA8EDF-1EC1-47E1-A71C-B13B89397DF5@.microsoft.com...
> hallo it's unclear to me how to address a named instance using a fully
> qualified name (server-name.database-name.owner-name.object-name)
> In this syntax, where does the instance name fit?
> thanks in advance
|||[Server\Instance].database.owner_or_schema.object
Aaron Bertrand
SQL Server MVP
http://www.sqlblog.com/
http://www.aspfaq.com/5006
"Raffaele" <Raffaele@.discussions.microsoft.com> wrote in message
news:BFDA8EDF-1EC1-47E1-A71C-B13B89397DF5@.microsoft.com...
> hallo it's unclear to me how to address a named instance using a fully
> qualified name (server-name.database-name.owner-name.object-name)
> In this syntax, where does the instance name fit?
> thanks in advance
|||hallo aaron, this was i tried as first but i got this error
"unable to find 'servername\instancename' in sysservers
"Aaron Bertrand [SQL Server MVP]" wrote:

> [Server\Instance].database.owner_or_schema.object
> --
> Aaron Bertrand
> SQL Server MVP
> http://www.sqlblog.com/
> http://www.aspfaq.com/5006
>
>
> "Raffaele" <Raffaele@.discussions.microsoft.com> wrote in message
> news:BFDA8EDF-1EC1-47E1-A71C-B13B89397DF5@.microsoft.com...
>
>
|||i already tried linking the instance, getting error 15028 - the server
already exists.
In the test case, both the default and the named instance are on the same
server, which is running MSSQL 2000
"Russell Fields" wrote:

> Raffaele,
> server-name is actually linkedserver-name, which may not actually be the
> name of a physical serve. Here is some code from SQL 2005 Books Online
> EXEC sp_addlinkedserver
> @.server='S1_instance1',
> @.srvproduct='',
> @.provider='SQLNCLI',
> @.datasrc='S1\instance1'
> You can see that the instance name is defined in the data source as the
> server 'S1' and the instance '\instance1'. The server name of
> 'S1_instance1' reflects that name, but it could be named
> 'MyFavoriteLinkedServer' or anything else.
> So, then: SELECT * FROM S1_instance1.mydatabase.myowner.MyTable
> RLF
> "Raffaele" <Raffaele@.discussions.microsoft.com> wrote in message
> news:BFDA8EDF-1EC1-47E1-A71C-B13B89397DF5@.microsoft.com...
>
>
|||ok linked server solved! the named instance was already present as "remote
server" since was used for a test replica.
Thanks
"Raffaele" wrote:

> i already tried linking the instance, getting error 15028 - the server
> already exists.
|||OK, thanks for the update. - RLF
"Raffaele" <Raffaele@.discussions.microsoft.com> wrote in message
news:DA137E75-C8F2-41B3-8B2F-C94344FB3FB4@.microsoft.com...
> ok linked server solved! the named instance was already present as "remote
> server" since was used for a test replica.
> Thanks
> "Raffaele" wrote:
>

fully qualified names with named instances

hallo it's unclear to me how to address a named instance using a fully
qualified name (server-name.database-name.owner-name.object-name)
In this syntax, where does the instance name fit?
thanks in advanceRaffaele,
server-name is actually linkedserver-name, which may not actually be the
name of a physical serve. Here is some code from SQL 2005 Books Online
EXEC sp_addlinkedserver
@.server='S1_instance1',
@.srvproduct='',
@.provider='SQLNCLI',
@.datasrc='S1\instance1'
You can see that the instance name is defined in the data source as the
server 'S1' and the instance '\instance1'. The server name of
'S1_instance1' reflects that name, but it could be named
'MyFavoriteLinkedServer' or anything else.
So, then: SELECT * FROM S1_instance1.mydatabase.myowner.MyTable
RLF
"Raffaele" <Raffaele@.discussions.microsoft.com> wrote in message
news:BFDA8EDF-1EC1-47E1-A71C-B13B89397DF5@.microsoft.com...
> hallo it's unclear to me how to address a named instance using a fully
> qualified name (server-name.database-name.owner-name.object-name)
> In this syntax, where does the instance name fit?
> thanks in advance|||[Server\Instance].database.owner_or_schema.object
Aaron Bertrand
SQL Server MVP
http://www.sqlblog.com/
http://www.aspfaq.com/5006
"Raffaele" <Raffaele@.discussions.microsoft.com> wrote in message
news:BFDA8EDF-1EC1-47E1-A71C-B13B89397DF5@.microsoft.com...
> hallo it's unclear to me how to address a named instance using a fully
> qualified name (server-name.database-name.owner-name.object-name)
> In this syntax, where does the instance name fit?
> thanks in advance|||hallo aaron, this was i tried as first but i got this error
"unable to find 'servername\instancename' in sysservers
"Aaron Bertrand [SQL Server MVP]" wrote:

> [Server\Instance].database.owner_or_schema.object
> --
> Aaron Bertrand
> SQL Server MVP
> http://www.sqlblog.com/
> http://www.aspfaq.com/5006
>
>
> "Raffaele" <Raffaele@.discussions.microsoft.com> wrote in message
> news:BFDA8EDF-1EC1-47E1-A71C-B13B89397DF5@.microsoft.com...
>
>|||i already tried linking the instance, getting error 15028 - the server
already exists.
In the test case, both the default and the named instance are on the same
server, which is running MSSQL 2000
"Russell Fields" wrote:

> Raffaele,
> server-name is actually linkedserver-name, which may not actually be the
> name of a physical serve. Here is some code from SQL 2005 Books Online
> EXEC sp_addlinkedserver
> @.server='S1_instance1',
> @.srvproduct='',
> @.provider='SQLNCLI',
> @.datasrc='S1\instance1'
> You can see that the instance name is defined in the data source as the
> server 'S1' and the instance '\instance1'. The server name of
> 'S1_instance1' reflects that name, but it could be named
> 'MyFavoriteLinkedServer' or anything else.
> So, then: SELECT * FROM S1_instance1.mydatabase.myowner.MyTable
> RLF
> "Raffaele" <Raffaele@.discussions.microsoft.com> wrote in message
> news:BFDA8EDF-1EC1-47E1-A71C-B13B89397DF5@.microsoft.com...
>
>|||ok linked server solved! the named instance was already present as "remote
server" since was used for a test replica.
Thanks
"Raffaele" wrote:

> i already tried linking the instance, getting error 15028 - the server
> already exists.|||OK, thanks for the update. - RLF
"Raffaele" <Raffaele@.discussions.microsoft.com> wrote in message
news:DA137E75-C8F2-41B3-8B2F-C94344FB3FB4@.microsoft.com...
> ok linked server solved! the named instance was already present as "remote
> server" since was used for a test replica.
> Thanks
> "Raffaele" wrote:
>
>

fully qualified names with named instances

hallo it's unclear to me how to address a named instance using a fully
qualified name (server-name.database-name.owner-name.object-name)
In this syntax, where does the instance name fit?
thanks in advanceRaffaele,
server-name is actually linkedserver-name, which may not actually be the
name of a physical serve. Here is some code from SQL 2005 Books Online
EXEC sp_addlinkedserver
@.server='S1_instance1',
@.srvproduct='',
@.provider='SQLNCLI',
@.datasrc='S1\instance1'
You can see that the instance name is defined in the data source as the
server 'S1' and the instance '\instance1'. The server name of
'S1_instance1' reflects that name, but it could be named
'MyFavoriteLinkedServer' or anything else.
So, then: SELECT * FROM S1_instance1.mydatabase.myowner.MyTable
RLF
"Raffaele" <Raffaele@.discussions.microsoft.com> wrote in message
news:BFDA8EDF-1EC1-47E1-A71C-B13B89397DF5@.microsoft.com...
> hallo it's unclear to me how to address a named instance using a fully
> qualified name (server-name.database-name.owner-name.object-name)
> In this syntax, where does the instance name fit?
> thanks in advance|||[Server\Instance].database.owner_or_schema.object
--
Aaron Bertrand
SQL Server MVP
http://www.sqlblog.com/
http://www.aspfaq.com/5006
"Raffaele" <Raffaele@.discussions.microsoft.com> wrote in message
news:BFDA8EDF-1EC1-47E1-A71C-B13B89397DF5@.microsoft.com...
> hallo it's unclear to me how to address a named instance using a fully
> qualified name (server-name.database-name.owner-name.object-name)
> In this syntax, where does the instance name fit?
> thanks in advance|||hallo aaron, this was i tried as first but i got this error
"unable to find 'servername\instancename' in sysservers
"Aaron Bertrand [SQL Server MVP]" wrote:
> [Server\Instance].database.owner_or_schema.object
> --
> Aaron Bertrand
> SQL Server MVP
> http://www.sqlblog.com/
> http://www.aspfaq.com/5006
>
>
> "Raffaele" <Raffaele@.discussions.microsoft.com> wrote in message
> news:BFDA8EDF-1EC1-47E1-A71C-B13B89397DF5@.microsoft.com...
> > hallo it's unclear to me how to address a named instance using a fully
> > qualified name (server-name.database-name.owner-name.object-name)
> > In this syntax, where does the instance name fit?
> >
> > thanks in advance
>
>|||i already tried linking the instance, getting error 15028 - the server
already exists.
In the test case, both the default and the named instance are on the same
server, which is running MSSQL 2000
"Russell Fields" wrote:
> Raffaele,
> server-name is actually linkedserver-name, which may not actually be the
> name of a physical serve. Here is some code from SQL 2005 Books Online
> EXEC sp_addlinkedserver
> @.server='S1_instance1',
> @.srvproduct='',
> @.provider='SQLNCLI',
> @.datasrc='S1\instance1'
> You can see that the instance name is defined in the data source as the
> server 'S1' and the instance '\instance1'. The server name of
> 'S1_instance1' reflects that name, but it could be named
> 'MyFavoriteLinkedServer' or anything else.
> So, then: SELECT * FROM S1_instance1.mydatabase.myowner.MyTable
> RLF
> "Raffaele" <Raffaele@.discussions.microsoft.com> wrote in message
> news:BFDA8EDF-1EC1-47E1-A71C-B13B89397DF5@.microsoft.com...
> > hallo it's unclear to me how to address a named instance using a fully
> > qualified name (server-name.database-name.owner-name.object-name)
> > In this syntax, where does the instance name fit?
> >
> > thanks in advance
>
>|||ok linked server solved! the named instance was already present as "remote
server" since was used for a test replica.
Thanks
"Raffaele" wrote:
> i already tried linking the instance, getting error 15028 - the server
> already exists.|||OK, thanks for the update. - RLF
"Raffaele" <Raffaele@.discussions.microsoft.com> wrote in message
news:DA137E75-C8F2-41B3-8B2F-C94344FB3FB4@.microsoft.com...
> ok linked server solved! the named instance was already present as "remote
> server" since was used for a test replica.
> Thanks
> "Raffaele" wrote:
>> i already tried linking the instance, getting error 15028 - the server
>> already exists.
>