I had a problem after this, and had to work with our IP engineer to figure out how I could do this. I got it to write a file using the SQL, but when I did it from a SP, it still wouldn't work. Evidently there is a bug in SQL server. Here is the workaround that I ended up using(although I am...
I have dbname.dbo.contacts in my query and it still is giving me the same recordset without creating records. Here is the complete recordset that is labeled output:
usage: bcp {dbtable | query} {in | out | queryout | format} datafile
[-m maxerrors] [-f formatfile] [-e...
I am trying to get the following sp to work:
CREATE PROCEDURE BulkCopy
AS
declare @FileName varchar(100)
declare @string varchar(1000)
SET @filename = 'C:\test'+CONVERT(char(8),GETDATE(),10)+'.txt'
SET @string='bcp "select name, count(recordid) as categorization from
contacts where...
Thanks guys for your help. There are still a few records that are being returned that aren't unique(see my last post), but after some thought, I've decided that returning those records is OK for now.
I may be back on here again in a month or two when I have to run some different queries using...
OK, that helped. Here is what I used:
SELECT distinct(a.MessageID),
b.ActionDateLast,
a. etcetera
FROM Actions a
JOIN LatestActions b ON a.MessageID = b.MessageID
now my problem is this...take a look back at the original record set. In that recordset, there is a field that is...
I am having some problems filtering some records that aren't distinct. Here is my scenario:
Example record set in this format:
MessageID, ReceiveDate, ActionDate1, ActionDate2, SendDate, Name, Code, Description
Here is 6 records from the table I am pulling from. Notice some have same...
I am using SQL Server 2000, and I want to return a data set that consists of the following
Chan1 Chan2
Apr 116 1
May 112 5
Here is the aggregate table that I am pulling from:
CatID Channel mth Disp_mth yr vol
3502 Chan1 4 April 2003 116
3502 Chan2 4 April 2003 1
3502...
I want to return a data set that consists of the following
Chan1 Chan2
Apr 116 1
May 112 5
Here is the data set that I am pulling from
CatID Channel mth Disp_mth yr vol
3502 Chan1 4 April 2003 116
3502 Chan2 4 April 2003 1
3502 Chan1 4 May 2003 112...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.