Viewing 15 posts - 361 through 375 (of 2,458 total)
Got it. Note the mild tweak:
DECLARE @sample TABLE (col1 varchar(100), col2 varchar(100), col3 varchar(100), col4 int);
INSERT @sample VALUES
('1234', 'ABC', 'TEXT', '80'),
('1234', 'ABC', 'TEXT2', '20'),
('1234', 'XYZ', 'TEXT',...
November 21, 2016 at 11:37 am
Here's an example of how you could tackle this:
DECLARE @sample TABLE (col1 varchar(100), col2 varchar(100), col3 varchar(100));
INSERT @sample VALUES
('1234 ABC', 'TEXT', '80'),
('1234 ABC', 'TEXT2', '20'),
('1234 XYZ',...
November 21, 2016 at 10:18 am
Another way:
WITH MyCTE(val) AS
(
SELECT '21-12-ABCD' UNION ALL
SELECT '23-1-hdf' UNION ALL
SELECT '19-1345-dsnf'
)
SELECT val,
SUBSTRING(val, 1,...
November 21, 2016 at 9:27 am
Jeff Moden (11/9/2016)
Alan.B (11/9/2016)
Jeff Moden (11/8/2016)
Alan.B (11/8/2016)
You can accomplish this using NGrams2B which can be downloaded from here[/url] at the end of the article.).
I must be tired and I'm...
November 16, 2016 at 9:15 am
Jeff Moden (11/8/2016)
Alan.B (11/8/2016)
You can accomplish this using NGrams2B which can be downloaded from here[/url] at the end of the article.).
I must be tired and I'm not seeing what...
November 9, 2016 at 8:16 pm
pietlinden (11/8/2016)
November 8, 2016 at 7:40 pm
Itzik's SQL Server 2012 Window Function book is the best SQL Books I own. His SQL Server 2012 book may be the second best.
Any article by Jeff Moden, Dwain Camps,...
November 8, 2016 at 4:02 pm
Spammers not gaining ground. Spam reported.
November 8, 2016 at 2:20 pm
You can accomplish this using NGrams2B which can be downloaded from here[/url] at the end of the article.). I don't know how you are bringing in your CSV file data...
November 8, 2016 at 1:25 pm
My experience has been that this is faster and easier using plain ol' T-SQL. Why not just create a script task and use the query that you queries that you...
November 8, 2016 at 11:23 am
Phil's solution is brilliant (this was a tricky problem that I could not solve).
Based on what you said - 4.0 should be 4.1 but if you want 4.0 to...
November 7, 2016 at 11:47 am
If you can't add a new UDF you can just apply the logic to a SQL query like so:
DECLARE
@pString VARCHAR(8000) = '11,15,200',
@pDelimiter CHAR(1)...
November 7, 2016 at 10:58 am
(expanding on what Phil said...)
You need a "splitter" function - the one Phil posted a link to is the best one for the job. This query:
DECLARE @param varchar(1000) = '1,2';
SELECT...
November 7, 2016 at 8:31 am
Viewing 15 posts - 361 through 375 (of 2,458 total)