Click here to Skip to main content
16,012,061 members
Home / Discussions / Database
   

Database

 
AnswerRe: SQL CONNECTION STRING Pin
Colin Angus Mackay25-Aug-06 2:57
Colin Angus Mackay25-Aug-06 2:57 
AnswerRe: SQL CONNECTION STRING Pin
Not Active25-Aug-06 4:11
mentorNot Active25-Aug-06 4:11 
AnswerRe: SQL CONNECTION STRING Pin
S Pandian25-Aug-06 22:36
S Pandian25-Aug-06 22:36 
AnswerRe: SQL CONNECTION STRING Pin
S Douglas27-Aug-06 23:21
professionalS Douglas27-Aug-06 23:21 
QuestionMaster detail forms Question (how to iterate the detail table thru datagridview) Pin
Rocky#25-Aug-06 0:58
Rocky#25-Aug-06 0:58 
QuestionUpdate new date in database Pin
Fu Manchu24-Aug-06 23:31
Fu Manchu24-Aug-06 23:31 
AnswerRe: Update new date in database Pin
mr_lasseter25-Aug-06 2:57
mr_lasseter25-Aug-06 2:57 
AnswerRe: Update new date in database Pin
Eric Dahlvang25-Aug-06 4:02
Eric Dahlvang25-Aug-06 4:02 
It is a strange practice to name your field timestamp and then fill them with a datetime or smalldatetime data type. I'm assuming that your timestamp field is in fact a datetime or smalldatetime, because the timestamp data type is binary - and would not update without error using the dateadd as you show. Plus, the timestamp data type is updated automaticaly when you change the value of a field.

Anyway, if your timestamp fields are in fact dates, this should work:
DECLARE @cSQL varchar(100)
DECLARE @cTableName varchar(100)

SELECT @cSQL = ''

DECLARE  TableNames CURSOR FOR 
SELECT DISTINCT table_name 
FROM INFORMATION_SCHEMA.COLUMNS 
WHERE column_name = 'timestamp'

OPEN TableNames
FETCH NEXT FROM TableNames INTO @cTableName 
WHILE @@FETCH_STATUS = 0
BEGIN
	EXEC('UPDATE ' + @cTableName + ' SET timestamp = DATEADD(d,430,timestamp)')

	FETCH NEXT FROM TableNames INTO @cTableName 
END

CLOSE TableNames
DEALLOCATE TableNames 


--EricDV Sig---------
Some problems are so complex that you have to be highly intelligent and well informed just to be undecided about them.
- Laurence J. Peters

QuestionPopulate label from SQL query... Pin
japel24-Aug-06 20:03
japel24-Aug-06 20:03 
AnswerRe: Populate label from SQL query... Pin
Colin Angus Mackay24-Aug-06 22:47
Colin Angus Mackay24-Aug-06 22:47 
GeneralRe: Populate label from SQL query... Pin
japel25-Aug-06 0:17
japel25-Aug-06 0:17 
Questionhow do i print the number of rows with same item in 1 column? [modified] Pin
kozu24-Aug-06 17:49
kozu24-Aug-06 17:49 
AnswerRe: how do i print the number of rows with same item in 1 column? Pin
Colin Angus Mackay24-Aug-06 22:44
Colin Angus Mackay24-Aug-06 22:44 
AnswerRe: how do i print the number of rows with same item in 1 column? Pin
Eric Dahlvang25-Aug-06 4:23
Eric Dahlvang25-Aug-06 4:23 
GeneralRe: how do i print the number of rows with same item in 1 column? Pin
kozu25-Aug-06 4:53
kozu25-Aug-06 4:53 
QuestionSQL and C# problem [modified] Pin
William Ten Broek24-Aug-06 11:30
William Ten Broek24-Aug-06 11:30 
AnswerLDAP Pin
Ennis Ray Lynch, Jr.24-Aug-06 11:33
Ennis Ray Lynch, Jr.24-Aug-06 11:33 
QuestionHow to do a Select/Where x=NULL Pin
TheJudeDude24-Aug-06 11:09
TheJudeDude24-Aug-06 11:09 
AnswerRe: How to do a Select/Where x=NULL Pin
Colin Angus Mackay24-Aug-06 11:19
Colin Angus Mackay24-Aug-06 11:19 
GeneralRe: How to do a Select/Where x=NULL Pin
TheJudeDude24-Aug-06 11:25
TheJudeDude24-Aug-06 11:25 
AnswerRe: How to do a Select/Where x=NULL Pin
S Pandian25-Aug-06 22:37
S Pandian25-Aug-06 22:37 
QuestionProgramming SQL Database Question Pin
Jethro6324-Aug-06 10:11
Jethro6324-Aug-06 10:11 
AnswerRe: Programming SQL Database Question Pin
Colin Angus Mackay24-Aug-06 11:23
Colin Angus Mackay24-Aug-06 11:23 
GeneralRe: Programming SQL Database Question Pin
Jethro6327-Aug-06 21:22
Jethro6327-Aug-06 21:22 
GeneralRe: Programming SQL Database Question Pin
Colin Angus Mackay27-Aug-06 21:51
Colin Angus Mackay27-Aug-06 21:51 

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.