Spliting A Recrod Into Two
Feb 14, 2008
HI if I have a recrod in a plain text file , and it has some colums information including FromDate and ThruDates if the date range is over 30 days, Then the record should split and becomes 2 records rather then one.
for example:
if i have FromDate 07/01/06 and ThruDate = 08/25/06
than
that single record should be saved as two records
like
Record#1 FromDate ThruDate
1 07/01/06 07/30/06
2 08/31/06 08/25/06
so what should I do to work it out, in the database, what could be the t sql or trigger that I have to use??? help please.
View 11 Replies
Mar 3, 2007
Hi There,
I'm having a problem retreiving the auto generated Guid after inserting anew record with NEWID(), my stored proc is as follows:SET @uiTransactionID = NEWID()
INSERT INTO Transactions (uiTransactionID) VALUES (@uiTransactionID)
IF @@ERROR = 0 AND @@ROWCOUNT = 1
BEGIN
SELECT @uiTransactionID AS '@@GUID'
RETURN 0
END
And the return on my insert statement is:
command.ExecuteNonQuery();m_uiTransactionID = (Guid)command.Parameters["RETURN_VALUE"].Value;
I can never retreive the newly generated Guid, can onyone spot where i'm going wrong?
Many thanks
Ben
View 2 Replies
View Related
Dec 6, 2000
Hi eveybody
In table1, column1 I am trying to split any string that has a pace in the middle like 'ABC XYZ' to two columns, Column2 to have 'ABC' and Column3 to have 'XYZ'
Any idea will appreciated
Saad
View 1 Replies
View Related
May 29, 2008
I have been using this to split the name column into First name,last name & middle name
Input name column is in this format
First Name,Last Name Middle Name
I have no problem with spliting and running last name & middle name
But i have issues with First Name
I use the code below for first name in derived column
SUBSTRING([COPY OF Name1,FINDSTRING([COPY OF name],",",1) - 1)
I noticed in few places where the name is not in the format mentioned above
Eg : M
And which does not have a comma
SO how do i solve this kind of situations
View 1 Replies
View Related
Apr 3, 2008
Good Morning,
I'm trying to write a scrip to compate two columns in two different tables to each other (billing_payee to Debtor_name)
The problem i have is that the info in the billing_payee column is CLIENT RE DEBTOR INITAL SURN and the infor in Debtor_name column is [i]DEBTOR TITLE NAME SURN[i]
What i need to be able to do is select all from Billing_Payee table where the Billing payee [i]DEBTOR INIAL SURN[i] is not the same as the info in Debtor_name.
I somehow need to split out the inial - first letter of debtor name and surname.
If i can't do it this way i need some other way of comaparing the two.
I am fairly new to t-SQL however have a pretty good grasp of it.
Please let me know if there is anything else i can provide to make this any easier any help is much appreciated!!
View 5 Replies
View Related
Jun 4, 2006
Hi,
I have a project in which I have about 20,000 records in sql database table.
What I would like to do is generate a query that lists all the unique words in a particular field acros the entire table so as to generate a glossary of words.
if we had a table that looked like
ID Description
001 This is the first record
002 This is the second record
003 This is not the first record
and the query was run on the description field, then the result I would like to see is
This
is
the
first
second
not
I hope this makes sense. Any help is appreciated.
View 3 Replies
View Related
Sep 20, 2006
I have a table that contains many columns in a single row and I'd like to split the table so that it has fewer column values and more rows.
My table structure is:
create table #scoresheet
(Decisions varchar(10), DNumericalValue int, DVI varchar(10), DComments nvarchar(255),
Competence varchar(10), CNumericalValue int, CVI varchar(10), CComments nvarchar(255),
Equipment varchar(10), ENumericalValue int, EVI varchar(10), EComments nvarchar(255));
I would like to have three rows with four columns.
What I've done so far is create a stored procedure that uses a table variable:
create procedure sp_splitsinglerow as
declare @Scoresheet_rows_table_var table (
ReviewArea varchar(25),
NumericalValue int,
VI varchar(10),
Comments nvarchar(255));
insert into @Scoresheet_rows_table_var
(ReviewArea, NumericalValue, VI, Comments)
select Decisions, DNumericalValue, DVI, DComments
from #scoresheet
The trouble with this approach is that I have to explicitly name the columns that I insert into the table variable. What I'd really like to be able to is have a loop construct and select the first 4 columns the first time, the second 4 the next time and the last 4 the third time.
Any ideas on how to achieve that?
BTW, I have resolved this issue by suggesting to the Developers that they change the structure of the original table, but I'd still like to know if there is another solution. :)
View 2 Replies
View Related
Jul 20, 2005
GreetingsFor performance reasons I am trying to determine how often the pages inthe index split due to inserts. Are there any records in the 'sys' tables,etc. Thanx
View 2 Replies
View Related
May 18, 2007
For some reason I am having a really hard time grasping IS and I have a task that I would imagine is easy.
I have a flat file source with 6 columns, I would like to import this file into two flat files. One file containing columns 1,2,3,5 and the second containing 2,4,5,6. I created the connection managers for both destination files, but I can€™t determine what transformation tool I need to accomplish this task? Could you help?
View 3 Replies
View Related