Usually that is a data issue, one of the fields in the results set contains a value that can't convert. This one reason why you don't store things like dates or number in varchar or nvarchar fields because bad data gets into them.
And why are you using real datatype when the comments clearly...
I want to caution you about using views as sources for other views. These can end up being extremely slow becasue they cannot be indexed past the first view and have to generate the entire view each time. We had some ill-advised developers who used this techinique throughout one of our datbases...
I don't know why you are getting the error as your query appears to be syntactically correct, but correlated subqueries are a very bad query technique and should almost never be used. Replace it with a join to a derived table and who knows it might fix your problem (since removing it seems to...
IIF can also be replaced with the CASE Statement if you are doing more than just checking for nulls. And Coalesce might help in other statements as well.
"NOTHING is more important in a database than integrity." ESquared
I almost fell out of the car yesterday when I saw:
SLAM BAM
How did that one ever pass?
"NOTHING is more important in a database than integrity." ESquared
I've worked in both and while government work is usually less flexible (flex time is harder to come by for instance), I have not found many of the other myths about government employment to be true.
First, yes government agencies fire people and yes sometimes they fire the wrong people and...
If one of your fields is a PK, it is already indexed, but Fks are not, so you need to make sure that one is indexed as well.
"NOTHING is more important in a database than integrity." ESquared
A name is worth 1,000 pictures
You're treading on thin water
Let's make sure we have our Ps and Qs crossed
The whole idea of doing this opens up a huge can of Pandora's box
"NOTHING is more important in a database than integrity." ESquared
OK let's start by running this while profiler is running and send us the real SQL that SQL Server will run, I can't make heads or tails out of this.
One thing though that you desperately need to do to make this make sense is to get rid fothe implied joins. Implied joins combined with explicit...
update c
set coordinator= x.coordinator
--select c.coordinator, x.coordinator
from ##Xref x
join Claim c (nolock)
on ?
join iwlocation (nolock)
on fkiwlocation = pkiwlocation
join injuredworker iw (nolock)
on fkinjuredworker = pkinjuredworker
where fkemployeraddress = 47556...
The only thing I use cursive for is my signature. I don't miss it. When I handwrite, I print. I do a daily journal entry by hand and write the occasional check and sign the occasional document and that is all the handwriting I do. Very few young people I know even have checkbooks. They do...
Maybe the duplicate is comeing from the second insert not the union which was inserted as part of the selct into? Whatever the second insert is doing may be adding more records that already exist (and why don't you have the proper unique constraints?)
"NOTHING is more important in a database...
Try:
UPDATE
SET new_lead='y'
FROM client_testc
LEFT OUTER JOIN lead_infoc
ON client_testc.First_Name=lead_infoc.fname
AND client_testc.Address1=lead_infoc.address
AND client_testc.City=lead_infoc.city
AND client_testc.State=lead_infoc.state
WHERE...
Have you tried going to the 2008 database and doing an import? SQL Server 2000 may not properly recognize a 2008 database.
Further you don't import and export views, you import and export the tables involved inthe views. Views are just queries not data.
"NOTHING is more important in a database...
Beacause they were written by application programmers and not database specialists.
But trust us, any database specialist will tell you of the problems caused (that are VERY hard to fix) by this poor practice of enforcing things only in the application. The database will probably outlive the...
You should never use GO in a stored proc, that ends the batch and therefore the proc.
"NOTHING is more important in a database than integrity." ESquared
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.