Viewing 15 posts - 181 through 195 (of 284 total)
Just for grins, I compared two methods.
Method 1: No (explicit) looping.
Set @Result = Replace( RTrim( Replace( Replace( Convert( varchar, @original ), '.', '' ), '0', '...
October 1, 2007 at 5:43 pm
I think you guys scared off the OP.
The comment was already made that it appears you are using integer values for datetime values and that this is generally a Bad...
October 1, 2007 at 3:06 pm
Jeff Moden (9/29/2007)
Did someone say "loop"??? :blink: On a single row????? :sick:
Don't let (y)our antipathy toward row looping turn you away from all looping. Many times it is appropriate, especially...
October 1, 2007 at 11:04 am
The problem with using the Replace string function is that 10.341 ends up as 1034100 if the numeric is defined with five places. If you want 10.342 to end up...
September 28, 2007 at 12:19 pm
You have supplied us a tremendous lack of detail to supply a definitive answer, but thanks to your somewhat convoluted naming convention, I can make a guess. There are five...
September 28, 2007 at 11:06 am
Of course, if you supplied more details of the structure of the tables involved, we could supply more detailed answers. 🙂
September 27, 2007 at 10:16 am
Maybe I just don't understand but I don't see what the problem is. Say you have an entity you have normalized across three tables, Main, Norm1 and Norm2. So your...
September 26, 2007 at 10:34 am
I think this does what you want.select
DateAdd( dd, 1 - DatePart(dw, WeekDate), WeekDate ) as StartDate,
DateAdd( dd, 7 - DatePart(dw, WeekDate), WeekDate...
September 25, 2007 at 4:36 pm
It just occurred to me that you may want more than one row. In that case, select into a temp table or table variable.
declare @Sysfiles ...
September 17, 2007 at 4:04 pm
Here's mine:
-- Returns all tables that use a particular column. The specified column name -- may contain valid SQL wildcards. -- Examples: -- exec GetTablesByCol 'id'; -- exec GetTablesByCol '%id'; create procedure GetTablesByCol...
September 17, 2007 at 10:58 am
Keep it simple:
declare @Filename nvarchar( 260 ), @Name ...
September 17, 2007 at 10:18 am
Repeat the calculation in the WHERE clause. Yeah, it looks ugly. However, if looks are important to you (and I have to admit, sometimes I get more than a little...
September 7, 2007 at 1:22 pm
I assume that the student id number is ubiquitous in your environment. Each student quickly learns his own and the teacher's class roster has them listed. Whenever any of them...
September 6, 2007 at 2:44 pm
What is it about the 134 extra rows that make them wrong? That would help to see what is wrong with Peter's solution.
Or that nothing is wrong with it.
August 30, 2007 at 1:07 pm
As much as this may be sacrilege around here, there are other tools available besides SQL. Going back to the first post, it looks like there are two items on...
August 24, 2007 at 9:48 am
Viewing 15 posts - 181 through 195 (of 284 total)