I am trying to export a csv file using bcp but get: Unable to open BCP host data-file
My sproc does not return any error and does not create the file so i tried the bcp part in DOS and got the above error. I have checked the permissions.
To execute the below sproc I use
shrExportData...
I need to create an automated process in SQL Server 2005 which will export about 18 files every night (via a SQL job). I have not worked a lot with DTS not to mention SQL 2005. Any help will be greatly appreciated. I don't even know where to start.
Here is the problem:
I need to find out a list of Employees who have a benefit record with an end date of 12/31/2006 AND have a benefit record starting 1/1/2007 AND Had dependents enrolled in the 12/31/2006 record BUT do not have those dependents enrolled in the 1/1/2007 record.
(My client...
I am selecting data from 3 different tables:
tEmp:(PersonID,FullName)
tBenefitHist:(PersonID,BenefitID,BenefitStartDate,BenefitEndDate,PlanCode)
tContributionHist:(PersonID,BenefitID,ContributionStartDate,ContributionEndDate,EmployerAmount)
I need to SUM the employeramounts(from...
In my query I need to include all the records for a Person that fall between today and two weeks back. The table I am selecting records from has just one date field - PeriodStartDate
Appreciate any help
I had converted some records in a SQL Server database - now I need to assign their ID fields numbers starting from 3100 to 3999. I know I have to do the Select part but how do I start numbering them ? and stop at 3999.
Update Tbl_Emp
SET EmpID = ?????????????????
WHERE EmpID = NULL
Appreciate...
I need to combine two rows if the status code of the second row is Terminated:
PID StartDate StatusEndDate Status
1234 5/16/2001 ACTIVE
1234 1/14/2005 TERMINATED
5678 3/16/2002 ACTIVE
5678...
My select statement:
SELECT RIGHT('00000000'+ CONVERT(varchar(8),CONVERT(numeric(8,4),(21630 * 0.00120192))),8)
gives the result of 025.9975
How do I make it round up so that I get 26.00 ?
How do I update a table to group or sort the data in it?
I have a table tblEmpDep it lists all the employees and their dependents. I want to update this table so that the data is now grouped by EmpSSN or Order by EmpSSN.
any ideas ?
I am working on a web application where I hire someone email address should automatically get created.
I need to create a java script page that would have a function to basically create email addresses on the fly for the users.
So 4 employees get hired in the following order - John Smith, John...
I have a select statement that selects some data from different tables. I need to select the most recent of the foll fields: PerformedDate,EmptblPerformanceStartDate,EmptblPerformanceEndDate as even though an emp may be active but his performance may have ended a month back.
My Select statement...
i need to create a view that lists all the Supervisors with their employees. I have half of it ready where I can list the
Supervisor, SupID, SupStatus,EmpID,EmpName,EmpStatus,Job,Dept...
so this is how the result looks:
Supervisor SupID SupStatus EmpID EmpName...
Hi, I need to convert data in a table, firstname, middlename, lastname address etc to mixed case. eg:If the first name = SAM ADAMS then it should be Sam Adams. If the Address is APT# 2345 then it should be Apt# 2345.
I can't seem to find the sql function. How should I do it ?
Thanks in advance.
I have created a crystal report which renders it's data from a stored procedure. The stored proc. resides on my machine (localhost) and i have tested the connections.
However, when i try to view the report in CrystalRepoprtViewer on my ASP.Net page, i get a "Logon Failed" error. My...
Hi,
I have to Calculate the average monthly salary and the Bonuses over the prior 3 months. Table1 has the Annual Salaries of Emps and is historical and Table2 has the Bonuses of the Emps and is NOT historical as an emp can have more that one bonus records.
What is the best way to do this ?
Any...
I have to create a trigger on a table T1. This table has 3 fields. PersonID, StartDate and EndDate.When the user enters the StartDate the EndDate should automatically be calculated as 3 months from the StartDate. Any ideas ?? This is what I had, it does not do anything not even an error:
IF...
I need to specify in a function that if the value entered by the user is less then 6 digits then add 0's in front.
The function gets called when the user hits a button from the front-end.
This is the code I have so far...
function NextJobID()
{
var sSQL = "EXECUTE sp_JobValue...
I need to Update the _PersonTemp table with AnnualSalaries. The annual salary calc is different for some emps. So I have to take both kinds into consideration. But my update Annual Salary works only one at a time. How can I combine the calcs.( the Update annual Salary part are further down...
I need to take over all the records from a history table which has code,description,StartDate, EndDate fields in it to a new table which has code,description fields in it. I need to take over only the records with the most current dates.
INSERT INTO tNewTable(Code,Description)
SELECT...
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.