Viewing 15 posts - 1,291 through 1,305 (of 1,314 total)
How about this:
DECLARE @NewBudgetID INT
IF (Select Min(BudgetID) as NewBudgetID from tblBudgetYear) > 1
Set @NewBudgetID = 1
ELSE
Select @NewBudgetID = top 1 BudgetID + 1 from tblBudgetYear x
where not exists(Select NULL from...
August 31, 2003 at 6:16 am
5409045121009's solution is a derived table, not a correlated subquery. The F(..) that looks like a function is the table alias of the derived table. It's just like...
August 31, 2003 at 5:18 am
You are using the graphical DTS designer when you work with DTS packages in Enterprise Manager, but they are actually run by the DTSRUN utility which has no licensing requirement....
August 18, 2003 at 5:17 pm
If you selected "Copy object-level permissions" it would not do anything evil, but you must have the same logins set up in the source and destination databases. This will...
August 18, 2003 at 4:48 pm
I would certainly try the other solutions that have been suggested first, but if you really need to modify a large table on a disk-space-limited system, you may have to...
August 8, 2003 at 7:18 pm
I use an ActiveX component called ActiveGender for this. It only costs $250, and it can deal with a lot of variations like hyphenated names, multi-part names, etc. ...
August 8, 2003 at 6:41 pm
According to BOL, if you include the IGNORE_DUP_KEY option on a CREATE UNIQUE INDEX statement (clustered or nonclustered), you will get a warning for duplicate key values but the non-duplicate...
August 8, 2003 at 6:04 pm
You can't edit the function after you it is owned by system_function_schema. You will also have trouble viewing the function in Enterprise Manager or any SQL_DMO based application.
You must...
August 6, 2003 at 5:27 pm
Don't forget to handle NULLS:
WHERE ISNULL(d.dtmScheduledDate,'1/1/1980') <> ISNULL(wom.dtmScheduledDate,'1/1/1980')
August 5, 2003 at 7:46 am
You can select the updated rows without a cursor:
SELECT PrimaryKey, refno FROM inserted WHERE UPDATE(refno)
or
SELECT PrimaryKey, d.refno as Before, i.refno as After
FROM inserted i
INNER JOIN deleted d on i.PrimaryKey =...
August 4, 2003 at 1:19 pm
Really bad practice - assuming web hosting companies know how to set up SQL Server boxes.
This is the second company I've been at where the hosted SQL servers were set...
July 31, 2003 at 7:08 pm
That seems to have done the trick. The report now has a batch of "Delete old backup files..." lines after the backup & verify section.
It will be a shame...
July 31, 2003 at 6:18 pm
There are no errors in the reports.
This is a generic maintenance plan to backup all databases, so it also applies to system dbs. The transaction log backup statements for...
July 31, 2003 at 4:30 pm
How about manual ad-hoc changes to production data?
I worked for a company that used a web-based system to handle used car sales between leasing companies and wholesale dealers. We...
July 30, 2003 at 5:48 pm
My first exposure to triggers was trying to debug triggers left behind by some whacko they had gotten rid of. He had error handling built into all the triggers...
July 30, 2003 at 5:36 pm
Viewing 15 posts - 1,291 through 1,305 (of 1,314 total)