Forum Replies Created

Viewing 15 posts - 256 through 270 (of 1,086 total)

  • RE: DISTINCT TOP

    I don't have any data to try this with, but you may also try this approach: 

    SELECT topics.topic_id, topics.topic_title, posts.post_time

    FROM tbl_topics topics

       INNER JOIN( SELECT DISTINCT TOP 5 tbl_posts.topic_id,...

    I wasn't born stupid - I had to study.

  • RE: What''''s wrong with this ?

    Is this what you want?

    DECLARE @t TABLE( Field1 varchar(10))

    INSERT INTO @t VALUES( 'Admit')

    SELECT * FROM @t

    I wasn't born stupid - I had to study.

  • RE: Search by Stored Procedure size

    Yeah, but there are like thousands, so I was hoping for some internal function, (quick and dirty select, you know?).  Short of something nice like that, I may have to...

    I wasn't born stupid - I had to study.

  • RE: Convert ANSI-SQL to T-SQL

    My initial reaction is two-fold.  One, are you jumping between databases?  Two, is the BETWEEN @Date + '00:00:00' working? 

    What error are you getting? 

    I wasn't born stupid - I had to study.

  • RE: What''''s wrong with this ?

    SELECT @t will give you a result. 

    SELECT * FROM @t is treating @t as a Table Variable...

     

    I wasn't born stupid - I had to study.

  • RE: Search by Stored Procedure size

    Thanks, but it errored. 

    Server: Msg 1540, Level 16, State 1, Line 1

    Cannot sort a row of size 8098, which is greater than the allowable maximum of 8094.

     

    I can do...

    I wasn't born stupid - I had to study.

  • RE: CharIndex function, a bug???

    Me too.  (Generally when I have used CHARINDEX, I subtract one for replacement or parsing...) 

    I wasn't born stupid - I had to study.

  • RE: deleting through xp_cmdshell

    Have you tried including the no_output parameter?

    xp_cmdshell {'command_string'} [, no_output]

     

    I wasn't born stupid - I had to study.

  • RE: Transform rows into columns

    Not the best solution, but should work. 

    (Thanks sue)

    I wasn't born stupid - I had to study.

  • RE: Rewritng a delete statement

    Glad to help.  I did not know your tables, so I just had to wing what I saw. 

    I wasn't born stupid - I had to study.

  • RE: Cross Tab Query

    Here is a possible way to do it dynamically so you do not have to hardcode the Project Code: 

    (chances are good you can do this more efficiently through an...

    I wasn't born stupid - I had to study.

  • RE: Rewritng a delete statement

    I had to re-write this so I could understand it a bit better.  I believe your change is superior and accomplishes the same thing.  Basically, you use a direct join...

    I wasn't born stupid - I had to study.

  • RE: Is data type checking possible in T-SQL

    I am hoping you have some knowledge of the datatypes that could be passed in. 

    Use IF statements with the various "IS" functions, (ISDATE, ISNUMERIC, ISNULL...) to test and you...

    I wasn't born stupid - I had to study.

  • RE: Try to get one record per employee for the most current pay date

    That's true too.  If that table has a "most recent date", (or something like that) you can do it as an INNER JOIN( SELECT Address, MAX( RecentDate) FROM EmployeeAddress GROUP...

    I wasn't born stupid - I had to study.

  • RE: Try to get one record per employee for the most current pay date

    Take u3.CHECKDATE out of your GROUP BY

    I wasn't born stupid - I had to study.

Viewing 15 posts - 256 through 270 (of 1,086 total)