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...
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...
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...
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:-...
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 =...
Hi,
A 'NULL' represents an unknown or inapplicable value. So there is no way that it can be matched using expressions like "" or " ". I don't see anything strange with your second delete statement and the first select statement. The 'from' keyword in the delete...
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("print 'Text is " + @name + "'")
go
EOF
Note the space included in the string "print 'Text is " at the end. This is to...
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...
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...
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)...
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...
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...
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.