,而試圖在SQL Server中執行我不斷收到一個錯誤:SQL語法不正確,當試圖CREATE PROCEDURE
消息156,級別15,狀態1,過程sql_chp4a_premiere_assign,5號線
附近有語法錯誤的關鍵字'SELECT'。
我假設它指的是第一個SELECT
。我對SQL還不是很熟悉(以及由於可怕的風暴和Spring Break而暫時沒有上課),所以這可能是我忽略的一些愚蠢的東西。
USE [school username that gives out my name)
CREATE PROCEDURE sql_chp4a_premiere_assign
SELECT PART_NUM,DESCRIPTION,PRICE
FROM PART;
SELECT *
FROM ORDERS
SELECT CUSTOMER_NAME
FROM customer
WHERE CREDIT_LIMIT>=10000;
SELECT ORDER_NUM
FROM ORDERS
WHERE CUSTOMER_NUM = '608'
AND ORDER_DATE = '2010-10-23';
SELECT CUSTOMER_NUM,CUSTOMER_NAME
FROM CUSTOMER
WHERE REP_NUM=35 OR REP_NUM=65;
SELECT PART_NUM,DESCRIPTION
FROM PART WHERE CLASS!='AP';
SELECT PART_NUM,DESCRIPTION,ON_HAND
FROM PART
WHERE ON_HAND BETWEEN 10 AND 25;
SELECT PART_NUM,DESCRIPTION,ON_HAND
FROM PART
WHERE ON_HAND>=10 AND ON_HAND<=25;
SELECT PART_NUM,DESCRIPTION,(ON_HAND * PRICE)
AS "ON_HAND_VALUE"
FROM PART WHERE CLASS='SG';
SELECT PART_NUM,DESCRIPTION,(ON_HAND * PRICE)
AS "ON_HAND_VALUE"
FROM PART
WHERE (ON_HAND * PRICE)>7500;
SELECT PART_NUM,DESCRIPTION,(ON_HAND * PRICE)
AS "ON_HAND_VALUE"
FROM PART WHERE (ON_HAND * PRICE)>7500;
謝謝,我真的很感謝任何幫助。
這個錯誤是因爲你錯過了'AS' - [文件](http://msdn.microsoft.com/en-us/library/ms345415.aspx)。其次,這個片子選擇了很多,但卻無所作爲。 – 2013-03-26 02:38:43