Viewing 15 posts - 32,356 through 32,370 (of 59,099 total)
Satnam Singh (10/8/2011)
Select wooBillingAmount_Cp,worIsBillable,bcoUserValue1,bcoID,sctFullName_Cp,cstAddress1,cstAddress2,cstCity,convert(varchar(4000), worCstComment) as worCstComment,rptCstCountryShortDesc,rptCstCountryId,cstCompanyName,cstNum,rptCstStateShortDesc,rptCstStateId,cstPostCode,convert(datetime,convert(nvarchar, worFoundWhen, 107)) as worFoundWhen,worDiscussed,worEstTimeForRepairQty,dateadd(mi, -(IsNull((select tzlBiasInMinutes from vewShatimezoneLookup where...
--Jeff Moden
Change is inevitable... Change for the better is not.
October 8, 2011 at 1:58 pm
The following article will tell you how to do it...
http://www.sqlservercentral.com/articles/Crosstab/65048/
If you want a coded reply, the following article will tell you how to get one...
http://www.sqlservercentral.com/articles/Best+Practices/61537/
--Jeff Moden
Change is inevitable... Change for the better is not.
October 8, 2011 at 1:56 pm
ramadesai108 (10/7/2011)
Have a need where I pass in the start month and end month as an ints to a stored proc. The data has hard...
--Jeff Moden
Change is inevitable... Change for the better is not.
October 8, 2011 at 1:51 pm
dmoutray (10/5/2011)
--Jeff Moden
Change is inevitable... Change for the better is not.
October 8, 2011 at 1:34 pm
seftest_09 (10/7/2011)
Thanks, this is what I needed.
I'm not so sure that's true. Depending on what the stored procedure actually does, it may be VERY beneficial to performance and resource...
--Jeff Moden
Change is inevitable... Change for the better is not.
October 8, 2011 at 10:42 am
SQL Guy 1 (10/7/2011)
Perhaps all of you from time to time encountered a problem, when a recruting agent asks you about your current salary, but you don't want...
--Jeff Moden
Change is inevitable... Change for the better is not.
October 8, 2011 at 10:39 am
ghanshyam.kundu (10/7/2011)
thanks carolyn, its really a nice solution i use to do it via UDF.i think in term of performance also this one is better.
thanks
ghanshyam
But, it's not. Please...
--Jeff Moden
Change is inevitable... Change for the better is not.
October 8, 2011 at 10:30 am
Jason-299789 (10/7/2011)
The only difference is that instead of using a comma seperated list you use a # delimiter.
One minor tweak could...
--Jeff Moden
Change is inevitable... Change for the better is not.
October 8, 2011 at 10:28 am
Carolyn Richardson (10/7/2011)
Try:DECLARE @xml xml, @v-2 nvarchar(max)
SELECT @v-2 = N'A # B # C'
SET @xml = N'<root><r>' + replace(@v,'#','</r><r>') + '</r></root>'
SELECT
replace(a.value('.','varchar(2)'),' ','') AS [RowName]
FROM @xml.nodes('//root/r') AS a(a)
Hi...
--Jeff Moden
Change is inevitable... Change for the better is not.
October 8, 2011 at 10:26 am
Iulian -207023 (10/7/2011)
I think I will try both methods
the xml method to parse the file into lines and push to a table
then...
--Jeff Moden
Change is inevitable... Change for the better is not.
October 8, 2011 at 10:24 am
yubo1 (10/8/2011)
create table test(
string varchar(max)
)
insert into test
select 'A#B#C'
select SUBSTRING(string+'#',number,charindex('#',string+'#',number)-number) from
test,
(select number from master..spt_values where number>=1 and type='P')t
where SUBSTRING('#'+string,number,1)='#'
Yubo1,
That method is the "old" method of splitting that uses concatenated delimiters. ...
--Jeff Moden
Change is inevitable... Change for the better is not.
October 8, 2011 at 10:23 am
Lynn Pettis (10/7/2011)
...(using a ref cursor in Oracle).
GAH!!! MY EYES! MY EYES!!! NO MORE, PLEASE!!!
😛
--Jeff Moden
Change is inevitable... Change for the better is not.
October 7, 2011 at 7:06 pm
Sean Lange (10/7/2011)
Man it is hard to believe there still 3rd party things that are that short sighted. Sad actually.
It's not a fault... it's a feature! 😀 Keeps people...
--Jeff Moden
Change is inevitable... Change for the better is not.
October 7, 2011 at 7:04 pm
I don't believe that anyone has written about the performance penalty of using VARCHAR(MAX) and I haven't made a specific test for it. My statement comes from when I...
--Jeff Moden
Change is inevitable... Change for the better is not.
October 7, 2011 at 6:54 am
WaitingWonder2 (10/3/2011)
IF OBJECT_ID('tBufOMIM') IS NULL
BEGIN
CREATE TABLE tBufOMIM (
NOINT NOT NULL PRIMARY KEY,
TIVARCHAR(MAX)NULL,
TXVARCHAR(MAX)NULL,
SAVARCHAR(MAX)NULL,
CSVARCHAR(MAX)NULL,
CNVARCHAR(MAX)NULL,
RFVARCHAR(MAX)NULL,
CDVARCHAR(MAX)NULL,
EDVARCHAR(MAX)NULL,
MNVARCHAR(MAX)NULL,
AVVARCHAR(MAX)NULL
)
PRINT 'Table tBufOMIM was created'
END
GO
Format file:
<BCPFORMAT xmlns="http://schemas.microsoft.com/sqlserver/2004/bulkload/format" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<RECORD>
<FIELD ID="1" xsi:type="CharTerm" TERMINATOR="*RECORD**FIELD* NO"/>
...
--Jeff Moden
Change is inevitable... Change for the better is not.
October 7, 2011 at 6:48 am
Viewing 15 posts - 32,356 through 32,370 (of 59,099 total)