Viewing 15 posts - 3,211 through 3,225 (of 3,543 total)
DECLARE @ok char(1)
SET @ok = 'N'
SET @cprice_sql = 'select @ok=''Y'' from v_loan_and_loan_shipped where loan_id = '+ @LNID + ' and (' + @psyntax + ') '
exec...
June 27, 2003 at 6:49 am
Additional. If your are producing a proc and don't mind using a temp table then this a possible solution.
create table TABLEA ([ID] int)
create table TABLEB...
June 26, 2003 at 8:43 am
Is there any data on the child records that identifies it's position within the parent? eg
TABLEA
IDA
1
2
3
TABLEA
IDA,IDB
1,1
1,2
2,1
2,2
2,3
3,1
Can u post structure of both tables, test data and expected result?
Edited by - davidburrows...
June 26, 2003 at 8:21 am
I have a weekly scheduled job that has 3 steps using procs to update a database. 3 more steps, each using isql to extract data from the tables updated to...
June 26, 2003 at 7:51 am
Samples
DECLARE @val money
SET @val = 1234567.89
SELECT CONVERT(char(15),@val,1)
DECLARE @val int
SET @val = 1234567
SELECT LEFT(CONVERT(char(18),CAST(@val AS money),1),15)
DECLARE @val decimal(9,2)
SET @val = 1234567.89
SELECT CONVERT(char(15),CAST(@val AS money),1)
DECLARE @val real
SET...
June 26, 2003 at 7:25 am
SELECT AptDate, AptTime,
MAX(CASE WHEN SchedName = 'Monica' THEN Appt ELSE '' END) AS Monica,
MAX(CASE WHEN SchedName = 'Olivia' THEN Appt ELSE '' END) AS Olivia,
MAX(CASE...
June 26, 2003 at 7:13 am
Or
select col1,
col2,
max(col3),
max(col4),
max(col5),
max(col6)
from tablename
group by col1,col2
to group by first 2 cols.
Edited by - davidburrows on 06/26/2003 06:44:56 AM
June 26, 2003 at 6:44 am
Before I transfer/copy/restore any database to another server I always use the following to generate sql to create login(s). This makes sure that the sid is the same so that...
June 26, 2003 at 6:34 am
racosta,
Thats ok if you are supplying the value of the identity column. If not and you want sql to generate the value then you need to use a format file.
BTW...
June 26, 2003 at 2:43 am
Create a format (.fmt) file and pass it to the bcp command.
June 25, 2003 at 7:49 am
Yes but you will have to update the text column one row at a time and once for each source data using a pointer for the source text and a...
June 25, 2003 at 7:14 am
DECLARE @na varchar(100)
set @na ='1,2,3,4,5'
DELETE FROM [Gibor_h].[dbo].[Sn]
WHERE charindex(','+CONVERT(varchar,[na])+',',','+@na+',') > 0
Sorry in my last post forgot to put commas around converted na column. Need to do this to make sure...
June 25, 2003 at 1:58 am
You could try
select *
from master..FGMapperPageAlloc
where dbid = 6 and fileid = 1
and charindex(ObjectNameAtPage,@vmyobj_) > 0
order by 1,2
Sorry, typo.
Edited by - davidburrows on 06/24/2003 07:41:11 AM
June 24, 2003 at 7:38 am
Also you are trying to misuse EXEC. Is this what you are trying to do?
DECLARE @na varchar(100), @sisi int, @mmh char(10)
set @na ='1,2,3,4,5'
set @sisi='2'
SET @mmh='555'
UPDATE [Gibor_h].[dbo].[Sn]
SET [sisi] = @sisi,
[mmh]...
June 24, 2003 at 7:32 am
Wanda,
Seems to me your code looks OK and matches your requirements. Maybe the problem is to do with data.
Try
SELECT LEDef_ActiveInd, LEDef_Cd FROM LEDef_PK WHERE LEDef_ActiveInd = 1
Do you get all...
June 24, 2003 at 3:26 am
Viewing 15 posts - 3,211 through 3,225 (of 3,543 total)