Viewing 15 posts - 4,591 through 4,605 (of 5,393 total)
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...
-- Gianluca Sartori
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...
-- Gianluca Sartori
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...
-- Gianluca Sartori
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...
-- Gianluca Sartori
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.
-- Gianluca Sartori
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
-- Gianluca Sartori
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...
-- Gianluca Sartori
February 10, 2010 at 6:25 am
Yes: a database full backup is suitable for that purpose.
Do you have any?
-- Gianluca Sartori
February 10, 2010 at 3:00 am
What do you mean exactly with "flags"?
-- Gianluca Sartori
February 10, 2010 at 2:46 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...
-- Gianluca Sartori
February 10, 2010 at 2:44 am
No, I'm sorry. You should have a backup.
-- Gianluca Sartori
February 10, 2010 at 2:41 am
Roy Ernest (2/9/2010)
-- Gianluca Sartori
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...
-- Gianluca Sartori
February 10, 2010 at 1:28 am
The Dixie Flatline (2/7/2010)
-- Gianluca Sartori
February 8, 2010 at 2:08 am
Viewing 15 posts - 4,591 through 4,605 (of 5,393 total)