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
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...
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...
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...
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...
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...
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...
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...
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.