The #Critical in both cases should have been #OPLST--I have two very similar procedures one using a temp table called #Critical and the other using #OPLST (I mismatched some of my cut and paste into the post), and I get the same results. However, I did find an answer (though not a solution) to...
OK. I added the user to the bulkadmin server role, but still received the same results. I went so far as creating a "real" table and granted the user Insert permission (since BOL stated that the user also needed to have insert permission on the table in addition to being granted the server...
I thought a table variable would cure my woes, but that doesn't seem to be a viable option with a bulk insert. I have the following stored procedure that works fine when I execute it (with admin access), but when my user runs it they recieve the following error: "The current user is not the...
Can I bulk insert into a table variable? When I run the following, I recieve a syntax error; however it does work if I create a temp table instead of the variable.
declare @OPLST table(
BATCH varchar(9),
SUBNO varchar(15),
PCNTLNO varchar(38),
CLAIMNO varchar(16),
CPLAN varchar(10)...
I have a UNIX file that I am trying to BULK INSERT, but can't seem to get the correct rowterminator. Each row ends with a LF and I have tried \r, \n, and \r\n, but all return in error. If I replace the LF with CRLF, then it works with '\n', but this is going to be a daily process with some...
I'm doing what I think is a simple Bulk Insert into a table from a tab delimited file.
BULK INSERT dbo.table
FROM '\\server\file.asc'
WITH (FIELDTERMINATOR = '\t',
ROWTERMINATOR = '\n')
The last line of the file contains no data other than what looks like a ^z in some text editors...
Thanks for the info--I know very little about vb and recordsets. If I wanted to go a step further and lets say one of the fields in the newly imported table is a date and I wanted to get the Min and Max of that field to add the statement the table contains services ranging from "X" through "Y"...
This should be simple, but I can't seem to figure it out. I have a command button that kicks off some steps to import a text file. After the file is imported, I then want to query the table to get a count of the number of records in the table and display that count in a message box to the...
I have an inherited table that is going to be used for reporting (will not be updated). It contains over 150 columns. In each of the columns a row might have a "real" value, but could also have a blank or null. I would like to set each of the blank values to null. I can do that with the...
I've inherited a rather large table that has several columns which contain both blank and null values. The table is not updated, just reported against. For consistencies sake, I would like to set all of the blank values to null. Is there an easy way to do this?
Thanks
Thanks for the quick response. But a colleague asked me to try the following:
SELECT client.ClientID, client.StartDate, client.EndDate, services.ServiceDate, services.Service
FROM client INNER JOIN services ON client.ClientID = services.ClientID
WHERE services.ServiceDate BETWEEN...
Sorry if this is simple, but I’m struggling. I have a table called services that contains service data (million+ records) and it has the following columns: ClientID, Service Date, and Service. I’ve been given a second table that contains the same ClientID and has two additional fields: Start...
TR,
C was most helpful. Adding the '01' and keeping the resultant field a date escaped me as I tried manipulating the varchar result in such a way that I could sort it as if it were a date. The index suggestion is also good, but in this case my lower end server still chugs away for a couple...
TJRTech,
Thank you. This is exactly what I was looking for. I don't mean to suggest more work, but it seems like a perfect "FAQ" topic.
Thanks again,
Nick
Thanks,
The styles do not cover it, but your second option worked. I did have to switch it to yyyy/mm to maintain the "sortability", but it does the trick.
I have a table that contains a couple of million records. The records are individual services provided by a couple hundred service providers. Most of what I need to review (the table is updated on a weekly basis) revolves around monthly service totals for each of the providers. An example of...
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.