Viewing 15 posts - 12,196 through 12,210 (of 13,460 total)
you want to drop only the tables that are related to your connection; your IF EXISTS statement checks accross all connections, so you could pick up a temp table from...
Lowell
December 3, 2007 at 10:52 am
yeah, in order to have a changedDt column with the last Updated/changed, you'd need to add a trigger to the table. with the trigger, you'd be able to update the...
Lowell
December 3, 2007 at 9:44 am
the timestamp datatype lets you know the last affected automatically, but it's not a datetime field;
here's an example:
create table #sample(somevalue varchar(30),CreatedDt datetime default getdate(),ChangedDt timestamp)
insert into #sample(somevalue) values('value 1')
insert into...
Lowell
December 3, 2007 at 7:30 am
i use this cursor below on our dev machine at work;
it runs as a job twice a day, which is often enough to switch any new or newly restored databases...
Lowell
November 30, 2007 at 10:24 am
it's kinda straightforward i think; a case statement can return only one datatype.
when the case is constructed, i think it is assuming the first item int he case statement will...
Lowell
November 30, 2007 at 7:09 am
AFTER YOU PRINT YOUR VARIABLE, I THINK YOU'LL SEE HTE MISSING OPEN PARENTHESIS FOR OBJECT_ID FUNCTION:
parent_object_id = OBJECT_ID(' + @table + ')'
Lowell
November 29, 2007 at 7:13 pm
when i reformatted your sql for readability, it was missing a couple of commas.
this works:
CREATE TABLE BATCHES_LOTS (
[BATCHNO] varchar (15),
[TRANSFERID] int,
CONSTRAINT PK_BATCHES_LOT PRIMARY KEY (BATCHNO,TRANSFERID ))
CREATE...
Lowell
November 29, 2007 at 10:34 am
i googled for "oracle epoch date" and found a lot of stuff.
one of the more obvious selectiosn was where they took the datatime as a double, and subtracted it from...
Lowell
November 29, 2007 at 5:32 am
Andras's example of the trigger determining what changed is perfect...but you want to send the email outside of the trigger code, and not inside it.
remember that a trigger needs to...
Lowell
November 29, 2007 at 5:05 am
the case statment is for a field, I think you thought you needed to identify the table and where for each case, and that's not true:
this is syntactically correct:
DECLARE @Ind...
Lowell
November 29, 2007 at 4:46 am
here's how I do it as a scheduled job; i don't need instant updates via a trigger:
--new records first
INSERT INTO ARCHIVETABLE(list_of_Columns)
SELECT list_of_Columns from ACTIVETABLE
LEFT OUTER JOIN ARCHIVETABLE ON...
Lowell
November 29, 2007 at 4:40 am
SET QUERY_GOVERNOR_COST_LIMIT sets the limit for all commands in a batch, not at a connection or user level. so the limit was invoked during the life of the trigger execution,...
Lowell
November 19, 2007 at 9:38 am
there's so many levels you can check, it depends on what you want to do.
For example:
--you can ping a server via a script to see if DNS works/server exists on...
Lowell
November 16, 2007 at 10:01 am
the SET NOCOUNT ON command is to affect all of the subsequent commands in the batch you are running....
if you were to set it off at the end of a...
Lowell
November 15, 2007 at 10:52 am
yeah a double reverse will work here; i broke it into a couple of steps to make it a bit more obvious:
declare @filename varchar(1000)
set @filename = 'C:\Program Files\Microsoft SQL Server\MSSQL\BACKUP\MyFile.txt'
select...
Lowell
November 14, 2007 at 11:11 am
Viewing 15 posts - 12,196 through 12,210 (of 13,460 total)