Viewing 15 posts - 16 through 30 (of 116 total)
Thanks, good call .... but
EXEC xp_cmdshell 'sqlcmd -S "<ServerName>" -i "C:\Temp\mysqlfile.sql"'
results
select StringValue from dbo.PowershellTest
StringValue
Gültig
running sqlcmd direct from the cmd window gives the same results
January 21, 2015 at 2:56 am
I got a lucky guess on this, Choose three from five, two are successfull, three are unsuccessfull
December 12, 2014 at 12:47 am
You are absolutly correct Gail.
In the example I've posted that is a significant difference.
In the proc that I'm tuning the duration is 50 minutes and the difference is less signficant.
On...
December 9, 2014 at 4:43 am
Thank you very much for your answer Gail.
( I've got no idea what recursion looks like in an exection plan, I 'll go away and build one :-))
December 9, 2014 at 2:25 am
Just to clarify, I thought the sub select would perform badly because it references the outer select and some kind of recursion would happen.
December 9, 2014 at 2:19 am
Solved 😀
I changed the verbose to -verbose *>
invoke-sqlcmd -inputfile "C:\Temp\mysqlfile.sql" -serverinstance "ServerInstance" -database "Tempdb" -verbose *> C:\Temp\ReleaseLog.txt
now my ReleaseLog.TXT hold all the information
Der Datenbankkontext wurde auf 'tempdb' geändert.
invoke-sqlcmd :...
October 8, 2014 at 8:51 am
Wow thanks for the really quick answer.
This is a production server.
I can go for a reboot out of office hours, but need to get it cleared by onhigh ( we...
December 14, 2012 at 7:19 am
You may be able to get some additional information out of the sys tables
DECLARE @ScheduledJobName sysname
SET @ScheduledJobName = 'your Scheduled Job Name'
SELECT SQL_message_id,messages.text,sql_severity,message
FROM msdb.dbo.sysjobhistory
JOIN msdb.dbo.sysjobs
ON sysjobhistory.Job_id = sysjobs.Job_id
JOIN sys.messages...
June 26, 2012 at 8:21 am
If your monthly job starts to run before the weekly job is scheduled to run, you could add a step to disable the weekly job
DECLARE @JobName sysname
SET @JobName = 'Your...
June 26, 2012 at 7:41 am
Am I reading this right?
FOR ATTACH
FOR ATTACH [ WITH < attach_database_option > ]
Specifies that the database is created by attaching an existing set of operating system files. There must...
June 21, 2012 at 1:00 am
ramadesai108
Depending on how you generate the values for the @EmpID, it may be worth looking at declaring it as a table and populating it with a select statement.
Then you could...
June 19, 2012 at 12:52 am
I absolutely agree,
but (there had to be one didn't there 🙂 )
The OP did ask about how to concatenating the values back
June 13, 2012 at 9:54 am
SET DATEFORMAT dmy;
GO
SELECT
[Getdate] = GETDATE()
,[Year] = DATEPART ( yy , GETDATE() )
,[Month] = DATEPART ( mm , GETDATE() )
,[Day] = DATEPART ( dd , GETDATE() )
,[and back again] =...
June 13, 2012 at 9:37 am
sample data
CREATE TABLE #Table([RecordDate] DATETIME , [LogicalName] sysname, [SizeMB] INT );
go
INSERT INTO #Table([RecordDate], [LogicalName], [SizeMB])
SELECT '2010.01.01 10:20:000','msdb', 10 UNION ALL
SELECT '2010.01.01 10:20:000', 'anotherdb', 300 UNION ALL
SELECT...
June 13, 2012 at 9:14 am
Viewing 15 posts - 16 through 30 (of 116 total)