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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Recent content by mfairchild

  1. mfairchild

    select * from @???

    Try this: DECLARE @tabxxx sysname, @SQL nvarchar(1000) SET @tabxxx = 'TABLE_NAMExxx' SET @SQL = "SELECT * FROM " + @tabxxx EXEC(@SQL)
  2. mfairchild

    HOW DO I SHRINK SQL TRANSACTION LOGS ???

    SQL Server log files are "wrapping" logs, so shrinking them doesn't shrink it as much as you'd like. The code below is from the MS knowledge base. There's an article in there that explains the whole process (I don't know the article# off of the top of my head). I've run this code...
  3. mfairchild

    Suppressing "Index is being rebuilt" from a proc

    Thanks, Terry. I knew that clustered indexes rebuild the other indexes and that's what was bothering me. :) The table has no other indexes or constraints. Other than the table and field names, the code I posted is the same as what I was running. Just for kicks, I changed the "Create...
  4. mfairchild

    Suppressing "Index is being rebuilt" from a proc

    Sorry, I forgot. I'm using SQL Server 7.0.
  5. mfairchild

    Suppressing "Index is being rebuilt" from a proc

    I'm putting a clustered index on a temp table in a stored proc and keeping getting the message "Index (ID = 2) is being rebuilt" when the results are returned. I know what the message means, but I don't know how to suppress it. The temp table has no other indexes on it. Anyone have...
  6. mfairchild

    finding table information

    This is for SQL Server 7.0, but should get you started. SELECT so.name as Table_Name, sc.name as Col_Name, st.name as DataType, sc.prec, sc.scale, sc.isnullable FROM sysobjects so, syscolumns sc, systypes st WHERE so.type = 'u' and so.id = sc.id and sc.usertype = st.usertype ORDER...
  7. mfairchild

    Import text file

    Try this: Create Procedure pTempProc @FilePath varchar(255) AS Declare @SQL nvarchar(1000) Create Table #TempFile (Field1 int Null, Filed2 varchar(50) Null) SET @SQL = " Bulk Insert #TempFile FROM '" + @FilePath + "' With (FirstRow = 1, FieldTerminator = ',')&quot...
  8. mfairchild

    Given below is the code for a store

    Is the ID an identity field? If it is, you can use the @@identity global variable. It contains the last identity key assigned. If it's not an identity, you could return the result of select max(id) from Q14.
  9. mfairchild

    SQL Mail Configuration

    A few things you didn't mention in your post, so you should double-check them: 1) The MSSQLServer service should start up with the account that you will be using for SQLMail. (Domain2/Automail) 2) The "Profile name" in the SQLMail properties should be the domain/account name. I've had...
  10. mfairchild

    Stored Procedures and OpenQuery

    Most of my experience with this is with a linked server to a huge poorly managed RDB platform. It's interesting to hear that OpenQuery doesn't use indexes and the four part name method does (against another SQL Server). Thanks Terry.
  11. mfairchild

    Enterprise Manager

    Try registering the server in Enterprise Manager using a user that only has access to the database you use.
  12. mfairchild

    Stored Procedures and OpenQuery

    I've used that too. The only thing that I've always wondered is how a statement like that is executed. I'd think that OpenQuery with parameters would make the remote server limit the return resultset before returning it to SQL Server. I'm not sure exactly what the remote and local server is...
  13. mfairchild

    Stored Procedures and OpenQuery

    You can use parameters in a openquery statement, but you need to make the entire statement (local statement and openquery statement) a string and execute it using EXEC. It becomes a pain to get all of the ' and " correct, but it does work.
  14. mfairchild

    Oracle 8.0.3 and Windows 2000 Advanced Server

    Has anyone personally gotten an Oracle 8.0.3 server successfully installed on Windows 2000 Advanced Server? Was there anything outside the normal install that you needed to do? Thanks.
  15. mfairchild

    into error

    I assume khaleel2001 is an Oracle guy in a SQL database. :) Oracle's INTO statement is for variables, not tables. khaleel2001, listen to Terry, he is right.

Part and Inventory Search

Back
Top