Viewing 15 posts - 31 through 45 (of 1,472 total)
There's always the KISS method depending on what you need this for.
DECLARE @col2 varchar(MAX),
@sql varchar(MAX)
SELECT @sql = ''
select @Col2='|AuthoriaUsers|244375064|17875716|1.14||0000037249||0000037249||||DM4||||||||||||||||||||0000037249|||||||||||||||||||||||en_US|en_US|CAD|T1_US|'
SELECT @Col2 = STUFF(REPLACE(@Col2,'|',''','''),1,2,'')
SELECT @Col2 =...
May 17, 2011 at 2:29 pm
GilaMonster (5/13/2011)
Garadin (5/13/2011)
May 13, 2011 at 2:13 pm
GilaMonster (5/12/2011)
Garadin (5/12/2011)
Errr.....http://sqlinthewild.co.za/index.php/2009/03/19/catch-all-queries/
The original code had the same problem.
Thanks for noting that Gail. I knew you needed to add a RECOMPILE but was incorrect in thinking that WITH RECOMPILE...
May 13, 2011 at 1:06 pm
You've got a few options here.
When you execute dynamic SQL, it runs in a separate context from your SP, so the fact that you declared your variables at the top...
May 12, 2011 at 1:58 pm
ramadesai108 (4/20/2011)
I tried different formats on that site, but it does not work.
Care to elaborate on that at all?
Did your server just say "No."?
April 20, 2011 at 11:05 am
Yeah, my bad on that one, read this too fast and missed the way the exists referred to the derived table. They can be removed from the base level...
April 19, 2011 at 8:47 am
Alternatively, you can use XML and parse that into a temp table.
April 15, 2011 at 2:42 pm
Should be as simple as removing the columns you don't want. Or am I missing something?
It might have seemed more difficult because all kinds of shortcuts are...
April 15, 2011 at 2:35 pm
At least in SQL2000, the remote table gets pulled over the network entirely and the local 2000 system will then discard the non matching rows.
AFAIK, 2005 and 2008 behave the...
April 15, 2011 at 1:50 pm
Replace
SUM(trxquantity) / SUM(trxcount) AS [UPT]
WITH
CASE WHEN SUM(trxcount) > 0 THEN SUM(trxquantity) / SUM(trxcount) ELSE 0 END AS [UPT]
April 12, 2011 at 6:38 am
I think your '-' got replaced with a double minus, probably office autoformatting. Try replacing it in your script.
April 12, 2011 at 6:33 am
How about something like:
SELECT Top 1 OrderNumber
FROM Orders
ORDER BY CASE WHEN UpdateDate IS NULL THEN CreateDate ELSE UpdateDate END DESC
or
SELECT Top 1 OrderNumber
FROM Orders
ORDER BY ISNULL(UpdateDate, CreateDate) DESC
April 7, 2011 at 2:41 pm
deepakagarwalathome (4/1/2011)
P.S.
I don't have any Create table statement - the TempTest table is just coming from an existing table as a subset. The sample data set is here if...
April 2, 2011 at 9:11 am
Check out the link to "String Concatenation" in my signature. It details quite a few different methods of doing this.
April 1, 2011 at 9:05 am
repent_kog_is_near (4/1/2011)
Seth, there are very few times that column will be populated and hence the trigger will be needed.. and hence for performance sake, i was seeking better option...
You didn't...
April 1, 2011 at 8:59 am
Viewing 15 posts - 31 through 45 (of 1,472 total)