Viewing 15 posts - 8,746 through 8,760 (of 10,144 total)
Michael, you might want to check your code, too...
DROP TABLE #Dates
CREATE TABLE #Dates (aDate DATETIME)
INSERT INTO #Dates
SELECT TOP 100 DATEADD(dd,DATEDIFF(dd, 0, getdate()),50-number)
FROM Numbers
SELECT aDate, SergiyStart, SergiyEnd, CJMStart,...
March 3, 2009 at 10:20 am
karthikeyan (3/3/2009)
His method is working fine. I have tested it.Actually my requiremrnt is little bit different what he has given.
Can you demonstrate please, Karthik? I'd be very keen to...
March 3, 2009 at 8:19 am
karthikeyan (3/3/2009)
Thanks for all your inputs!:)
I found the TSQL 101 solution.
Declare @InputDate Datetime
select @InputDate = '02/mar/2009'
select case when upper(datename(dw,@InputDate)) = 'MONDAY' then dateadd(dd,-7,@InputDate)
...
March 3, 2009 at 5:07 am
When writing an UPDATE ... FROM ..., it pays to write it as a SELECT first, to see what rows are going to be affected and what the new values...
March 3, 2009 at 3:59 am
Jeff Moden (3/2/2009)
March 2, 2009 at 9:34 am
Here's the same code with the outer loop removed and the update statements
replaced by PRINT statements, to try to identify what this thing does.
I made the assumption that...
March 2, 2009 at 9:32 am
Here's a quick sample using Jeffs' suggestion of PARSENAME:
DROP TABLE #Sample
CREATE TABLE #Sample (id INT, PersonName VARCHAR(100))
INSERT INTO #Sample (id, PersonName)
SELECT 1,'Doe, John H.' UNION ALL
SELECT 2,'Pardeshi, Mangal' UNION ALL
SELECT...
March 2, 2009 at 4:37 am
Jeff Moden (2/27/2009)
Also, just a friendly tip... you don't...
March 2, 2009 at 2:27 am
Check triggers on company_ext_attributes
February 27, 2009 at 8:00 am
Jeff Moden (2/27/2009)
February 27, 2009 at 6:48 am
saravanantvr1984 (2/27/2009)
My hearty thanks to Chris Morris
That's nice - you're welcome!
I have to agree with Jeff however, this type of processing is almost always better done by the application/presentation...
February 27, 2009 at 6:42 am
Hi Crazyman
If you look at the result from the sample query
SELECT a.[Date], a.Userid, a.[Name] , '#', b.UseridRef, b.Userid
FROM #Temp a (nolock)
LEFT JOIN #TempCross b(nolock)
ON 'S000'+ CAST(b.UseridRef AS...
February 27, 2009 at 6:36 am
Have some coffee - the expressions are the wrong way round in the function 🙂
declare @searchterm nvarchar(200)
SET @searchterm = 'blood and sweat'
SELECT charindex(@SearchTerm,'and'), charindex('and', @SearchTerm)
February 27, 2009 at 4:55 am
GilaMonster (2/26/2009)
Jeff Moden (2/26/2009)
All database names, table names, procedure names, column names, column aliases, variable names (basically, my stuff) etc, in MixedCase with no underscores....
February 27, 2009 at 2:20 am
Viewing 15 posts - 8,746 through 8,760 (of 10,144 total)