how would it work with this one? I tried adding the except clause to the bottom but SQL doesn't like it on this statement.
INSERT INTO Product_SpecificationAttribute_Mapping
(ProductId, SpecificationAttributeOptionId, AllowFiltering, ShowOnProductPage, DisplayOrder)
SELECT Product.Id AS...
I've been racking my brain on this and after several google searchs and attempts I can not get this to work. Basically the statement works fine but I want to run it daily and do not want it duplicating the results if they already exist in the table. Let me know if you guys can help me figure...
So I'm not sure what happened but I built a windows server 2012 standard running a web server. Sent it to the data center and everything worked great for 6 months or so. One day it wasn't live so I remote booted it and ever since I've been missing a lot of functions and have been resorting to...
Thank you for your response. Unfortunately I am not extremely savvy on SQL statements and my knowledge in that subject doesn't get much further than basic inner joins. I googled case statement syntax but am still lost...
Ok basically what this statement is doing is going through all product names in the product table and finding the years and inserting them into a product specification attribute table. The tricky part is the products are all listed like this:
Exhaust system for 92-95 Honda Civic.
The...
Hello,
I have SQL Server 2012 and I can not for the life of me to get this to remotely connect via ODBC or other. I have disabled the firewall, enabled the TCP and Named Pipes in the SQL Server Manager as well as enabling the Remote Connection check box in SSMS. I made sure the SQL Server...
Hey long time to talk haha. So I just discovered yesterday that this statement is leaving something out. For all products that begin with the year 2000 such as 00-04 it does not input the year at all for any of the years. However 01-04 will work just fine. Turns out this affects 4200...
Ok I changed it and it executed successfully but all of the results are not correct. Here is an example of what the product name was:
Exhaust System 99-03 Mazda Miata MX5
and it returned 10 results for that one product which were:
2003, 2002, 2001, 2000, 1999,
2000, 3200, 4000, 4200, 5000...
With this script it shows all the problem cars as I listed above however it shows 1990, 91,92,93,94,95,96,97,98,99 for some reason? All the years in the attribute name are in four digit format but there are over 250 conflicts with car models that have numbers in them.
select *
from...
Ok I see what its doing. In the Name Attribute it lists everything i.e.
1999
1998
Toyota
Tercel
240SX
Nissan
2000
2001
Since the design of the site just applies the attribute id to the products. I guess we need some sort of WHERE clause that finds only years from 1900-2099. I would just say...
When I run that whole script the syntax is good but once executed it fails with this error:
Msg 245, Level 16, State 1, Line 1
Conversion failed when converting the nvarchar value 'SX' to data type int.
Ok I figured out the problem. It was the double )) in the third statement which just needed to be one ). It returned results that look like:
id, name, ymin, ymax
53842, blah blah car 85-90 Chevy blah blah, >85<, >90<
So it looks like we are on the right track here! :) I scrolled...
That statement has a few errors. Id and Name are underlined from the first Select statement saying invalid column name. Line two name, loc is underlined. Line three just name is underlined. and the very last line with ) as rng the as is underlined.
Alright I removed all the extra dashes from the database so the only occurrence would be in the year form i.e. 99-04. I ran the select statement but I am receiving this error:
Msg 245, Level 16, State 1, Line 1
Conversion failed when converting the nvarchar value 'SX' to data type int.
I...
Ok this is way over my head lol. To answer your questions there should only be one dash in every product for the year range. The table Product does have an key field which is Product.Id
I copied the sql statement into sql server and before I could execute it there were a few things underlined...
It is stored as nvarchar(max). Yes that code looks good but there is one thing missing that I need it to do. The SQL Statement will pick out the 99 and the 03 from 99-03 however I need to have it somehow recognize that it needs to do it for 00 and 01 and 02 as well since it is a range 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.