Viewing 15 posts - 1,411 through 1,425 (of 1,489 total)
On considering this again, it may be safer to use the UPDLOCK hint. eg:
UPDATE A1
SET
Tagged = 1,
WorkStart = GETDATE(),
UserCode = @UserCode,
@UseIt1 = A1.AcctNo
FROM _FinalFlat (UPDLOCK) A1
INNER JOIN
(
SELECT TOP 1 A.AcctNo
FROM...
October 16, 2006 at 11:44 am
You are probably using the default isolation level of Read Committed. Try either setting the isolation level to Repeatable Read or using the RepeatableRead locking hint on the table to...
October 16, 2006 at 9:28 am
Still do not really have enough information, but something like this should get you started:
UPDATE R
-- This will set all the users RoleID to 7
SET RoleID = 7
-- If there...
October 13, 2006 at 2:36 pm
It is not clear what you are trying to achieve.
You will need to post:
1. the DDL (CREATE TABLE statements) for the LOCATION, USERS a USERROLES tables.
2. some sample data for...
October 13, 2006 at 11:52 am
You could try returning:- SUM(CAST(dom-amount * 100 AS INT)) AS dom-amount
from the remote query and then dividing by 100.0
October 13, 2006 at 9:13 am
You need to be careful with the second example as it is not portable to other db systems. (eg Oracle.)
October 13, 2006 at 8:22 am
You need to use the 3 part naming convention: - <database>.<owner>.<table>
Something like the following should work:
-- ANSI SQL
UPDATE db1.dbo.People
SET [password] =
(SELECT P2.[password]
FROM db2.dbo.People P2
WHERE P2.people_id = db1.dbo.People.people_id)
WHERE EXISTS
(SELECT *
FROM db2.dbo.People...
October 13, 2006 at 6:33 am
The ISO date format is probably best for this; so something like:
DECLARE @DiskStr NVARCHAR(255)
SET @DiskStr = N'C:\CollSoftware2_' + CONVERT(NVARCHAR(8), GETDATE(), 112) + N'.bak'
BACKUP DATABASE [CollSoftware2]
TO DISK = @DiskStr
WITH INIT...
October 12, 2006 at 3:35 am
You will have to use dynamic SQL.
exec('SELECT xx FROM ' + @Variable)
October 11, 2006 at 2:54 am
Declare @Memberid as varchar (50)
Declare @ProcCode as Varchar (15)
set @memberid = '-1'
Set @ProcCode = 'G0202'
Select top 100 * from [QICC-TEST].dbo.tblClaims_eligible
where Membid = COALESCE(NULLIF( @memberid, '-1'), Membid)
and ProcCode =...
October 10, 2006 at 9:40 am
You are comparing two different datatypes with NULLIF( @memberid,-1). As INT has a higher precedence than VARCHAR, the VARCHAR will be implicitly converted to an INT before the comparison is...
October 10, 2006 at 8:45 am
>> Can you put SELECT statements inside that COALACSE statement???
You can, but the outer joins should produce the NULLs for you. Try:
SELECT E.EMPID
,COALESCE(L.PlantCode, H2.B_COMN_SITE_NO, 'N/A') AS HRLocation
,COALESCE(L.PlantCode, P2.B_COMN_SITE_NO, 'N/A') AS...
October 5, 2006 at 9:49 am
Viewing 15 posts - 1,411 through 1,425 (of 1,489 total)