Click here to Skip to main content
16,004,882 members
Home / Discussions / Database
   

Database

 
AnswerRe: Probably an old Insert question Pin
pmarfleet27-Nov-07 4:02
pmarfleet27-Nov-07 4:02 
GeneralRe: Probably an old Insert question Pin
ffowler27-Nov-07 4:30
ffowler27-Nov-07 4:30 
GeneralRe: Probably an old Insert question Pin
pmarfleet27-Nov-07 4:34
pmarfleet27-Nov-07 4:34 
GeneralRe: Probably an old Insert question Pin
ffowler27-Nov-07 4:41
ffowler27-Nov-07 4:41 
Questionimport HOST file into a table Pin
solutionsville27-Nov-07 2:46
solutionsville27-Nov-07 2:46 
AnswerRe: import HOST file into a table Pin
pmarfleet27-Nov-07 3:29
pmarfleet27-Nov-07 3:29 
GeneralRe: import HOST file into a table Pin
solutionsville27-Nov-07 3:34
solutionsville27-Nov-07 3:34 
GeneralRe: import HOST file into a table [modified] Pin
pmarfleet27-Nov-07 3:57
pmarfleet27-Nov-07 3:57 
solutionsville wrote:
I guess I was kinda vauge... Mind is elsewhere. Funeral today.


Sorry to hear that.

solutionsville wrote:
I want to write an SQL script that looks at the Windows HOSTS File and reads the IP / host name into two columns of a table.


You could write a small .NET program to read the contents of your HOSTS file into SQL Server. Use the System.IO.File.ReadAllLines() to load the contents of the file into an array. Then do some string manipulation to separate the IP address and host name for each entry. Then use ADO.NET to load the data into your database.

solutionsville wrote:
I next want to write a SQL Script that I can run as a job and validate the entries in the hosts file and if they have changed then modify the table data.


You could achieve this by using SQL Server AGent to set up a job that runs periodically.

solutionsville wrote:
I will also send a diff email to myself noting any changes(the email piece I have figured out).


You can write code in T-SQL to send mail. Have a look at this article[^]. You could invoke this from your SQL Server Agent job.

Hope this helps.


-- modified at 10:12 Tuesday 27th November, 2007

I forgot to include the link to the email article. I've put it in now.

Paul Marfleet

"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush


AnswerRe: import HOST file into a table Pin
solutionsville27-Nov-07 4:04
solutionsville27-Nov-07 4:04 
Questionupdate a field in a specified record in sql from asp.net Pin
Big Ralph27-Nov-07 0:44
Big Ralph27-Nov-07 0:44 
QuestionBreakPoints in Stored Procedures Pin
Zuhair Rizvi27-Nov-07 0:38
Zuhair Rizvi27-Nov-07 0:38 
AnswerRe: BreakPoints in Stored Procedures Pin
Vasudevan Deepak Kumar27-Nov-07 0:43
Vasudevan Deepak Kumar27-Nov-07 0:43 
GeneralRe: BreakPoints in Stored Procedures Pin
Zuhair Rizvi27-Nov-07 0:54
Zuhair Rizvi27-Nov-07 0:54 
QuestionRestore Database from C# Pin
tr_thorn26-Nov-07 20:23
tr_thorn26-Nov-07 20:23 
AnswerRe: Restore Database from C# Pin
SimulationofSai26-Nov-07 21:11
SimulationofSai26-Nov-07 21:11 
GeneralRe: Restore Database from C# Pin
tr_thorn26-Nov-07 22:49
tr_thorn26-Nov-07 22:49 
GeneralRe: Restore Database from C# Pin
Colin Angus Mackay26-Nov-07 22:52
Colin Angus Mackay26-Nov-07 22:52 
GeneralRe: Restore Database from C# Pin
SimulationofSai27-Nov-07 0:16
SimulationofSai27-Nov-07 0:16 
GeneralRe: Restore Database from C# Pin
tr_thorn27-Nov-07 20:44
tr_thorn27-Nov-07 20:44 
GeneralRe: Restore Database from C# Pin
SimulationofSai27-Nov-07 22:14
SimulationofSai27-Nov-07 22:14 
QuestionFetching rows in cursors Pin
mgr_2k726-Nov-07 19:20
mgr_2k726-Nov-07 19:20 
AnswerRe: Fetching rows in cursors Pin
Joe26-Nov-07 20:57
Joe26-Nov-07 20:57 
GeneralRe: Fetching rows in cursors Pin
mgr_2k726-Nov-07 21:58
mgr_2k726-Nov-07 21:58 
GeneralRe: Fetching rows in cursors Pin
Pete O'Hanlon26-Nov-07 22:39
mvePete O'Hanlon26-Nov-07 22:39 
GeneralRe: Fetching rows in cursors Pin
andyharman26-Nov-07 23:29
professionalandyharman26-Nov-07 23:29 

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.