Forum Replies Created

Viewing 15 posts - 61 through 75 (of 83 total)

  • RE: Query Results as mail using sp_send_dbmail --- Text formatting issue

    ar-727381 (9/29/2009)


    its still not formatted.

    @query = 'select top 2 customerid, contactname, city from customers'

    I know, sorry about that (see my Edit in my original response). How about:

    @query = 'select...

  • RE: Query Results as mail using sp_send_dbmail --- Text formatting issue

    You may want to play around with the following (from BOL):

    [ @body_format = ] 'body_format'

    Is the format of the message body. The parameter is of type varchar(20), with a default...

  • RE: Converting bigint value to time

    Hmmm....okay. Do you have any other examples (the integer numbers and the dates they correspond to)?

    MJM

  • RE: Converting bigint value to time

    Question - what does 519810000000 represent? In other words, how do you know what the correct answer is in terms of that datetime you have in your question?

    Is that...

  • RE: string concatination

    This code will comma-delimit all locations and take NULLS into account (changing them into zero-length strings). The outer query takes the concatenated string, and trims off the trailing ',...

  • RE: Insert job failed - getting message id 213 severity 16

    If you take the 4 minutes to put the column names in there (insert and select statements), this wouldn't happen. Even if columns changed.

    you might be missing data from new...

  • RE: Slow Stored Procedure Call

    I agree with RBarryYoung, read the article (that's what I am going to do now, in fact). My recommendation came from my specific problem, and although it solved my...

  • RE: Convert Rows to Column --- Can any one help ?

    I would look at the PIVOT/UNPIVOT functions in BOL, also you can use CASE statements to return the data you're wanting in a specific column position.

    MJM

  • RE: Slow Stored Procedure Call

    Wow, there are several of these issues today seemingly! Here's the reply I sent to another person just a little while ago (I'll add a link to that thread...

  • RE: Selecting databases to backup - do not include tempdb

    Scozzard (9/28/2009)


    is there a better way?

    Thanks

    Scott

    Probably, but I can't think of one. Tempdb is not distinguishable from any other of the system databases, at least in the query MS...

  • RE: Charindex?

    Seconded ^^. If a comma is truly your delimiter then yes, it can be done by substringing the CHARINDEX position of the delimiter.

    DECLARE @Names TABLE(

    FullName VARCHAR(255)

    )

    INSERT INTO @Names(FullName) VALUES('Astohn,...

  • RE: Selecting duplicate rows

    Similarly, this would also do what you need, I think:

    SELECT * FROM(

    SELECT

    member_id,

    subscribers,

    date_submitted,

    RANK() OVER (PARTITION BY member_id, subscribers ORDER BY date_submitted DESC)...

  • RE: Procedure is slower than select statement

    AVB (9/28/2009)


    I have a query that is about 40,000 reads less when run as a select statement. If I put that query in a proc it has a huge increase...

  • RE: Custom Maintenance Plans - the T-SQL way

    Ralf Dietrich (6/21/2009)


    Hi Mark,

    why did you prefer custom maintenance plans over custom SQL scripts? (Yes it is a very interesting solution you showed up! - thx!)

    I've seen so many bugs...

  • RE: Custom Maintenance Plans - the T-SQL way

    ***************

    For everyone's convenience, the SQL scripts and documentation is attached to this post.

    ***************

    Please let me know if you have any questions.

    Thank you!

    Mark

Viewing 15 posts - 61 through 75 (of 83 total)