Viewing 15 posts - 76 through 90 (of 212 total)
jdamian (3/13/2012)
March 13, 2012 at 9:00 am
jdamian (3/13/2012)
March 13, 2012 at 8:43 am
Annee (3/12/2012)
But to make sure, I repeated it using the commands u sent.
But no luck.. still the same...
March 12, 2012 at 2:35 pm
Annee (3/12/2012)
That's good to know!Have a question! Where did you run all these statements exactly from?
Management studio?
Yes, you may have to enable the xp_cmdshell extended sproc first:
USE
master
GO
EXEC sp_configure 'show...
March 12, 2012 at 2:20 pm
I just tried replicating the issue from your first query (modifed to use AdventureWorks DB) and it output 19614 records to a .csv:
DECLARE @FileName varchar(50),
@bcpCommand varchar(2000)
SET @FileName = REPLACE('c:\\ArchiveDocumentHold_'+CONVERT(char(8),GETDATE(),1)+'.csv','/','-')
SET @bcpCommand...
March 12, 2012 at 1:29 pm
Annee (3/12/2012)
DECLARE @bcpCommand varchar(2000)SET @bcpCommand = 'bcp "select * from DGSData.dbo.DocumentHold where DATEDIFF(day, adddatetime, GETDATE()) = 0" queryout " C:\\ArchiveOutput.csv" -t, -T -c'
EXEC xp_cmdshell @bcpCommand
The problem I see with this...
March 12, 2012 at 1:19 pm
jdamian (3/12/2012)
March 12, 2012 at 11:15 am
Annee (3/12/2012)
SQLState =...
March 12, 2012 at 11:14 am
marly (3/12/2012)
SELECT * from dbo.mytable WHERE FirstName LIKE ‘%’ + REPLACE(@FirstName , ‘%’,’’) + ‘%’
but it still seems to put down the whole database if I...
March 12, 2012 at 9:50 am
I think the job will simply not run. It won't fail because it won't be attempted. This Sunday, 2:00 AM will not exist.
March 9, 2012 at 3:01 pm
I like to use BCP:
declare @cmd varchar(1000)
set @cmd =
'bcp "select Col1, Col2, Col3 from x where Add_dateTime = CONVERT(VARCHAR(10),getdate(),120)" queryout "F:\output.csv" -t, -T -c'
exec xp_cmdshell @cmd
Then wrap that in a...
March 9, 2012 at 12:58 pm
Have you tried turning on the Windows Event Log service?
March 9, 2012 at 12:24 pm
OR execute BCP right from a scheduled SQL Agent job. Here's a similar script I've used for a CSV file (you can change it for tab delimited use):
declare...
March 9, 2012 at 12:18 pm
How about creating a batch that executes a BCP (Bulk Copy Program) script?
March 9, 2012 at 12:15 pm
Viewing 15 posts - 76 through 90 (of 212 total)