Viewing 15 posts - 49,696 through 49,710 (of 59,091 total)
Since Oracle 8.3, you also can use Case... 😉
--Jeff Moden
Change is inevitable... Change for the better is not.
June 25, 2008 at 5:08 pm
Good code... but be careful when you get a lot of rows or the groups of rows become large. Take a look at the following article...
http://www.sqlservercentral.com/articles/Advanced+Querying/61716/
--Jeff Moden
Change is inevitable... Change for the better is not.
June 25, 2008 at 3:48 pm
R L Reid (6/25/2008)
--Jeff Moden
Change is inevitable... Change for the better is not.
June 25, 2008 at 3:36 pm
The best thing to do, in most cases, it to avoid any kind of function and any kind of correlated sub-query including Cross Apply. Yeah, I know... I'm going...
--Jeff Moden
Change is inevitable... Change for the better is not.
June 25, 2008 at 3:29 pm
Very good article... you did a heck of a good job on it. 🙂
Just a couple of observations...
You did all of this just because BCP won't export column headers......
--Jeff Moden
Change is inevitable... Change for the better is not.
June 25, 2008 at 3:10 pm
Wow... lots of RBAR there 😀
For starters, you can replace the following WHILE loop...
declare @cnt int
declare @UnitCount int
set @cnt=1
set @UnitCount=1
while @cnt<len(@s_Table_PkgNumber)
begin
if(substring(@s_Table_PkgNumber,@cnt,1)=', ')
begin
set @UnitCount=@UnitCount+1
end
set @cnt=@cnt+1
End
... with this...
SET @UnitCount = LEN(@s_Table_PkgNumber)-LEN(REPLACE(@s_Table_PkgNumber,',',''))+1
That one...
--Jeff Moden
Change is inevitable... Change for the better is not.
June 25, 2008 at 7:31 am
Darned forum... please replace the smiley faces in the code with right parenthesis...
--Jeff Moden
Change is inevitable... Change for the better is not.
June 25, 2008 at 7:12 am
Here's an example of what I'm talking about... go look at the nightmare code behind sp_MsForEachTable and sp_SpaceUsed... both can be replaced with this relatively simple and very fast...
--Jeff Moden
Change is inevitable... Change for the better is not.
June 25, 2008 at 7:11 am
sp_MSforeachtable is nothing more than a cursor/RBAR on steroids...
--Jeff Moden
Change is inevitable... Change for the better is not.
June 25, 2008 at 7:06 am
habib_nub (6/25/2008)
i want to insert multiple data into multiple tables column
You need to include a wee bit more info about what you want to do than that. Otherwise,...
--Jeff Moden
Change is inevitable... Change for the better is not.
June 25, 2008 at 6:51 am
Sorry... you are talking about "Table Variables"... best to look up about those in Books Online and take a look at the following article...
--Jeff Moden
Change is inevitable... Change for the better is not.
June 25, 2008 at 6:47 am
Change the default setting will likely open a huge can of worms for you... lot's of other folks code depends on NULLs not being equal to anything and changing that...
--Jeff Moden
Change is inevitable... Change for the better is not.
June 25, 2008 at 6:45 am
That's what happens when you "send" it to just one person, Venki... why don't you post the procedure here so we can all lend a hand... 😉
--Jeff Moden
Change is inevitable... Change for the better is not.
June 25, 2008 at 6:40 am
Studying the code for sp_help and sp_SpaceUsed will give you a wealth of knowledge about system "tables"... the code sucks (especially for sp_SpaceUsed) but where they get some of the...
--Jeff Moden
Change is inevitable... Change for the better is not.
June 25, 2008 at 6:28 am
Umm... I don't email reports or even let folks know when something has been updated... because it's always updated (with a few exceptions of course).
Favorite "trick" is to write an...
--Jeff Moden
Change is inevitable... Change for the better is not.
June 25, 2008 at 6:24 am
Viewing 15 posts - 49,696 through 49,710 (of 59,091 total)