Problems Correcting SQL Scripts

Apr 16, 2008

Guys l am having problems correcting the following SQL scripts ,kindly assist.


1.
create table TimeCardHours
(TimeCardDetailID int IDENTITY (30000,1)CONSTRAINT pkTimeCardDetailID PRIMARY KEY CLUSTERED,TimeCardID int CONSTRAINT fkTimeCardID FOREIGN KEY (TimeCardID) REFERENCES TimeCards (TimeCardID),DateWorked datetime not null CONSTRAINT chkDateWorked (StartDate) CHECK (DateWorked > ProjectstartDate) REFERENCES Projects (StartDate),ProjectID int CONSTRAINT fkProjectID FOREIGN KEY(ProjectID) REFERENCES Projects (ProjectID),WorkDescription varchar (50),BillableHours int CONSTRAINT chkBillableHours CHECK(BillableHours > 0),TotalCost money CONSTRAINT chkTotalCost CHECK(BillableHours * BillingRate for the employee to whom the time card is issued),WorkCodeID int CONSTRAINT fkWorkCodeID FOREIGN KEY (WorkCodeID) REFERENCES WorkCodes (WorkCodeID))


2.

create table TimeCardExpenses
(TimeCardExpensesID int IDENTITY (70000,1)CONSTRAINT pkTimeCardExpensesID PRIMARY KEY CLUSTERED,TimeCardID int CONSTRAINT fkTimeCardID FOREIGN KEY (TimeCardID) REFERENCES TimeCards (TimeCardID),ExpenseDate Datetime not null CONSTRAINT chkProjectEndDate (EndDate) CHECK (ExpenseDate < ProjectEndDate) REFERENCES Projects (EndDate),ProjectID int CONSTRAINT fkProjectID FOREIGN KEY(ProjectID) REFERENCES Projects (ProjectID),ExpenseDescription varchar (50),ExpenseAmount money CONSTRAINT chkExpenseAmount CHECK(ExpenseAmount > 0),ExpenseCodeID int CONSTRAINT fkExpenseCodeID FOREIGN KEY (ExpenseCodeID) REFERENCES ExpenseCodes (ExpenseCodeID))

View 5 Replies


ADVERTISEMENT

Correcting Server Name In Access Link To SQL Database

Jan 9, 2008

I'm not sure if this is the proper place to post this question but thought I would start here.

I have an Access link to live SQL data. We have since migrated to a new physical server and new logical server name.

My question then is, how can I edit the pre-existing Access link to the live SQL data/database and make changes so that the new server is taken into consideration?

Thanks in advance.

View 1 Replies View Related

Correcting Invalid Dates From A Text File Before Loading SQL Table

Apr 8, 2008

Each month we process 100+ text files into our ERP system. Occasionaly the Voucher Date in the text file does not contain a valid date. I would like to check to see if it is a valid Date, if it isn't replace it with the current date.

I thought I would use a Derived Column transformation, but I don't know how to check a field to see if it is a valid date.

Can anyone help?

Thanks,

Jeff

View 3 Replies View Related

SQL Server Admin 2014 :: Correcting Server Connection In Maintenance Plans?

Aug 11, 2015

In SQL 2008 R2, if we clone an environment including SQL server, the maintenance plans retain a connection string to the source/original server they got cloned from and are not editable. But, I was able to use a work around by editing them in BIDS and saving them back on the server. But now with 2014, I am facing two issues:

1.I still can edit the package to correct the server connection, with SSDT; but the option to save back to the server is not available any longer!

2.I used to be able to see all my plans under SSIS in 2008 R2 but not in 2014 now. Although, they are listed in SSMS!

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved