Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. MeanGreen

    IS_MEMBER with Active Directory slow to refresh

    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...
  2. MeanGreen

    stored procedure time out

    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 =...
  3. MeanGreen

    Build Comment and associate to an owner without using Cursor

    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...
  4. MeanGreen

    QUERY QUESTION

    Try this: Select a.* from A left outer join B on A.column1 = B.column1 and A.coumn2 = B.column2 where b.Column1 is null Hope this helps.
  5. MeanGreen

    sql server engine

    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...
  6. MeanGreen

    Second insert fails?

    When you say the second insert fails, what error are you getting.. or is it just rolling back the changes?
  7. MeanGreen

    Executing a stored procedure every night

    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...
  8. MeanGreen

    Select for the Max Records

    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
  9. MeanGreen

    Add data from a database to other

    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.
  10. MeanGreen

    Stored Procedure - Invalid object name

    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...
  11. MeanGreen

    joining tables, then joining to another database

    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.
  12. MeanGreen

    How can I do this Query

    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.
  13. MeanGreen

    Cant get data in right order!!

    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...
  14. MeanGreen

    State of Trigger

    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.
  15. MeanGreen

    Update with data conversion

    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.
  16. MeanGreen

    Selecting the latest months data from a file

    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()] =...
  17. MeanGreen

    How to join two tables from 2 different databases?

    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.
  18. MeanGreen

    I am trying to insert a record into

    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...
  19. MeanGreen

    Looking for SQL trace utilities/software

    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.
  20. MeanGreen

    Connecting to a remote SQL server

    It sounds like you are getting a timeout. You might try setting your remote timeout value to unlimited. Hope this helps.

Part and Inventory Search

Back
Top