Viewing 15 posts - 76 through 90 (of 172 total)
You can divide the where clause in to multiple parts, meaning that on a really bad day you can end up with:
EXEC (@SelectPart1 + @WhereClause1 + @SelectPart2 + @WhereClause1 +...
September 8, 2004 at 4:42 pm
sure enough, you're missing a ) at the end
join lane.dbo.serviceaddr ls on (cast(a.aglaccountnumber as int)=(cast(ls.ldcaglnum as int)))
September 8, 2004 at 3:08 pm
If you're using a transform data task you could always hit the source SQL with something like:
RTRIM(REPLACE(REPLACE(County,'County',''),'Borough','')) AS County
September 7, 2004 at 5:40 pm
Hello. I agree that using the easier script is the way to go.
With that said, it sounds like someone attacked the DATEDIFF before looking at my script
September 7, 2004 at 11:57 am
A script was posted many moons ago that took on this issue from T-SQL, I've neved had a need to actually try it out but it looks like it should...
September 7, 2004 at 11:40 am
USE pubs
SELECT CASE WHEN MaxJobID > MaxJobLevel THEN MaxJobID ELSE MaxJobLevel END AS MaxValue
from
(SELECT MAX(job_id) AS MaxJobID
from employee)
AS JobID
cross join
(SELECT MAX(job_lvl) AS MaxJobLevel
from employee)
AS JobLvl
September 7, 2004 at 11:18 am
couple thoughts:
Whatever is updating the data can set a datetime field to GETDATE() either in the actual table or in a secondary table
If you use a trigger to update a field...
September 7, 2004 at 10:34 am
You'll want to use DATEPART to write this, good information about DATEPART can be found in Books Online (BOL).
Note that it will take a bit of coding to format...
September 6, 2004 at 3:38 pm
How about this recently posted script?
http://www.sqlservercentral.com/scripts/contributions/1158.asp
If not, what else do you need?
September 6, 2004 at 3:09 pm
I can't help you with your problem, and yes it does sound dodgy.
However, I can assure you that in AD you can rename a server and bring it back on-line...
September 6, 2004 at 2:03 pm
CREATE FUNCTION fnYearsOld (@DOB datetime, @CurrentDate datetime)
RETURNS varchar(3) AS
BEGIN
DECLARE @YearsOld varchar(3)
Set @YearsOld = Year(@CurrentDate) - Year(@DOB) -
(CASE WHEN CONVERT(datetime,
CONVERT(varchar(50),YEAR(@CurrentDate))
+'-'+
CONVERT(varchar(50),MONTH(@DOB))
+'-'+
CONVERT(varchar(50),DAY(@DOB)))
> @CurrentDate THEN 1 ELSE 0 END)
Return @YearsOld
END
modify to check @YearsOld...
September 3, 2004 at 3:12 pm
One more thought, JavaScript can also be used to hide and unhide panels containing each individual dataset. The big problem, as with the two top statements, is when result sets become very...
September 3, 2004 at 2:59 pm
I'd follow the obvious to the programmer thought. I'd approach it a bit more dynamicly, though. If the sproc is performing business logic then I'd only branch to another sproc...
September 3, 2004 at 2:54 pm
I don't know of anything but then again I've found a variable to be very easy.
September 3, 2004 at 2:09 pm
here's a quick example,note that the commented out version will not work:
Server: Msg 117, Level 15, State 2, Line 7
The number name Server2.Northwind.dbo.Orders' contains more than the maximum number of...
September 3, 2004 at 2:03 pm
Viewing 15 posts - 76 through 90 (of 172 total)