2016-03-24 11 views
1

Ich habe die Zip-Datei herunterladen, die die gespeicherte Prozedur für dbo.Chart von der Website enthalten HereFehlerdatentyp varchar Umwandlung für gespeicherte Prozedur schweben

ich speichern sie in die gespeicherte Prozedur unter Programmierbarkeit haben.

EXEC dbo.Chart 

'SELECT Sales, 
x_axis, y_axis 
FROM Seed_Number1CoupleIn'; 

My X-Achse ist (Int), während die Y-Achse ist varchar Umsatz int.

Aber wenn ich versuche, den folgenden Code ausführen, bekomme ich diesen Fehler:

Msg 8114, Level 16, State 5, Line 1
Error converting data type varchar to float.

Meine gespeicherte Prozedur dbo.Chart 500 Zeilen hat, also wenn ihr mich verlangen hier hochladen ich werde es tun.

Antwort

1
zu schweben ändern

die link Formular, werden sie über den Datentyp eindeutig dokumentiert:

Making Charts from Your Own Data

To turn your own data into a line, column, area, or bar chart using the Chart stored procedure, you need to design a SELECT query that serves as the first parameter in the stored procedure call. The SELECT query needs to retrieve data from three columns. The first column needs to provide the series names. Typically, they're text strings, but you can use any data type that's implicitly convertible to a string (e.g., int). The second and third columns need to provide numeric values for the X axis and Y axis, respectively. We recommend using the FLOAT data type.

For example, if you have a table named Sales with the FiscalYear, ProductCategory, and TotalSales columns, you could make a line chart with this call:

EXEC dbo.Chart 
'SELECT ProductCategory, 
FiscalYear, TotalSales 
FROM Sales'; 

So müssen Sie die x_axis, y_axis als FLOAT statt VARCHAR und int

passieren
1

Es ist auf der Website geschrieben, dass Ihre Daten in FLOAT sein sollten.

Charts von Ihren eigenen Daten zu machen

hier ist genau Linien von der Website .... dbo.chart site

So haben Sie Ihre X- und Y-Achsen-Spaltendatentyp