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...
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...
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...
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...
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.
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...
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.
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...
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.
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.
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.
I've found in the past, at least when restoring databases, that the backup will keep the user record in the sysusers table that is local to the database, however, the UID in the user database does not match the UID in the master database. When Enterprise Manager shows you the users in the...
Assuming you what a single value in a variable and not in a resultset...
<b>Create a procedure:</b>
Create Proc TestProcedure @EmployeeID int
@OutputValue varchar(30) OUTPUT
AS
SELECT @OutputValue = Name
FROM emp
WHERE empno = @EmployeeID
<b>Call the...
I'd rather select 100,000,000 records into a temp table then declare a cursor, loop through each one, setting variables along the way. In my experience, if you can get away from using cursors, do it. SQL Server isn't very efficient at looping. Then again, if you have 100,000,000 records, you...
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.