Viewing 15 posts - 61 through 75 (of 155 total)
Even if I selected the "correct answer" (and I got the points...), I'm not so sure about this one. The following page says that you can backup to a local...
September 3, 2004 at 8:05 am
Undocumented, but it should work:
CREATE DATABASE NewDatabase EXEC sp_MSforeachtable 'IF (SELECT COUNT(*) FROM ?)>0 SELECT TOP 100 * INTO NewDatabase.? FROM ?'
Razvan
September 2, 2004 at 8:56 am
I think you need something like:
SELECT * FROM ActualNumbers WHERE [month]=MONTH(GETDATE()) AND [year]=YEAR(GETDATE()) UNION ALL
SELECT * FROM MonthlyNumbers WHERE [month]<MONTH(GETDATE()) AND [year]=YEAR(GETDATE()) UNION ALL SELECT * FROM YearlyNumbers WHERE [month]>MONTH(GETDATE()) AND...
August 31, 2004 at 8:15 am
The query optimizer uses one of the three join methods (nested loops, merge, hash), based on the estimated number of records that will be selected and other informations from the...
August 31, 2004 at 6:06 am
Mike, use the following query:
SELECT a.name FROM person a INNER JOIN personproperty b ON a.Personid = b.Personid INNER JOIN property c ON b.Propertyid = c.Propertyid WHERE c.Propertyid in (2,6,9) GROUP...
August 31, 2004 at 5:39 am
Indeed, the "correct answer" is wrong.
This registry key is documented in the following KB articles: 827422, 285097, 322336, 325022, 319930. They all say that the registry key for the default...
August 25, 2004 at 12:24 am
He says that you should mark the error 1205 as logged (by default it's not logged) and restart SQL Server after setting up the alert. Let me know...
August 24, 2004 at 11:33 pm
Your example is not very good, because the result is the same if you want to round the number to 2 decimals or truncate it to 2 decimals. So let's...
August 24, 2004 at 9:36 am
Try the following (not tested):
SELECT * FROM OPENQUERY (MyServer, 'TRUNCATE TABLE MyStage.dbo.MyMemberStage SELECT ''Done''')
Razvan
August 24, 2004 at 9:13 am
You cannot do this. All the SQL Server statements run on the server. The backup file will be written on the server, unless you specify a path to a shared...
August 24, 2004 at 8:50 am
See my response for the following message:
http://www.sqlservercentral.com/forums/shwmessage.aspx?forumid=8&messageid=124444
You can use sp_dbcmptlevel to simulate the SQL Server 7 behaviour, but this will prevent you from using SQL Server 2000-specific features (for example: UDF-s,...
August 23, 2004 at 6:14 am
Federico,
Read the following article by Erland Sommarskog, SQL Server MVP:
http://www.sommarskog.se/dyn-search.html
It's an in-depth article about this problem, with many solutions (using Dynamic SQL or Static SQL).
Razvan
August 23, 2004 at 3:55 am
If there are certain status columns that are used in all the queries, try to make a compound index on all the status columns, placing the frequently used columns first....
August 23, 2004 at 3:54 am
Stewart, here is a better (easier) way:
WHERE StartDate < DATEADD(m, DATEDIFF(m, 0, GETDATE()), 0)
Razvan
August 20, 2004 at 9:11 am
Another way (more clear, but probably slower), could be:
WHERE MONTH(MyDate)<MONTH(GetDate()) AND YEAR(MyDate)=YEAR(GetDate()) OR YEAR(MyDate)<YEAR(GetDate())
I think Stewart's solution is the best, but it works correctly only if there is no time portion...
August 20, 2004 at 7:33 am
Viewing 15 posts - 61 through 75 (of 155 total)