Viewing 15 posts - 3,121 through 3,135 (of 3,543 total)
Also if your Option table has no sequencing identifier then whilst select on the table (even for cursor) will probably give the data in the right order but it cannot...
July 30, 2003 at 7:35 am
I see nothing wrong with monthnumber but monthname will always be the same because you are using GETDATE()
use
DATENAME(month, INDEX_DAT) AS 'Month Name'
for month name
and
'Q'+CAST(DATEPART(qq, INDEX_DAT) as varchar) AS...
July 30, 2003 at 7:26 am
What do who_waitresource and block_waitresource contain. Please specifiy their datatypes and some sample data would be useful. What do you mean by 'is part of'.
Edited by - davidburrows on...
July 30, 2003 at 6:24 am
I agree with Jay, I do everything on procs although I have'nt needed to have complex queries with optional where tests. I try to keep my sql as far away...
July 30, 2003 at 2:07 am
I do all my procs thru script files. Compile into dev, test and if all OK compile into uat and live. I still only have one script but different environments....
July 29, 2003 at 7:17 am
Why not create a staging table with a single column say char(80). Insert the formatted header details first then extract and format the data then DTS this table to your...
July 29, 2003 at 6:53 am
Another possiblity is to create a proc in the linked server that does all the work (SET IDENTITY_INSERT etc) and call that proc to do the insert
EXEC server.database..proc ID,cola,colb....
July 29, 2003 at 6:49 am
You cannot use OPENQUERY without a SELECT. The SELECT NULL fools sql server and it executes the whole query.
July 29, 2003 at 6:46 am
Define your output columns on your target table.
Set transformations for all other matching columns.
Create ActiveX script to parse the input date to the separate output columns.
July 29, 2003 at 6:44 am
The following works OK for me (SQL7 SP4)
To insert one row
SELECT * FROM OPENQUERY(CCC03,'SELECT NULL SET IDENTITY_INSERT [database].. ON INSERT INTO [database].. (COL1,COL2) VALUES (value1,value2)...
July 29, 2003 at 6:40 am
simonmeadows,
Be careful with using DateSerial and other date conversions. If you pass invalid or 'insane' values to DateSerial or even ISDATE you may or may not get a valid date...
July 28, 2003 at 6:35 am
Two things
Firstly your code
-- Remove the comma at the end
IF ( RIGHT(@pstrNames, 1) = ',' )
SET @pstrNames = LEFT(@pstrNames, LEN(@pstrNames) - 1)
You will not...
July 28, 2003 at 6:24 am
If @FirstName and @LastName are the variables and contain NULL for 'Not Supplied' then
WHERE (@FirstName IS NULL OR @FirstName = FirstName)
AND (@LastName IS NULL OR @LastName = LastName)
or if you...
July 28, 2003 at 5:50 am
Is this what you want
declare @max int
declare @ct int
declare @sql nvarchar(4000)
select @max = max(ColPosition)
from frtabledef
where jobid = @jobid
create table...
July 25, 2003 at 8:02 am
Viewing 15 posts - 3,121 through 3,135 (of 3,543 total)