Viewing 15 posts - 76 through 90 (of 209 total)
I don't know about SSIS, but certainly you can read the file using OPENROWSET BULK
SELECT col1, col2 FROM OPENROWSET (BULK 'C:\sample.txt', FORMATFILE = 'C:\sample.fmt') AS Z
sample.fmt
7.0
3
1SQLCHAR00"\"" ...
September 3, 2010 at 4:16 pm
Paul White NZ (9/2/2010)
steve-893342 (9/2/2010)
Yes precisely, the number of rows returned from the split is defined as (number of commas) + 1
Ok, let's go with that. Thanks for persisting...
September 2, 2010 at 11:41 am
Paul White NZ (9/2/2010)
steve-893342 (9/2/2010)
Returns 14 rows when it should return 15Are you expecting the "A,B,C,D," to produce 5 records?
Yes precisely, the number of rows returned from the split is...
September 2, 2010 at 8:28 am
Paul White NZ (9/2/2010)
steve-893342 (9/2/2010)
Just one minor problem that it doesn't return the last item if it's blank.
Not sure I agree - a single trailing delimiter shouldn't return an extra...
September 2, 2010 at 7:04 am
Paul White NZ (9/2/2010)
Steve,I found a few spare minutes to slightly modify Adam's routine to work the way you want:
Great stuff Paul:-)
Just one minor problem that it doesn't return the...
September 2, 2010 at 4:53 am
Paul White NZ (9/1/2010)
steve-893342 (9/1/2010)
Great function Paul:-) Is there a way of adapting it to include a row number and return values for the blank items as well?
Well the...
September 2, 2010 at 2:04 am
I think it just needs 3 quotes either side of @db_name
select @SQLString ='select ''' + @db_name + ''' as databse,type_desc,create_date,modify_date from [' + @db_name + '].sys.procedures
where create_date > @create_date
order by...
September 2, 2010 at 12:26 am
Paul White NZ (9/1/2010)
CREATE ASSEMBLY Utility
...
September 1, 2010 at 12:57 pm
Does this help you?
SELECT BulkColumn FROM OPENROWSET (BULK 'C:\test.txt', SINGLE_CLOB) AS Z
September 1, 2010 at 8:54 am
You can use CROSS APPLY if you need to retrieve EditedDate in your results set
IF NOT OBJECT_ID('tempdb.dbo.#Files', 'U') IS NULL DROP TABLE #Files
IF NOT OBJECT_ID('tempdb.dbo.#FileContent', 'U') IS NULL DROP TABLE...
August 30, 2010 at 5:21 am
Can't you just add up the columns then?
SELECT
Product,
col1,
col1 + col2,
col1 + col2 + col3,
col1 + col2 + col3 + col4
FROM YourTransformedTable
August 29, 2010 at 10:35 am
Try
SET QUOTED_IDENTIFIER OFF
August 27, 2010 at 4:22 pm
A variation which performs the split on the fly
WITH cte1 AS
(
SELECT '1,2,3,5,6,8,10,50' AS InputString
)
,
cte2 AS
(
SELECT CONVERT(INT, Value) AS Value FROM cte1
CROSS APPLY
(
...
August 26, 2010 at 1:22 pm
Lowell (8/26/2010)
ROWTERMINATOR =
vbCrLf = CHAR(13) + CHAR(10) = \n
vbCr = CHAR(13) = \r
vbLf...
August 26, 2010 at 11:36 am
You will need to put square brackets around your index and table names
August 26, 2010 at 10:48 am
Viewing 15 posts - 76 through 90 (of 209 total)