Viewing 15 posts - 121 through 135 (of 457 total)
Personally I do something like #2... only after testing. And allowing the rest of the community to sniff out the problems first. Unless there's some sort of...
July 16, 2007 at 6:33 pm
You need to move the joins down...
UPDATE tblMsgIMP
SET ... (that whole string)
FROM tblMsgImp INNER JOIN tblMsgImp AS tblMsgImp_1 ON tblMsgImp.MID = tblMsgImp_1.MID
WHERE ... (where clause)
That should work.
July 15, 2007 at 9:16 pm
Using the syntax EXECUTE @Foo= sprocB will set @Foo to the RETURN value of sprocB. If sprocB issues a SELECT statement, then that result...
July 12, 2007 at 1:06 pm
If you post the query it might be a little easier, but you should be able to do something akin to...
SELECT SUM(period1) + SUM(period2) + SUM(period3) AS allperiodsums
July 12, 2007 at 1:02 pm
At my work we have a gym, the option to meet with a personal trainer once per week for personal or group classes. Breakfast catered once per month with...
July 12, 2007 at 11:54 am
Try the object_name() function... 😉
SELECT object_name(12345)
July 11, 2007 at 2:52 pm
Sergiy has a good way down the line... in the interim if you need to find all procedures containing a certain string:
select * from information_Schema.routines where routine_definition like '%linkedsrvname%'
July 10, 2007 at 5:28 pm
Also NOT IN can cause serious performance issues, you're always better off using a left anti-semi join as Daryl illustrated.
July 9, 2007 at 2:49 pm
I'm not sure how different it is (haven't tested it yet), but I recall reading an article a few years back that said that this method was actually the fastest:
DATEADD(dd,...
July 6, 2007 at 10:18 am
I'm sure you can do it via an SSIS package, but honestly I'd rather do it using sys.xp_fileexist.
Try doing:
EXEC master.sys.xp_fileexist 'C:\Folder\Myfile.ext'
July 5, 2007 at 3:36 pm
CREATE PROCEDURE MyTestProc
AS
DECLARE @Err INT
SELECT GETDATE()
SELECT @Err = @@ERROR
IF @Err 0
BEGIN
RAISERROR(‘My Error’,16,9)
RETURN(@err)
END
ELSE
RETURN(0)
Usually setting a return value which is nonzero indicates failure.
July 5, 2007 at 12:14 pm
Are you a member of the administrators group on the local machine?
July 3, 2007 at 4:28 pm
Maybe I haven't had my coffee yet, but you should be able to just replace NumOrders with COUNT(*)...
CASE
WHEN COUNT(*) > 100 THEN 'Bonus'
ELSE 'No Bonus'
END
Also drop off the second column...
July 3, 2007 at 9:38 am
Perhaps give an example of what you're trying to do (even if it won't work)?
July 2, 2007 at 4:18 pm
Look into using the CHAR() function (not the datatype). If I recall correctly it's something like CHAR(13).
June 27, 2007 at 11:27 am
Viewing 15 posts - 121 through 135 (of 457 total)