Viewing 15 posts - 43,441 through 43,455 (of 59,097 total)
--Jeff Moden
Change is inevitable... Change for the better is not.
June 13, 2009 at 12:28 am
Like this...
[font="Courier New"]--===== Disable all triggers on user tables in database
DECLARE @SQL VARCHAR(MAX)
SELECT @SQL =''
SELECT @SQL = @SQL +
+ 'DISABLE TRIGGER ALL ON ' + Table_Schema + '.' +Table_Name +';'
FROM Information_Schema.Tables
WHERE Table_Type = 'BASE TABLE'
EXEC (@SQL)
--===== Enable all triggers on user tables in database
DECLARE @SQL VARCHAR(MAX)
SELECT @SQL =''
SELECT @SQL = @SQL +
+ 'ENABLE TRIGGER ALL ON ' + Table_Schema + '.' +Table_Name +';'
FROM Information_Schema.Tables
WHERE Table_Type = 'BASE TABLE'
EXEC (@SQL)[/font]
--Jeff Moden
Change is inevitable... Change for the better is not.
June 12, 2009 at 11:35 pm
Vivien Xing (6/11/2009)
500+ GB database is considered as a VLDB nowadays.
Who made that rule? 😉
--Jeff Moden
Change is inevitable... Change for the better is not.
June 12, 2009 at 11:02 pm
Tim Hobbs (6/12/2009)
Many thanks for this - I'm now reading up about CTE's!!!Regards
Tim
It's not the CTE that did the magic. It's the way one ROW_NUMBER was compared to another....
--Jeff Moden
Change is inevitable... Change for the better is not.
June 12, 2009 at 10:59 pm
Cross post... please, no answers here. Go to the following instead...
http://www.sqlservercentral.com/Forums/Topic734177-338-1.aspx
--Jeff Moden
Change is inevitable... Change for the better is not.
June 12, 2009 at 10:53 pm
Jeffrey Williams (6/12/2009)
BTW - if you do not specify file locations in your create database statement, the default location defined for that instance will be used.
Voice of reason, right there.
--Jeff Moden
Change is inevitable... Change for the better is not.
June 12, 2009 at 10:49 pm
Leave the first "-o" alone. Change all of the other "-o" to ">>".
Old DOS warrior trick. 😛
--Jeff Moden
Change is inevitable... Change for the better is not.
June 12, 2009 at 10:47 pm
This is a classic error that causes huge performance problems. The target of the update must also be included in the FROM clause if a join is present. ...
--Jeff Moden
Change is inevitable... Change for the better is not.
June 12, 2009 at 10:45 pm
For the record, both Temp Tables and Table Variables start out in Memory and spool to TempDB if they get too big.
I suspect neither a Local Temp Table nor a...
--Jeff Moden
Change is inevitable... Change for the better is not.
June 12, 2009 at 10:38 pm
What helped it was that you got the COALESCE out of the WHERE clause.
--Jeff Moden
Change is inevitable... Change for the better is not.
June 12, 2009 at 10:32 pm
anandhakrishnabca (6/12/2009)
I want to validate the given number. how to check for the following requirements in sql server 2005
1) how to...
--Jeff Moden
Change is inevitable... Change for the better is not.
June 12, 2009 at 10:25 pm
srikale (6/11/2009)
I want to insert a new column , check while inserting values.
For example : I have a table TBL with 2 columns , but...
--Jeff Moden
Change is inevitable... Change for the better is not.
June 12, 2009 at 10:22 pm
I'm not sure why people think they need to do everything in a single query. Use the input parameters to get only the data you need from the properties...
--Jeff Moden
Change is inevitable... Change for the better is not.
June 12, 2009 at 10:11 pm
Just in case...
[font="Courier New"] SELECT DATEADD(wk,DATEDIFF(wk,-2,'07/13/2008')+t.Number,-2)
FROM Master.dbo.spt_Values t
WHERE t.Type = 'P'
AND t.Number < DATEDIFF(wk,'07/13/2008','08/13/2008')+1
AND DATEADD(wk,DATEDIFF(wk,-2,'07/13/2008')+t.Number,-2) <= '08/13/2008'[/font]
--Jeff Moden
Change is inevitable... Change for the better is not.
June 12, 2009 at 9:49 pm
No... SQL Server 2000 doesn't have WITH/CTE. Instead, use a "Derived Table" which is nearly identical in most cases. A derived table is just like a CTE in that it's...
--Jeff Moden
Change is inevitable... Change for the better is not.
June 12, 2009 at 9:39 pm
Viewing 15 posts - 43,441 through 43,455 (of 59,097 total)