Hello All,
I have a following table:
Name New Version
P001 New P001 V1
P001 V1 P001 V2
P001 V2 P001 V3
P001 V3 P001 V4
P001 V4
B001 New
If the new name is added to the table then I should be able to add the new Name (B001 New)
If the new version to the name is added then update the...
Paul,
No, it does not work either way. It goes in the loop I guess.
I tried to put the select statements after FETCH
DECLARE NewCur CURSOR FOR
SELECT Code, Name, Category
FROM #AddNew
OPEN NewCur
FETCH NewCur INTO @Code, @Name, @Category
select 'Test1'
select @Code...
SQLSister,
I did not make PK field as identity because at my work place they do not prefer PK being an Identity column.
Secondly, this is going to be a scheduled batch job. The user will never add rows to this table except updating the rows.
techiPA
Hello All,
I have to insert the rows from the #table to the user table. I have written a cursor to implement this process.
The #table has two rows which shoule be inserted in the user table. While inserting records, I have to insert the PK column as well. So I get the max(col) from the table...
Thank you George, Paul and Alex. Friday was holiday so got delayed on reply.
Paul, I implemented your suggestioned SQL and it ran like charm. The query returned the expected results.
Thanks again SQL GURUs,
-techiPA
Thanks Paul and Alex,
I will have to pull the data from Access to SQL and then parse it.
Paul, I used your sample and added one more OR condition for ' ' but I got error? How would I check for ' ' and '-' at a time?
Thanks Paul,
The SQL server does not like sql finctions like substring, charindex etc.. because I am trying to get the data from MS Access server which I linked to sql server and am using openquery.
For example:
Select * from OpenQuery(DB2000, 'Select SUBSTRING([Col1],1,5) from table1')
This...
Hello All,
There is a column in sql table which contains the data like:
RA-100 R1
RA-200.02.01 ORIGINAL
RA-200.02 R1
GSOP 2709 ORIG
GSOP 2703A ORIGINAL
SOP 112 R 13
SOP 117A R1
There is some uniformity in the data but not a lot. I need to parse the data in three columns as:
(First column -...
Crowley and Alen, I appreciate your reply.
I do not understand the need of having unique index on ID and Step. I definately need unique index on Step and Role.
-techiPA
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.