Viewing 15 posts - 4,591 through 4,605 (of 5,394 total)
Most of the query cost seems to be in the Key Lookup for DocDataField.FieldValueDateTime in the last outer join in the view.
Try adding a covering index to avoid the lookup.
I...
February 11, 2010 at 10:19 am
Some of your variables are set to null along the way. Try to catch it with ISNULL.
BTW, your code is prone to sql injection, I suggest that you revise it...
February 11, 2010 at 10:01 am
Try with:
SELECT *
INTO [Server-B].[DB_Name].dbo.NewTable
FROM #temp_table
WHERE FILE_NAME = 'DBName..NewTable'
The reason your OPENQUERY fails is that #temp_table is a temporary table, visible only on Server-A in the session that created it. No...
February 11, 2010 at 9:26 am
Let's see what BOL states:
OPENQUERY Executes the specified pass-through query on the specified linked server.
This means that OPENQUERY can be used to execute a query on a remote linked server...
February 11, 2010 at 9:13 am
Paul White (2/11/2010)
The 'sigh' is a link to today's featured article. I'm away from home an unable to reply as...
February 11, 2010 at 4:12 am
February 11, 2010 at 3:10 am
It's interesting to note that your original syntax doesn't fail in SQL 2005.
Very strange.
February 10, 2010 at 8:55 am
Try this way:
select 'Year ending '+ job_date
+' revenue was '+ job_cost
from (
select cast(year(job_date) as varchar(4)) as job_date,
cast(sum(job_cost) as varchar(20)) as job_cost
from job
group by cast(year(job_date) as varchar(4))
) AS data
February 10, 2010 at 8:12 am
You can get the jobs scheduled in the time window you like with something similar to this:
;WITH schedules AS (
SELECT *, sTime = REPLACE(STR(next_run_time,6),' ','0')
FROM msdb..sysjobschedules
WHERE next_run_date > 0
),
dt_schedules...
February 10, 2010 at 6:25 am
Yes: a database full backup is suitable for that purpose.
Do you have any?
February 10, 2010 at 3:00 am
Is any of you willing to help this OP with the correct syntax to get his DB back? I don't remember all the parameters right now...
February 10, 2010 at 2:44 am
No, I'm sorry. You should have a backup.
February 10, 2010 at 2:41 am
Roy Ernest (2/9/2010)
February 10, 2010 at 1:48 am
john.arnott (2/9/2010)
I think I've found a set of universes in which TSQL cursors and while-loops are nearly always demonstrably faster than set-based logic.
Is Jeff in that universe writing...
February 10, 2010 at 1:28 am
Viewing 15 posts - 4,591 through 4,605 (of 5,394 total)