Viewing 15 posts - 1 through 15 (of 18 total)
there might be some glitches. please test thoroughly.
CREATE PROCEDURE splitColsAsSP
AS
BEGIN
SET NOCOUNT ON;
DECLARE @col1 nvarchar(50),
@col2 nvarchar(50),
@col3 nvarchar(500),
@tcol nvarchar(50),
@tcolname nvarchar(50),
@sqlstr nvarchar(500),
@tsqlstr nvarchar(250),
@which int,
@lpos int,
@rpos int,
@firstrow int
declare yourCursor CURSOR...
December 18, 2008 at 11:32 am
you definetely need a stored proc.
December 18, 2008 at 10:35 am
Maria,
If your table has a lot of records , you should write a stored proc and use a cursor. if not here is your function.
this is how you...
December 18, 2008 at 9:30 am
I know this is SS forum but here is one way of doing it on the client.
if (!IsPostBack)
{
...
December 17, 2008 at 1:51 pm
Personally, I would return all columns as one comma separated string
(select col1+','+ col2 + ',' + col3 from yourtable)
and parse it in the client.
Returning a dataset from...
December 17, 2008 at 1:07 pm
How are you going to use the result set?
December 17, 2008 at 12:40 pm
are there same number of commas in col3 for every row and how is your output going to be used?
December 17, 2008 at 10:14 am
Well done Jeff. Thanks.
December 12, 2008 at 7:13 am
I loved the Matt's solution too and learned how to use patindex. But I dont agree about your reasoning. patindex itself is a function and I can not imagine they...
December 11, 2008 at 7:06 am
very nice
December 10, 2008 at 2:10 pm
here is a user function then
create FUNCTION RTRIMNONNUMERICS
(
@inStr nvarchar(200)
)
RETURNS nvarchar(200)
AS
BEGIN
DECLARE @len int;
DECLARE @pos int;
DECLARE @asc int;
set @pos = 1;
set @len = len(@inStr);
WHILE (@pos <= @len)
BEGIN
set @asc = ascii(substring(@inStr,@pos,1));
IF (@asc <...
December 10, 2008 at 1:52 pm
if it is always (K).
you can simply
select left(col1,charindex('k',col1))
December 10, 2008 at 1:09 pm
open the file with excel. make any change and save. Excel will add quotes as necessary. At least all rows will be consistent.
December 10, 2008 at 8:53 am
I am not sure I understand correctly but I think having a subquery, to retrieve those records with the criteria first then apply your group by to find the duplicates,...
December 9, 2008 at 1:49 pm
Viewing 15 posts - 1 through 15 (of 18 total)