Viewing 15 posts - 406 through 420 (of 5,504 total)
Here's what I came up with using the DelimitedSplit function refernced in my signature:
declare @val varchar(8000)
set @val= '[{mark,peters,mr}{jane,fonda,mrs}{john,doo,mr}{james,bond,mr}]';
WITH cte AS
-- separate the input values into "rows" and eliminate the...
October 7, 2013 at 1:55 pm
Here's a slightly different approach without the OPENXML approach (I, personally, find OPENXML more complicted and it seems to be less efficient in most cases):
SELECT
TempXML1.Node1.value('(server/text())[1]', 'varchar(50)') AS [server],
TempXML1.Node1.value('(name/text())[1]',...
October 7, 2013 at 12:09 pm
It might be an issue between Unicode an Non-Unicode data format.
Did you try to change the data type in your target table to NVARCHAR(50)?
(Just a pot shot though...)
October 6, 2013 at 3:23 pm
You might want to have a look at this link
It'll show you an alternative how to shred the data. The code should be reduced to the information required to avoid...
October 6, 2013 at 2:44 pm
A bar graph is a graphical way to display data.
A RDBMS (like SQL Server) is designed to efficiently store, manipulate and return data.
For graphical presentation you could use Reporting Services,...
October 6, 2013 at 2:17 pm
Do you have sample data showing the "intermediate values" "step by step"?
I'm having a hard time to understand differences between adjecent values (adjecent in time), especially, since there are duplicate...
October 6, 2013 at 2:00 pm
[SET SARCASM ON]
Wow, that's really a lot information to work with...
The easies way: change the .dat extension to .html. Not that it would do any good, but at least it...
October 6, 2013 at 1:50 pm
The reason for getting just one row ist the CROSS APPLY: there are only data of UnitId2005 in the UnitsData table, eliminating the remaining rows.
I broke my approach down into...
October 6, 2013 at 1:18 pm
There are several options:
(a) formatting the single quotes to be used in dynamic SQL using the REPLACE function:
DECLARE @param VARCHAR(50)
DECLARE @param2 NVARCHAR(50)
SET @param ='Will o''smith,Roa''s'
SELECT @param
SELECT @param2 = 'SELECT '''...
October 6, 2013 at 12:32 pm
Sounds like homework...
Would you please show us what you've tried so far and where you get stuck?
To refer to the most recent row, you could either use an outer join...
October 6, 2013 at 12:00 pm
If you want to restart with 1 for each new combination of VndNbr, InvNbr then you should change it to
PARTITION BY VndNbr, InvNbr ORDER BY batNbr DESC
June 11, 2013 at 11:14 pm
Talking about optimizing the query itself:
You might want to replace the "nested view approach" with the "early filter concept":
Instead of creating a view querying tables that might not even be...
June 11, 2013 at 1:46 pm
my guess would be the WHILE loop *cough* being the reason for locking.
Depending on the value of @recipientcount it might take a while to perform all those single row inserts.
Step...
June 11, 2013 at 10:58 am
I'm leaving the design discussion out for a moment...
You might want to use a LEFT OUTER JOIN together with a CASE statement. (column based result set, meaning results for lkup_Record_Regions_Serv...
June 11, 2013 at 10:06 am
I tried your code (with replaced table name) and it still return the same data as before (2 rows).
June 11, 2013 at 9:51 am
Viewing 15 posts - 406 through 420 (of 5,504 total)