Forum Replies Created

Viewing 15 posts - 76 through 90 (of 173 total)

  • RE: Varchar too small, Text too difficult; Now What?

    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 +...



    Everett Wilson
    ewilson10@yahoo.com

  • RE: Help with Joins??!!

    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)))



    Everett Wilson
    ewilson10@yahoo.com

  • RE: Removing words and spaces using DTS

    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



    Everett Wilson
    ewilson10@yahoo.com

  • RE: How to find out a person is reached 21 years old?

    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



    Everett Wilson
    ewilson10@yahoo.com

  • RE: How to export Resultset from cursor to excel

    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...



    Everett Wilson
    ewilson10@yahoo.com

  • RE: Find higher number of 2 columns

    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



    Everett Wilson
    ewilson10@yahoo.com

  • RE: Table last updated??

    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...



    Everett Wilson
    ewilson10@yahoo.com

  • RE: Help with SQL- difference between dates\time

    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...



    Everett Wilson
    ewilson10@yahoo.com

  • RE: Howto find Statement permissions

    How about this recently posted script?

    http://www.sqlservercentral.com/scripts/contributions/1158.asp

    If not, what else do you need?



    Everett Wilson
    ewilson10@yahoo.com

  • RE: Remote servers in sysservers

    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...



    Everett Wilson
    ewilson10@yahoo.com

  • RE: How to find out a person is reached 21 years old?

    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...



    Everett Wilson
    ewilson10@yahoo.com

  • RE: PAGING? Is there something similar to MYSQL "LIMIT"

    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...



    Everett Wilson
    ewilson10@yahoo.com

  • RE: Multiple SPs versus SP with branches

    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...



    Everett Wilson
    ewilson10@yahoo.com

  • RE: Keeping track of the cursor row number

    I don't know of anything but then again I've found a variable to be very easy.



    Everett Wilson
    ewilson10@yahoo.com

  • RE: Query from 2 different servers (SS 7.0 and SS 2k)

    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...



    Everett Wilson
    ewilson10@yahoo.com

Viewing 15 posts - 76 through 90 (of 173 total)