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 kutty007

  1. kutty007

    I have a table which has about 20 c

    IonelBurtan, Two different tables in two different databases can have same id. It holds good for Columns and constrainst as well. So, it is best to have an additional column to store the DBID also when you insert the other data. That will make life a lot easier. Regards Karthik
  2. kutty007

    User Defined Functions in SQL 7

    This should work DECLARE @FNAME CHAR(20), @LNAME CHAR(20) SELECT @FNAME = '', @LNAME = 'KARTHIK' SELECT CASE IsNull(@FNAME,'') WHEN '' THEN '' ELSE RTrim(@FNAME) + ', ' END + RTrim(@LName) SELECT @FNAME = 'SUNDAR ', @LNAME = 'KARTHIK' SELECT CASE IsNull(@FNAME,'') WHEN '' THEN '' ELSE...
  3. kutty007

    Problem with multiple select statements in a stored procedure

    Yes UNION ALL should work fine ========================================== select ul.log_id, ul.user_id, ul.patient_id, ul.log_type_id, ul.log_type_id, ul.comment, ul.log_time_stamp, p.FirstName as PatientName, p.LastName as PatientLastName, u.firstname as userFirstname, u.lastname as...
  4. kutty007

    Trigger with Cursor - performance issue

    I'm sorry David. When a col name has to be specified for each col when you insert a computed value into a temp table. It escaped my attention as I didnt have your tables in my database and could not fully test it. However I corrected it. Regards Karthik ----------------------- DECLARE...
  5. kutty007

    Trigger with Cursor - performance issue

    Hi! I have an alternative for the cursor part Good Luck Karthik --------------------------------------------------------- CREATE TRIGGER [weight_update] ON [scheme].[opdetm] FOR INSERT, UPDATE AS IF (UPDATE(weight)) DECLARE @order_no char (10) DECLARE @carrier char (10) DECLARE...
  6. kutty007

    SQL Select Null values

    Sorry. I was not correct. The correct syntax is IS NULL i.e. SELECT * FROM tblProduct WHERE Status IS NULL
  7. kutty007

    SQL Select Null values

    Its easy. Select * from orders where status = NULL
  8. kutty007

    Deadlock problem

    Dead lock, as you may be knowing happens when a process is trying to access an object locked by another process. One way to avoid this by using uncommited read when ever snap Shot data is sufficient. For ex. you can say SELECT * FROM tblProduct WITH (NOLOCK) WHERE .... This will fetch data...
  9. kutty007

    Hello Everyone, I've got a SQL S

    Hi! THis will work, if you want to retain the first record of each unique visitor and delete all subsequent ones. Check out Regards Karthik --==Query if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[VISITOR]') and OBJECTPROPERTY(id, N'IsUserTable') = 1) drop table...
  10. kutty007

    Mergeing Records based on priority in a single query

    I am not sure if I have understood your requirement correctly. Yet, this is what I have comeup with. Hope you find it useful Regards Karthik if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[USR]') and OBJECTPROPERTY(id, N'IsUserTable') = 1) drop table [dbo].[USR] GO...

Part and Inventory Search

Back
Top