PDA

View Full Version : انتساب دیگر کار نمیکند!!!



saed2006
جمعه 28 فروردین 1388, 12:37 عصر
با سلام
دستور


CREATE TABLE #MyTempTable ([CodeBolokk] char(7) not NULL,
[CodeMabarr] char(12) not NULL,BaiganyID smallint not null)
select CodeMabar from BolokMabar where CodeBolok=#MyTempTable.CodeBolokk

خطای


The multi-part identifier "#MyTempTable.CodeBolokk" could not be bound.

علت را در چه میدانید؟

Saber_Fatholahi
جمعه 28 فروردین 1388, 13:04 عصر
دوست من برای انتساب این قالبشه خودت مقایسه کن

-- SELECT First 30 records in to Temp table
SELECT TOP 30 * INTO
#TEMP
from Customers
ORDER BY CompanyName ASC
--Select Bottom 10 records in another temp table
SELECT TOP 10 *
INTO #TEMP2
from #Temp
ORDER BY CompanyName DESC
-- GET THE RECORDS
SELECT * FROM #TEMP2
این لینک ها هم جهت مطالعات بیشتر
لینک 1 (http://www.codeproject.com/KB/database/PagingResults.aspx)
لینک 2 (http://social.msdn.microsoft.com/Search/en-US/?query=temp%20table&ac=8)
لینک 3 (http://www.sqlteam.com/article/server-side-paging-using-sql-server-2005)