Viewing 15 posts - 23,671 through 23,685 (of 26,490 total)
Just an observation, but you really should evaluate if the Primary Key (Reservation ID) is actually the best choice for your clustered index on the table. You should review...
November 19, 2008 at 8:36 am
shailesh (11/19/2008)
Where dbo.ufn_GetDateOnly(EndDt) <= '01/01/2009'
And doing this can result in your query not taking advantage of indexing on a table. If your tables are small, you may not...
November 19, 2008 at 7:09 am
The code samples I provided will actually go either way. They go backward with positive values, and forward with negative values. A little counter-intuitive, but that was because...
November 19, 2008 at 7:04 am
I don't think the comments here are meant to be elitist, just frustration. There have been threads on some forums where more information has been requested, the OP has...
November 19, 2008 at 7:00 am
Nandy (11/18/2008)
I have used the cursor in the stored procedure to delete the data from the table. I'm deleting the data from table where I used the same table...
November 18, 2008 at 11:52 pm
Once you "recover" the database doing a restore with recovery you can no longer apply differential or transaction log backups to the database. You have to redo the restore...
November 18, 2008 at 11:45 pm
With mput, I think you would have to cd down a level first.
November 18, 2008 at 2:37 pm
SELECT LAST_DAY(NOW() - INTERVAL 1 MONTH)
SQL Server Equivalent: select dateadd(mm, datediff(mm, 0, @TestDate), -1)
November 18, 2008 at 12:36 pm
I have to agree as well. Most of us do want to help others who are having difficulties. Look at how many of the regular contributors now have...
November 18, 2008 at 11:56 am
riga1966 (11/18/2008)
Thank you Lynn.So
right('0' + ltrim(rtrim(@str)), 2)
only adds leading 0 in case LEN is less than 2?
I'm just trying to understand the mechanism...
Actually, it is always adding a leading...
November 18, 2008 at 11:35 am
Here is some test code for you to check out:
declare @TestDate datetime,
@Interval smallint;
set @Interval = 0;
set @TestDate = getdate();
select dateadd(mm, datediff(mm, 0,...
November 18, 2008 at 11:23 am
Quick question, how is the second value used? Does it always go backwards or can it go forward.
Example:
declare @TestDate datetime;
set @TestDate = getdate(); -- 2008-11-18 11:15:35.333
select SOM(@TestDate, 0); --...
November 18, 2008 at 11:15 am
riga1966 (11/18/2008)
The field is CHAR(2)Users enter "1", "01","4","04"
I want to display it always as "01","02","03" format.
What is the best way to do it?
declare @str char(2);
set @str = '1';
select right('0' +...
November 18, 2008 at 11:01 am
Also, besides providing the sample data, be sure to provide the expected results when the query is run. We need something to check against.
November 18, 2008 at 10:57 am
I have tried to help with particular problem as well. It is a form of running-total problem and prehaps what would help is more than just a couple of...
November 18, 2008 at 10:54 am
Viewing 15 posts - 23,671 through 23,685 (of 26,490 total)