...= @date
end
set @max_date = @date
set @curr_id = @id
if @row_count = @@CURSOR_ROWS
begin
insert #temp_results
select @curr_id,@min_date,@max_date
end
fetch next from a_cursor into
@date,
@id
end
close a_cursor
deallocate a_cursor
GO
select * from #temp_results
drop table #temp_results
Have you looked at Sql Server Reporting Services (SSRS) ?. It has very good scheduler/subcription/email export capability built in.
If you have a sql license then you basically already have this?
...in one select with a hard coded identifier column 'A' & 'B' for the two outputs.
-- Rows with more than one which are all the same
select t.* from test t
inner join
(select x.AUTOMATCHID, count(distinct creationid) as cid
from
(select
AUTOMATCHID,A_CREATIONID as creationid
from test...
If I have understood correctly you want to add users/groups from another domain?
I think to achieve this your network guys will have to establish a 'domain trust'
Sorry but in your new sample you now don't have staff (userid) and are now using RESULTCODE as appointment.
If you have found a script that does what you want then go with that.
Because thats the way nulls behave for comparison.
I allways just use isnull to present an arbitrary value, in this case '' (blank)
SELECT * FROM [MTR_MAT_SUPER_TYPE] WHERE DATEPART(m, [MTR_LODG_DATE]) = DATEPART(m, DATEADD(m, -1, getdate()))
AND [MTR_REG_CODE] is not null
AND...
So you only want ap1,ap2 & ap3 ?
and can you confirm if an ap1 record would always exist, or could you get data for a staff member with just ap2 & ap3? (that you would want)
Thats not the same as it outputs a column and only makes the content null based on a condition.
Oracle noprint and starskys solution don't output the column at all, which is what the op wants.
As Simi has said, need some more detail but shooting from the hip and assuming that the first appointment always exists .....
select
ap1.staff,
ap1.appointment1,
ap1.date1,
ap1.successful1,
ap2.appointment2,
ap2.date2,
ap2.successful2,
ap3.appointment3,
ap3.date3,
ap3.successful3...
As sql express typically installs as an instance .... servername/sqlexpress
you must have the 'SQL Server Browser Service' running.
Also within server properties > security make sure you have the correct 'server authentication' mode. Eg if you are passing a username/password in your string...
>>OPENQUERY (LDOS,"INSERT INTO LDOS.tblProjectnumbers (TransID, >>CustId)VALUES(@TransId,@CustId)"
as a starter this needs a tidy. should be
OPENQUERY (server ,'query')
so single not double quotes in the correct place and the number of brackets are wrong also.
First you can create package variables of type string for the whole connection string, server name or just initial catalog properties (amongst others).
Modify the properties of the connection by expanding the 'expressions' and assigning your variable(s) to the property(s)
To update the...
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.