We are currently testing using the IS_MEMBER function in conjunction with some active directory domain local security groups to help filter data that users can see.
The issue is with the IS_MEMBER function.
It doesn't seem to refresh who is and is not in a group in any deterministic time...
Another possibility might be the use of a variable that you are feeding your query. Have you tried to run your query within a text variable as if it were dynamic sql?
Example:
declare @var1
set @var1 = 'MyTest'
declare @SQL varchar(8000)
set @SQL = 'select count(*) from table where col1 =...
I have a table with multiple comments that I want to merge into one comment per owner WITHOUT using a CURSOR. Here is my sample table:
create table #test
(Owner char(1),
Seq int,
comment varchar(25))
insert #test values ('A',1,'This is')
insert #test values ('A',2,'a')
insert #test values...
MDAC is not an engine to ACCESS, but stands for Microsoft Data Access Component. It is a method to get to your Access data, and SQL Server uses the same interface. What you might be referring to is the ODBC driver, and for Access it uses the Jet Engine while SQL Server uses native driver...
SilentDeb,
You should just set up a job to run every night and paste your query in the job. It sounds like you already have the query, unless you are manually setting some date stuff. An example query would be:
delete mytable
where datecolumn < dateadd(d,-7,getdate())
This would delete...
I am not sure what you are really asking for, but is this close to what you want?
select period,region,comm,elem,maxscr,max(score) score, convert(float(8,3),(max(score)))/convert(float(8,3),maxscr) avg from mytable
group by period,region,comm,elem,maxscr
Hope this helps.
MeanGreen
You could use a SELECT INTO statement to create your table with the columns. Example:
Select top 10000 * into MyQATable from MYProductionTable
order by MyDateColumn
Hope this helps.
Just get rid of the GO statement after the temp table creation:
create proc insr_asset_seg
AS
--create temporary table to take asset segment values
create table #temp_asset_seg
(
LOAN_NUMBER CHAR(16) NOT NULL,
PORT1 NUMERIC(11,8) NULL,
PORT2...
Try this:
[B]
select Column1, Column2, Column3
from visit
join visitapptlist
on visit.visit_id = visitapptlist.visit_id
UNION
Select Column1, Column2, Column3
from psmprod.dbo.casemain, prod.dbo.appt
where (psmprod.dbo.casemain.appt_id=prod.dbo.visitapptlist.appt_id)
[B]
Hope this helps.
This should get you a list of Customer who retire in next 30 days:
Select * from Customer C join Retirement R
on C.iKey = R.iKey
where R.Age * 12 between DateDiff(month,DOB,GetDate())
and DateDiff(month,DOB,DateAdd(day,30,GetDate()))
Hope this helps.
Try this:
select left(supp_registrationdatetime, 11), count(left(supp_registrationdatetime, 11))
from supporter_details sd, supporter_registered_emailadd sr
where sd.supp_number = sr.supp_number
and supp_registrationdatetime > 'Jan 26 2003'
group by left(supp_registrationdatetime...
Terry once gave me the code for this:
SELECT OBJECTPROPERTY(OBJECT_ID('Trigger_Name'),
'ExecIsTriggerDisabled') will return 1 if the trigger is disabled - 0 if enabled.
Hope this helps.
I am guessing that this would work even though you say the convert would not:
update posted_jrnl_line
set trans_amt= convert(money,'0.0000')
where jrnl_id = 'TRA123457'
Let me know if this does not work.
Hope this helps.
Is your date field defined as datetime or varchar? What error message are you getting? Can you post the query exactly as you have it typed? Here is one possible solution provided your date field is a datetime:
[B}
Select name, address
from clientinfo
where datediff(mm,[datefield],getdate()] =...
Just prefix the table with database name. Try this:
SELECT sale.subcategoryid
FROM sale
WHERE subcategoryid in
(SELECT
subcategoryID,
className,
categoryName
FROM
propertydb.dbo.category)
Hope this helps.
Your problem is your @studentID. You need the actual value passed in for your insert. Try this:
ALTER PROCEDURE InsertStudenttoClass
(
@tableName varchar(10),
@StudentID int
)
AS
DECLARE @myStr varchar(1500)
select @tableName = 'test'
select @StudentID = 1
SELECT @mySTR= 'INSERT INTO...
Save your trace file to table and you can do quite a bit of manipulation. If you decide to move the table to another server, you will need to also get the sysobject links for database name and such.
Hope this helps.
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.