Search found 97 matches

by miketartaglia
Tue Jan 02, 2018 11:42 am
Forum: Windows PowerShell
Topic: Trouble with multiple Device ID's (Local Hard drives)
Replies: 43
Views: 6490

Re: Trouble with multiple Device ID's (Local Hard drives)

The process is
1. Search the view and select all rows with their ID field.
2. Take the list of ID's and modify each row with the respective EndDate, EndTime, and EndSpace.
by miketartaglia
Tue Jan 02, 2018 6:39 am
Forum: Windows PowerShell
Topic: Trouble with multiple Device ID's (Local Hard drives)
Replies: 43
Views: 6490

Re: Trouble with multiple Device ID's (Local Hard drives)

there can be more than one row with SystemName + DeviceID being the same. What about including the ID field with the systemane + DeviceID. Would that work or should I not add the ID field as you mentioned before?
by miketartaglia
Thu Dec 28, 2017 11:34 am
Forum: Windows PowerShell
Topic: Trouble with multiple Device ID's (Local Hard drives)
Replies: 43
Views: 6490

Re: Trouble with multiple Device ID's (Local Hard drives)

Oh I think I see where your confusion is. The PRIMARY KEY is the ID field in the image I sent. However, now that I looked at the database design I never assigned it to be the primary key. DOH! It is set as one now. The start block will happen at 12:01AM every morning and the end will happen at 11:59...
by miketartaglia
Thu Dec 28, 2017 10:42 am
Forum: Windows PowerShell
Topic: Trouble with multiple Device ID's (Local Hard drives)
Replies: 43
Views: 6490

Re: Trouble with multiple Device ID's (Local Hard drives)

table.png This is the table I am working with. As you can see I have an ID field (Which is the primary key). Here are the steps I am thinking of performing in order to update the the 'END' fields. NOTE: There is a SQ: view that shows all records that are NULL for the END fields as shown in the atta...
by miketartaglia
Thu Dec 28, 2017 7:53 am
Forum: Windows PowerShell
Topic: Trouble with multiple Device ID's (Local Hard drives)
Replies: 43
Views: 6490

Re: Trouble with multiple Device ID's (Local Hard drives)

We do have a field called 'ID' that is the primary key. I am not sure what you are trying to get at. The schema is fine for what I am doing, I am just having trouble coding it in powershell.

I will keep at it.

Thank you for your assistance. Greatly appreciated.
by miketartaglia
Thu Dec 28, 2017 7:27 am
Forum: Windows PowerShell
Topic: Trouble with multiple Device ID's (Local Hard drives)
Replies: 43
Views: 6490

Re: Trouble with multiple Device ID's (Local Hard drives)

Sorry for the lack of clarity. the START switch only enters start date, start time and current free space at that time on each local disk. This leave 3 fields set to NULL. Endate, EndTime and EndSpace (current free space at the time on each local disk. All the end switch is supposed to do and did do...
by miketartaglia
Wed Dec 27, 2017 2:56 pm
Forum: Windows PowerShell
Topic: Trouble with multiple Device ID's (Local Hard drives)
Replies: 43
Views: 6490

Re: Trouble with multiple Device ID's (Local Hard drives)

Yes that is what I show while in the debugger with a breakpoint.

I think if I query on the ID field (auto incremented field) in the view, I may be able to use a where command in the sql statement.
by miketartaglia
Wed Dec 27, 2017 2:42 pm
Forum: Windows PowerShell
Topic: Trouble with multiple Device ID's (Local Hard drives)
Replies: 43
Views: 6490

Re: Trouble with multiple Device ID's (Local Hard drives)

That made some progress. Now all the EndSpace fields in three rows are identical numbers which is impossible since it is looking at different volumes and servers.
by miketartaglia
Wed Dec 27, 2017 1:42 pm
Forum: Windows PowerShell
Topic: Trouble with multiple Device ID's (Local Hard drives)
Replies: 43
Views: 6490

Re: Trouble with multiple Device ID's (Local Hard drives)

This is what I have but this doesn't look right.

$tmplt = @'
UPDATE dbo.NoendDate (EndDate, EndTime, EndSpace)
VALUES('{0}', '{1}', '{2}')
'@