Click here to Skip to main content
15,887,683 members
Home / Discussions / Database
   

Database

 
AnswerRe: How can i check executing time from mssql2008? Pin
Wayne Gaylard6-Nov-11 20:04
professionalWayne Gaylard6-Nov-11 20:04 
AnswerRe: How can i check executing time from mssql2008? Pin
Corporal Agarn8-Nov-11 8:43
professionalCorporal Agarn8-Nov-11 8:43 
Questionemeregency Pin
yousefshokati1-Nov-11 18:43
yousefshokati1-Nov-11 18:43 
AnswerRe: emeregency Pin
Mycroft Holmes1-Nov-11 19:15
professionalMycroft Holmes1-Nov-11 19:15 
GeneralRe: emeregency Pin
yousefshokati1-Nov-11 20:23
yousefshokati1-Nov-11 20:23 
GeneralRe: emeregency Pin
Mycroft Holmes1-Nov-11 20:58
professionalMycroft Holmes1-Nov-11 20:58 
GeneralRe: emeregency Pin
yousefshokati1-Nov-11 21:17
yousefshokati1-Nov-11 21:17 
QuestionStored Procedure to Handle CSV Pin
Franklin Smith31-Oct-11 0:32
Franklin Smith31-Oct-11 0:32 
I have done some searching, and I do understand how to do some of what I want to do. But I can't just do a bulk insert into the database I'm already using.

Sample Data

Real Estate Number,Owner,Street Number,Street,Street Type,Street Direction,Unit,City,Zip Code
004306-5000,MANWARREN JAMES P,10933,BRIDGES,RD,,,Jacksonville,32225-
013092-0164,WILSON DANTE J,8438,MC GIRTS VILLAGE,LN,,,Jacksonville,32225
013100-1035,LEWIS GARNET A,4435,JACKSON HOLE,CT,,,Jacksonville,32225
048496-0040,ALLEN JON R,2830,WICKWIRE,ST,,2,Jacksonville,32225-
112862-1000,CITY OF JACKSONVILLE,0,FT CAROLINE,RD,,,Jacksonville,32225
112863-0000,ONAS CORPORATION,0,FT CAROLINE,RD,,,Jacksonville,32225


Database structure

SQL
SELECT [PropertyID]
      ,[RealEstateNumber]
      ,[Name]
      ,[StreetNumber]
      ,[StreetName]
      ,[Type]
      ,[Direction]
      ,[Unit]
      ,[City]
      ,[ZipCode]
      ,[LastReviewed]
  FROM [DuvalFL].[dbo].[PropertyLookupInformation]


PropertyID is a uniqueidentifier. It defaults to newid()
LastReviewed is a datetime.

I need to get the CSV file(File name changes each time) into a temp table. I don't have a problem with an actual table being made to do a temporary insert and then dropping it at the end of the procedure.

Truncate the Zip Code field to 5 characters.(some of them have a "-" after the first 5 digits)

If the Real Estate Number exists in the database then update the record. Otherwise Insert a new record.

I could do all this from my program, but the DB is faster than using
for or foreach statements to process each record.
AnswerRe: Stored Procedure to Handle CSV Pin
Mycroft Holmes31-Oct-11 1:11
professionalMycroft Holmes31-Oct-11 1:11 
GeneralRe: Stored Procedure to Handle CSV Pin
Franklin Smith31-Oct-11 2:07
Franklin Smith31-Oct-11 2:07 
GeneralRe: Stored Procedure to Handle CSV Pin
Mycroft Holmes31-Oct-11 11:58
professionalMycroft Holmes31-Oct-11 11:58 
GeneralRe: Stored Procedure to Handle CSV Pin
Franklin Smith31-Oct-11 22:02
Franklin Smith31-Oct-11 22:02 
GeneralRe: Stored Procedure to Handle CSV Pin
Mycroft Holmes31-Oct-11 22:52
professionalMycroft Holmes31-Oct-11 22:52 
AnswerRe: Stored Procedure to Handle CSV Pin
PIEBALDconsult1-Nov-11 3:00
mvePIEBALDconsult1-Nov-11 3:00 
Questionmysql client mobile app Pin
Jassim Rahma30-Oct-11 4:58
Jassim Rahma30-Oct-11 4:58 
QuestionFill gaps in rates data with previous working day rates. Pin
Dev S30-Oct-11 3:00
Dev S30-Oct-11 3:00 
AnswerRe: Fill gaps in rates data with previous working day rates. Pin
Mycroft Holmes30-Oct-11 12:52
professionalMycroft Holmes30-Oct-11 12:52 
QuestionGrant a role to another role Pin
Danzy8329-Oct-11 12:31
Danzy8329-Oct-11 12:31 
QuestionJust installed SQL Server 2008 R2 - Where is the app to create/open/add/update/delete DB file? Pin
swampwiz28-Oct-11 0:40
swampwiz28-Oct-11 0:40 
AnswerRe: Just installed SQL Server 2008 R2 - Where is the app to create/open/add/update/delete DB file? Pin
Geoff Williams28-Oct-11 1:29
Geoff Williams28-Oct-11 1:29 
AnswerRe: Just installed SQL Server 2008 R2 - Where is the app to create/open/add/update/delete DB file? Pin
phil.o28-Oct-11 2:25
professionalphil.o28-Oct-11 2:25 
QuestionNeed help with update SQL with subquery Pin
Hypermommy26-Oct-11 3:14
Hypermommy26-Oct-11 3:14 
AnswerRe: Need help with update SQL with subquery Pin
Corporal Agarn26-Oct-11 3:46
professionalCorporal Agarn26-Oct-11 3:46 
AnswerRe: Need help with update SQL with subquery Pin
Hypermommy26-Oct-11 6:03
Hypermommy26-Oct-11 6:03 
QuestionSELECT ... GROUP BY Error Pin
MikeDhaan26-Oct-11 1:07
MikeDhaan26-Oct-11 1:07 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.