Viewing 15 posts - 286 through 300 (of 3,738 total)
I execute the following Query:
INSERT INTO POSTAL (ID,Latitude, ID.Longitude, CityTownshipID, CountyRegionID,StateProvinceID,CountryID)
SELECT ZipCode, Latitude, Longitude,CityTownshipID , CountyRegionID, StateProvinceID, CountryID
FROM Postal_Codes_Import
WHERE NOT EXISTS (SELECT *
...
January 14, 2016 at 1:13 pm
Phil Parkin (1/14/2016)
You should include table schemas in your code to...
January 14, 2016 at 12:50 pm
Yes there are 3 duplicates when I do a INNER JOIN but I exclude them in the Insert and I keep getting PK Violations. :unsure:
January 14, 2016 at 12:48 pm
Perhaps a Data Type issue?
Table Structure:
CREATE TABLE [dbo].[Postal](
[ID] [varchar](16) NOT NULL,
[Latitude] [float] NOT NULL,
[Longitude] [float] NOT NULL,
[CityTownshipID] [int] NOT NULL,
[CountyRegionID] [int] NULL,
[StateProvinceID] [int] NOT NULL,
[CountryID] [int] NOT NULL,
CONSTRAINT [PK_Postal]...
January 14, 2016 at 12:30 pm
Eric M Russell (1/14/2016)
Like what it says: "Cannot insert duplicate key in object 'dbo.Postal'."Perhaps you're attempting to insert a row that already exists in the target table.
That is correct.
I'm trying...
January 14, 2016 at 12:23 pm
Phil Parkin (1/14/2016)
You should include table schemas in your code to...
January 14, 2016 at 12:21 pm
Phil Parkin (1/14/2016)
Why would the Id be the same as the ZipCode?
The ZipCode is named ID.
January 14, 2016 at 12:20 pm
That would help if I included the error. :blush:
Violation of PRIMARY KEY constraint 'PK_Postal'. Cannot insert duplicate key in object 'dbo.Postal'. The duplicate key value is (B5A 5B4).
January 14, 2016 at 12:09 pm
I recall using SSMS and electing the Full Backup file, the latest differential and manually selecting all of the Transaction Log Backups.
I do not remember the steps that I took...
January 8, 2016 at 2:20 pm
J Livingston SQL (1/8/2016)
http://bfy.tw/3d5nhope this helps.
Happy New Year Welsh.
Thanks for the link but I could not find what I was looking for.
Happy New Year.
January 8, 2016 at 12:21 pm
johnwalker10 (12/29/2015)
Use ALTER AUTHORIZATION on the databases which have the NULL login match for dbo.
ALTER AUTHORIZATION ON DATABASE::Example TO sa;
Is this not the same as what was recommended in the...
December 30, 2015 at 6:17 am
JeremyE (12/29/2015)
Check to see if the publisher database has a valid owner by running the...
December 30, 2015 at 6:15 am
Welsh Corgi (12/28/2015)
I just need to convert the following into a Delete Statement for the records in Database PrismDsta.Thank you.
Your code is very cleaver and the other post that were...
December 28, 2015 at 11:26 am
I very much appreciate all of the help.
I'm only dealing with 50,,, records.
When I performed the archive I had a lookup table that stored the Batch Size etc.
Can I do...
December 28, 2015 at 10:06 am
Ed Wagner (12/28/2015)
December 28, 2015 at 9:55 am
Viewing 15 posts - 286 through 300 (of 3,738 total)