Forum Replies Created

Viewing 15 posts - 511 through 525 (of 1,217 total)

  • RE: Getting second last records

    You didn't post the DDL, so you'll probably have to modify the column names - but the idea should be obvious. Generally, you want to find the highest CallID that...

  • RE: Progressive Search / SELECT

    Look up OPTION (FAST n) under "OPTION clause" in BOL. I'm not sure how it works and whether it allows to display the first n rows immediately, because I never...

  • RE: Not using index

    Clustered index is decidedly better on such column (but there can be only one clustered index and several candidate columns for it)... but I don't think a range should cause...

  • RE: SQL syntax

    No, there was no problem - the question was understood and answered.

    If you want to get data for a certain month, the best way (performance wise) is to find date_start...

  • RE: Splitting a string with carriage returns

    You can enter line breaks into the data in your column like this:

    declare @message varchar(1000)

    set @message = 'This is the first line'+char(13)+'This is the second line'

    select @message

    This is the...

  • RE: HELP WITH GROUP BY CLAUSE-URGENT

    Hi,

    if you want to GROUP BY some part of the date, the same part of date has to be displayed in the select list. You can't group by year, and then select...

  • RE: Generating Stored Procedure

    Hello Deepa,

    you have posted a very similar question recently

    http://www.sqlservercentral.com/forums/shwmessage.aspx?forumid=8&messageid=321867

    and it was answered to your satisfaction. Could you please point out the differences, or with what you have problems...

  • RE: old non-Y2K software, need ''''update year'''' in date field

    You didn't post the datatype of DATE column, but since you are using function YEAR(), I suppose it is datetime. Target of an update must be a pure column name;...

  • RE: Between use for dates.

    Actually, I'm using

    DATEADD(d, DATEDIFF(d, 0, GETDATE()), 0)

    but both ways result is the same - it is like 5+3 or 3+5. Tested.

  • RE: Super manager

    Hello,

    I'm not very skilled in use of hierarchy, so most probably there are better ways to do it, but here is one possible solution. It uses UDF - and I...

  • RE: Between use for dates.

    Wrack,

    originally, before I found out how to work with DATETIME values in SQL Server to gain best performance, I was using UDF to strip off time portion, too. It is not...

  • RE: Between use for dates.

    What do you mean by "only date"? If what you mean is "date without time portion" then you have to be careful - as Remi (Ninja) wrote in previous post....

  • RE: Querying table2 with results from table1 and displaying data from both tables

    Hello,

    I think you should not use dynamic SQL for this... but let's leave that for now and look at the way how to get the result.

    It is a lot easier...

  • RE: Join question

    Yes, the semicolons are pretty confusing... I'm not using OPENROWSET myself, except when I need to get data from some external source (Excel, Access), I just remembered that it works...

  • RE: Join question

    Well, for example by using OPENROWSET - although I'm not sure this is what John meant. I'm using linked servers, so I don't know whether there are some other possibilities or...

Viewing 15 posts - 511 through 525 (of 1,217 total)