Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Recent content by saikrish

  1. saikrish

    How to do select in such query

    Hi, Try this sql. select account_no from test where element_id > 4618 and element_id < 4627 group by account_no having count(*) > 1 All the best Vijay
  2. saikrish

    Convert function

    Hi nkm, The solution suggested above only returns 'mm-yy' if I am right where as what is desired is 'ddd-yy'. Perhaps the above sql should have been select substring(convert(char(8),getdate(),10),4,8) so that we atleast get date in the 'dd-yy' format. But that still does not seem...
  3. saikrish

    Data transformation

    Hi nkm, Assume that your table is named 'TableA' and its columns are named 'A', 'B' and 'C'. Let the column 'C' contain values such as 'AP', 'NAP', 'N/A' etc. etc. You could make use of the case statement to achieve what you have asked for. The sample sql is furnished below...
  4. saikrish

    output of isql

    Hi Wim Vanherp, I guess the isql command by itself does not provide options to supress the results of the command executed on the database like the '1 row affected' etc. that you are making a mention of. But you could explicitly direct only the output that you desire to a file by having a...
  5. saikrish

    Remove Column From A Table

    Hi, To drop a column from an existing table use 'Alter table <table_name> drop <column_name>' For more information on altering tables in ASE databases check out the following link:-...
  6. saikrish

    single statement for mismatches on outer join

    Hi trids, Try this query. As should be evident from the query below it retrieves the extra records alone from one of the tables using a single 'Select' and does not necessitate the usage of temp tables. SELECT L.match_no FROM #LHS L Left Outer Join #RHS R ON L.match_no =...
  7. saikrish

    delete null records

    Hi, A 'NULL' represents an unknown or inapplicable value. So there is no way that it can be matched using expressions like &quot;&quot; or &quot; &quot;. I don't see anything strange with your second delete statement and the first select statement. The 'from' keyword in the delete...
  8. saikrish

    is this possible ??

    I don't understand what problem dickie had in executing the code supplied earlier. The basic idea was to avoid declaration of more variables. Vijay
  9. saikrish

    is this possible ??

    Hi geff, It is quite possible. Try this. isql -U xyz -P abc -S lkj -D mno << EOF declare @name char(20) select @name = 'geffry' exec(&quot;print 'Text is &quot; + @name + &quot;'&quot;) go EOF Note the space included in the string &quot;print 'Text is &quot; at the end. This is to...
  10. saikrish

    How To Alter Identity Column

    Hi, Ya as nbrk has said earlier, it is possible to insert values into an identity column with the identity setting referred. Probably the 'distinct' clause does not work with an identity column. So you could use a 'group by' on all the columns. For eg:- set identity_insert...
  11. saikrish

    How To Alter Identity Column

    Hi, Well a simple solution should be have another table as the one you have discussed. Insert into this new table the distinct records from the original table and drop the original one. For eg:- Create tableB(key numeric(5,0) identity,name char(25), ssn integer) insert into...
  12. saikrish

    help on cursors

    Hi, Sorry, ignore the above reply and try this code. create procedure check_sp as begin declare @procname varchar(60) declare proc_cursor cursor for select name from sysobjects where type = 'P' and name like 'abc%' open proc_cursor fetch proc_cursor into @procname while (@@sqlstatus = 0)...
  13. saikrish

    help on cursors

    Hi, Try the code below. Create procedure check_sp as begin declare @procname varchar(60) declare proc_cursor cursor for select name from emp open proc_cursor fetch proc_cursor into @procname while (@@sqlstatus = 0) begin exec('drop procedure' + @procname) fetch proc_cursor into...
  14. saikrish

    WHERE EXISTS vs. LEFT OUTER JOIN vs. IN(..) Statement

    Hi DiscoStuart, Hey can you provide the table structure and if possible the sample data on which you ran your query?
  15. saikrish

    Parsing lines of continuous characters by column

    Though this is an 'AWK' forum I thought I shall talk on two other ways of solving the problem posed by Flipster. Approach 1:- The 'cut' command could be used to parse the input file into columns. To separate the first column use 'cut' and store the first column data from the entire file...

Part and Inventory Search

Back
Top