Viewing 15 posts - 40,951 through 40,965 (of 59,102 total)
Mitesh Oswal (11/26/2009)
please check this ,DECLARE @srtWord VARCHAR(8000)
SELECT
@srtWord = '1'+SPACE(7998)+'2'
select @srtWord
select @srtWord = REPLACE(REPLACE(REPLACE(CAST(@srtWord AS VARCHAR(MAX)),' ','$#$'),'$$#',''),'$#$',' ')
select @srtWord
Yes,...
--Jeff Moden
Change is inevitable... Change for the better is not.
November 27, 2009 at 10:39 am
It would be a help if you could post the data that caused the problem. Thanks.
--Jeff Moden
Change is inevitable... Change for the better is not.
November 27, 2009 at 9:44 am
Including the test data creation, there are 250 lines of undocumented code there... would you care to explain the rules of what it does?
--Jeff Moden
Change is inevitable... Change for the better is not.
November 26, 2009 at 8:09 pm
This should do it... the double-split on name required an extra step. Doing it in steps like this is actually a bit faster than trying to do it...
--Jeff Moden
Change is inevitable... Change for the better is not.
November 26, 2009 at 7:43 pm
Agreed. Items like multiplication and division have the same precedence and, provided nothing is include to interfer with the order of precedence (such as parenthesis), are solved left to...
--Jeff Moden
Change is inevitable... Change for the better is not.
November 26, 2009 at 1:57 pm
Heh... still pretty embarrassing moment on my part. :blush: Thanks for the gratuity, Nabha.
--Jeff Moden
Change is inevitable... Change for the better is not.
November 26, 2009 at 1:44 pm
Thanks, Gail.
--Jeff Moden
Change is inevitable... Change for the better is not.
November 26, 2009 at 1:42 pm
This should do it...
--===== Code to create the view syntax in a variable
DECLARE @SQL1 VARCHAR(MAX)
SELECT @SQL1 = 'CREATE VIEW dbo.Groups AS' + CHAR(10)
...
--Jeff Moden
Change is inevitable... Change for the better is not.
November 26, 2009 at 1:27 pm
Heh... no problem, Nabha... just didn't want to see a food fight break out. I'm not perfect either. I miss stuff just like on that previous row problem...
--Jeff Moden
Change is inevitable... Change for the better is not.
November 26, 2009 at 12:00 pm
Wow... egg on my face and not enough coffee in the gullet... my apologies...
a.In the first record itself C1 == C2 i.e equal then keep 0 for C3 column...
--Jeff Moden
Change is inevitable... Change for the better is not.
November 26, 2009 at 11:50 am
Heh... now I see it... the OP snuck it into code. Nothing like a little hidden "added scope", huh? 😛
--Jeff Moden
Change is inevitable... Change for the better is not.
November 26, 2009 at 11:48 am
Heh.... Nicely done but, considering the following error and the fact that the code I posted does actually give the correct output, I'm thinking that you just read the code...
--Jeff Moden
Change is inevitable... Change for the better is not.
November 26, 2009 at 11:45 am
Exactly correct... both methods take the same time... until one day.....
--Jeff Moden
Change is inevitable... Change for the better is not.
November 26, 2009 at 11:30 am
Thomas Lampe (11/26/2009)
The table looks like follows:
I assume that's the one you're inserting into... are the datatypes the same as what the query is producing?
I guess I don't know why...
--Jeff Moden
Change is inevitable... Change for the better is not.
November 26, 2009 at 11:25 am
Then take a look at BCP which comes with SQL Server to do what you want. Look for it in Books Online which is the SQL Server Help system.
--Jeff Moden
Change is inevitable... Change for the better is not.
November 26, 2009 at 11:22 am
Viewing 15 posts - 40,951 through 40,965 (of 59,102 total)