Viewing 15 posts - 91 through 105 (of 595 total)
One thing to watch out for, though: if you have foriegn key constraints that are dependent on the IDENTITY key, then you will have to DROP the constraints before you...
August 18, 2003 at 12:57 pm
AHA, now I see what you were trying to do...
Your best bet is to just create a new table that is a duplicate of your old table, then COPY the...
August 18, 2003 at 12:55 pm
Use the IDENTITY attribute in the ALTER/CREATE TABLE statement to specify the increment value. Look in BooksOnLine, "ALTER TABLE", or "IDENTITY" for more information. BTW, the table is...
August 18, 2003 at 12:37 pm
SELECT
'Announcement'
, ItemID
, ModuleID
, CreatedByUser
, CreatedByDate
FROM Announcements
WHERE
DATEADD(d, 0, DATEDIFF(d, 0, CreateDate)) >= DATEADD(d, -7, DATEDIFF(d, 0, GETDATE())
UNION
SELECT
'Document'
, ItemID
, ModuleID
, CreatedByUser
,...
August 18, 2003 at 12:30 pm
quote:
Well, that is not helpful. I ended up changing to "IF..Then" but seems like there should be...
August 18, 2003 at 11:45 am
-- Be sure to declare variables output in
-- the execute line of the batch...
declare @input1 varchar(10)
declare @input2 varchar(10)
declare @output1 varchar(10)
declare @output2 varchar(10)
--
execute myProc @input1, @input2, @output1...
August 18, 2003 at 11:26 am
declare @seconds int
--
set @seconds = 124
--
select convert(varchar(2), floor(@seconds/60)) + ':' + right('0' + convert(varchar(2), (@seconds%60)), 2)
August 18, 2003 at 11:22 am
select top 100 so.name, sc.text
from sysobjects so
inner join syscomments sc
on so.id = sc.id
where so.xtype = 'P'
and patindex('%TableName%',...
August 18, 2003 at 11:14 am
CASE should go in a SELECT statement. In other words, either change your statement to a SELECT, or change your case statements to an IF block. Remember, CASE...
August 18, 2003 at 6:54 am
DECLARE @LockDateBegin SMALLDATETIME
SELECT @LockDateBegin =
CASE
WHEN (DATEPART(dw, GETDATE() = 3
AND DATEPART(hh, GETDATE() >= 16) THEN
...
August 13, 2003 at 12:03 pm
Books Online suggests putting the database into single-user mode for the during of the operation causing this error, if possible. Also, since you are using TRUNCATE TABLE, it is...
August 13, 2003 at 11:37 am
Really not quite sure. Unless you can identify some sort of patterns as to when the job fails, I'm not sure why the proc would return that error, particularly...
August 13, 2003 at 11:03 am
When do you run such a procedure, and how often? There doesn't seem to anything particularly unusual about the procedure, unless the tables in question are enormous and the...
August 13, 2003 at 9:29 am
Viewing 15 posts - 91 through 105 (of 595 total)