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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. mukund

    Removing duplicate records

    Hi Sparked, Try the query given below /* Query */ Select key, status from tablename Group By key, status /* Query */ Hope this helps. -Mukund.
  2. mukund

    write table content into a text file

    Create the following Stored Procedure in the master db /* Procedure starts */ Create PROCEDURE sp_QueryToFile ( @db sysname, @query VARCHAR(1000), @file VARCHAR(255) ) AS SET NOCOUNT ON SET @Query = 'SET NOCOUNT ON ' + @Query EXECUTE ('master..xp_cmdshell ''osql -w8000 -r -s" &quot...
  3. mukund

    Dynamic SQL - Help Required

    Hi, I was looking for some help for Dynamic SQL in Oracle 9i. My requirement is, I have a table, where a user's preferences are set. This table contains column_name, column_type & column_value. Now this information is organised in rows. I want to output this information using a REF...
  4. mukund

    Simple Query

    Hi Shultz, I have given the following query based on the Northwind database, you replace the tablename and columns with appropriate names. select Top 10 * from Orders Where OrderID Not In (Select Top 10 OrderID from Orders Order By OrderID) Order By OrderId -Mukund.
  5. mukund

    datetime format

    Hi Beti, use the Convert function. For your requirement use the following style of Convert function Select Convert(varchar(10), datefield, 126) as somedate from TableName Replace the somedate, datefield and TableName with appropriate values. -Mukund.
  6. mukund

    Data report Problem.

    Hi Inder, Sorry missed the alias in previous query, try this one. Select RollNo, Name, (Select count(*) from Students Where RollNo < s.RollNo) as SrNo From Students s Order By RollNo Here I am assuming the name of tables & columns, you can replace the names of students table and...
  7. mukund

    Data report Problem.

    Hi Inder, Try the following query. Select RollNo, Name, (Select count(*) from Students Where RollNo < s.RollNo) as SrNo From Students Order By RollNo Here I am assuming the name of tables & columns, you can replace the names of students table and columns RollNo & Name. Hope this...
  8. mukund

    Trouble with MAX in Stored Procedure

    Hi JeffCarlin, Try the following query, instead SET @stg1 = &quot;UPDATE &quot; + @Parm1 + &quot; &quot; + &quot;SET dteLast = &quot; + &quot;(SELECT Top 1 tblHealth.dteDateEntry &quot; + &quot;FROM tblHealth &quot; + &quot;WHERE tblHealth.strHealthPatSSN=&quot; + @Parm1 + &quot;.strSSN...
  9. mukund

    Last Modified Date for a Stored Procedure

    Hi, The following query would help you. select name, crdate from sysobjects a where type ='p' order by crdate desc -Mukund.
  10. mukund

    String manupulation

    Select Substring(news, (Charindex('exactly', news, 1)) - 20, (Charindex('exactly', news, 1)) + len('exactly') + 20) From TableName
  11. mukund

    Change database within a stored procedure

    Hi Mirrorball, You can do updates without changing the database. The trick is to prefix the table you want to update with the database name. e.g. Update databasename..TableName set ColumnName = ColumnValue where condition -Mukund.
  12. mukund

    If statements in stored procedures

    Hi transparent. See if this solution works. Use this statement at the start of your stored proc SET ANSI_NULLS OFF This will take care that the NULL values are compared properly. At the end of the stored proc you can have the following statement. SET ANSI_NULLS ON Hope this helps...
  13. mukund

    How to Update data in ntext

    Hi, I needto update the data in ntext columns. I need to search for specific set of characters in the ntext data and replace that with another set of characters. Anybody has a solution for this ? -Mukund
  14. mukund

    Migrating database from Informix to SQL Server

    Hi, Anybody has any experience/idea of migration from Informix database to MS SQL Server database. From point of view of tables (design), Views (syntax) & stored procedures. Any pointer/comments/suggestions are welcome. Regards, Mukund.
  15. mukund

    Converting upper case to &quot;Proper Case&quot; in SQL

    Hi MaffewW, In such case you can think of a front end tool that has the proper function like VB, Use that to retrieve, convert the address string to proper case and update the addres string back in the DB. Mukund.
  16. mukund

    Converting two worded string to one word only

    Hi Bwintech, You can first backup the database and then run the following Update query on the students table Update students SET name = ltrim(rtrim(left(name, charindex(' ',name,1)))) Here students is the table & name is the column that needs to be updated. Hope this helps, Mukund.
  17. mukund

    Create Text file from contents of a ntext field.

    Hi Has anybody done this before ? If it is possible please help me with this. Regards, Mukund.
  18. mukund

    Create Text file from contents of a ntext field.

    Hi, I want to create a text file, from the contents of a ntext field. Can this be done ? Any help/suggestions is welcome. Mukund.
  19. mukund

    Date Conversion

    Hi tman24m, Assuming that from AS400 the dates are coming in yyyymmdd format you can convert them in to date format by using Select Convert(datetime, str(20020315)) this will convert your decimal date in 20020315 format to a datetime format. I tried this on SQL 7 & SQL 2000 & this...
  20. mukund

    Pulling Data from Oracle to SQL Server

    Hi Terry, The sql server version is 6.5. So I guess I would have to use bcp utility to do the copying. But to do bcp also, I should have data in flat file, which might be generated from Oracle. Regards, Mukund.

Part and Inventory Search

Back
Top