Author |
Topic |
X002548
Not Just a Number
15586 Posts |
|
spirit1
Cybernetic Yak Master
11752 Posts |
Posted - 2007-05-18 : 15:22:04
|
EXEC sp_msforeachtable 'exec sp_recompile ''?'''_______________________________________________Causing trouble since 1980blog: http://weblogs.sqlteam.com/mladenp |
 |
|
X002548
Not Just a Number
15586 Posts |
|
spirit1
Cybernetic Yak Master
11752 Posts |
Posted - 2007-05-18 : 15:39:02
|
yup.although i have no idea why do you want to recompile your tables..._______________________________________________Causing trouble since 1980blog: http://weblogs.sqlteam.com/mladenp |
 |
|
X002548
Not Just a Number
15586 Posts |
Posted - 2007-05-18 : 15:44:17
|
Doesn't that also recompile the procedures when this is done?And that worked btwWhat's happening, is the database structure is pretty much in flex, so when I did sp_depends on a table that got chnaged a sproc didn't show up because I believe it wasn't recompiled after the changeI though this would fix that, which when I manually recompiled that one sproc, it did.Do I have this wrong?Brett8-)Hint: Want your questions answered fast? Follow the direction in this linkhttp://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspxAdd yourself!http://www.frappr.com/sqlteam |
 |
|
spirit1
Cybernetic Yak Master
11752 Posts |
Posted - 2007-05-18 : 15:47:31
|
honestly i have no idea. i never even thought about recompiling tables._______________________________________________Causing trouble since 1980blog: http://weblogs.sqlteam.com/mladenp |
 |
|
Kristen
Test
22859 Posts |
Posted - 2007-05-19 : 07:20:23
|
"What's happening, is the database structure is pretty much in flex"Dump the cache buffers instead? Or is that a bit severe?!Kristen |
 |
|
Kristen
Test
22859 Posts |
Posted - 2007-05-19 : 07:21:05
|
By the by, sysdepends is shot in SQL 2000, so I would not trust recompiling tables to hit the relevant Sprocs. Supposedly better/fixed in SQL 2005Kristen |
 |
|
X002548
Not Just a Number
15586 Posts |
|
Kristen
Test
22859 Posts |
Posted - 2007-05-21 : 10:19:17
|
Recompile the lot?Record the average elapsed time for each Sproc, recompile the ones where this time has fallen below some "threshold"?Kristen |
 |
|
sql_er
Constraint Violating Yak Guru
267 Posts |
Posted - 2007-05-22 : 11:38:14
|
If you are referring to "how to fix sp_depends problem", then the solution I am using (not mine, but from some forums, possibly this one), is shown below (Once everything is created, use sp_depends2):Below should be placed in the Master database so that we can query the syscomments table more accurately:IF EXISTS(SELECT TOP 1 * FROM SYSOBJECTS WHERE NAME = 'NUMBERS')BEGIN DROP TABLE dbo.NumbersCOMMITGO-- Now re-create it and fill it with sequential numbers starting at 1SELECT TOP 10000 IDENTITY(INT,1,1) AS NumINTO dbo.NumbersFROM master.INFORMATION_SCHEMA.COLUMNS i1CROSS JOIN master.INFORMATION_SCHEMA.COLUMNS i2;GO-- Add a primary key/clustered index to the numbers tableALTER TABLE dbo.NumbersADD CONSTRAINT PK_Numbers PRIMARY KEY CLUSTERED (Num);GO-- Create a procedure for querying dataCREATE Procedure sp_depends2@sString VARCHAR(100)ASBEGIN SELECT DISTINCT O.Name, O.Type FROM ( SELECT Id, CAST(COALESCE(MIN(CASE WHEN sc.colId = Num - 1 THEN sc.text END), '') AS VARCHAR(8000)) + CAST(COALESCE(MIN(CASE WHEN sc.colId = Num THEN sc.text END), '') AS VARCHAR(8000)) AS [text] FROM syscomments SC INNER JOIN numbers N ON N.Num = SC.colid OR N.num - 1 = SC.colid WHERE N.Num < 30 GROUP BY id, Num ) C INNER JOIN sysobjects O ON C.id = O.Id WHERE C.TEXT LIKE '%' + @sString + '%'END... hope it helps ... |
 |
|
|