Nested Table Concept In SQL Server
May 8, 2004
Hi all,
What is the equivalent for Oracle's nested table concept in SQL Server ?
Is there anything like TABLE( ) function to select from nested table as in Oracle ?
Eg in Oracle :
SELECT t.* FROM TABLE(nested_table_datatype) t;
( like the above query used in Oracle PL/SQL and 'nested_table_datatype' is a table datatype created in Oracle using 'create type ...' syntax )
Please give the equivalent for above...
Thanks,
Sam
View 2 Replies
ADVERTISEMENT
Jul 20, 2005
Before going in to details i like to understand more about concept anddesign of this database. Most books go directly in to details.Please, can a current admistrator gife me information on this?Thanks in advance,Dick vd Spek email: Join Bytes!
View 1 Replies
View Related
May 11, 2015
I tried samples of FileTable in SQL Server 2012 to store files in database. I have following questions.
1. When I right click on FileTable, and say Explore File Table Directory, I was taken to a directory. But if I search the same directory in my server/machine, the directory is not available.
2. Can I use some external server/disk as a directory for FileTable?
3. How easy is to use FileTables using .Net web applications?
View 2 Replies
View Related
Jun 6, 2007
Hi.Like in subject. I know the varray and nested tables from oracle, and I'm trying to implement them in sql server. I've been googling for any information but with no result. Can somebody direct me ??Sorry for any english mistakesThanks for help
View 2 Replies
View Related
May 26, 2007
Hello,
Quick question, I hope, I am trying to create a table that has a column that is a nested table in SQL Server 2005 Express Edition. Any ideas how I could go about doing this?
Sincerely,
James Simpson
Straightway Technologies Inc.
View 4 Replies
View Related
May 20, 2008
I've only been doing sql 2005 for a couple of months with minimal training so there's a lot I don't know.
What I'm trying to do is load a nested table (industry & customer totals) based on a value from the table it's nested in.
This is the relationship of the data.
I have at the highest group, an industry code, then a customer, then the part and then the fiscal year.
What I'm trying to accomplish is to get a group total (footer) for the (1) industry code and (2) the customer code. This footer would contain the fiscal years (ascending) and their monthly totals. I would like to take the industry code from table one and pass it to the select statement in the dataset that feeds the nested table. I've read this is not possible to load a dataset field into a parm but I've seen where some people know how to work around this. If you reply, please explain in simple terms. Thanks!
industry Customer Year OCT NOV DEC
001 - Signposts
M12345
Part 1
2006 5 6 2
2007 0 3 1
Part 2
2006 4 3 0
2007 1 0 7
Customer M12345 totals
2006 9 9 2
2007 1 3 8
M45678
Part 3
2007 8 4 7
2008 3 4 8
Part 4
2006 3 8 7
2007 5 6 6
Customer M45678 totals
2006 3 8 7
2007 13 10 13
2008 3 4 8
Industry 001 totals
2006 12 17 9
2007 14 13 21
2008 3 4 8
View 1 Replies
View Related
Apr 15, 2008
Hi Friends,
Can anybody help in introducing the YTD Concept:
My Table[ Monthly_Highlights_tb ] schema should contain like below:
[Month] [Base_Amount] [YTD]
APR-07 1000.00 1500.00
APR-07 500.00 1500.00
MAY-07 2000.00 3500.00
jUN-07 5000.00 8500.00
WHEN I run the below query:
UPDATE t
SET t.ytd = (SELECT SUM(q.base_amount) FROM Monthly_Highlights_tb q WHERE q.[month] = t.[month] AND q.[month] <= t.[month])
FROM Monthly_Highlights_tb t
output is coming as:
[Month] [Base_Amount] [YTD]
APR-07 1000.00 1500.00
APR-07 500.00 1500.00
MAY-07 2000.00 2000.00
jUN-07 5000.00 5000.00
cAN anybody correct the query?
View 1 Replies
View Related
May 30, 2007
Hi, all experts here,
Thank you very much for your kind attention.
I am trying to create a new mining structure with case table and nested table, the case table (fact table) has alread defined the relationships with the nested table(dimension table), and I can see their relationship from the data source view. But why the wizard for creating the new mining structure showed that message? Why is that? And what could I try to fix it?
Hope it is clear for your help.
Thanks a lot for your kind advices and I am looking forward to hearing from you shortly.
With best regards,
Yours sincerely,
View 4 Replies
View Related
Jul 13, 2006
What are some strategies in categorizing items?
View 4 Replies
View Related
May 15, 2008
Hi all,
Please let me know the details of the following.
1.What is Multi-Threading?
2. How it is useful to increase the Performance of a SQL query.( How it is useful
in Optimizing the query.
3. How we'll use MultiThread concept in Partitions and Using Processors.( For Eg.. If I want to use MAX threads=14 and 16 processors in this situation how we use PArtition concept and how it will improve the bufffer size of the CPU)
Thanks in advance
View 6 Replies
View Related
Oct 2, 2007
The distinction between Entity and Relationship is obvious to me. But I am confused by Table. Table describes Entity, Relationship, or both?
Thanks for any input.
View 9 Replies
View Related
Jul 6, 2015
what is the concept of smart backup in sql ?
View 1 Replies
View Related
Feb 7, 2006
i would like to know where can i find information on the concept of SQL like Base Table , View Table and Search Table as now i am using VS.Net 2005 and SQL Server 2005 to write a addressbook program and i am just a newbie to Sql and c#... i wish to write my sql commands in c# side before passing it into sql and may i know how to do it?
View 20 Replies
View Related
Jun 5, 2007
Hi, all here,
As we are allowed to select one table as both case table and nested table, however what is the benefit of using one table as both case table and nested table? Thanks in advance for your advices.
I am looking forward to hearing from you shortly.
With best regards,
Yours sincerely,
View 3 Replies
View Related
Jun 6, 2007
The below code is ASP 1.0 to dynamically search a database and I want to use the same concept for a ASP.Net 2.0 solution. Do I do this in the code behind or on the aspx page and if on the aspx page what controls do I use for the array split? Basically where do I start. It took me a long time to get this old code working, I am hoping it is simpler in 2.0.
Thank you
OLD ASP 1.0 code to dynamically build a Sql Select statement for searching a database using one or more search words entered by user.
If Request.Querystring("kwdSearch") <> "" ThenDim kwdString, ArrKwdString, iCountiCount = 0 kwdString = Replace(Request.Querystring("kwdSearch"), "'", "''")ArrKwdString = Trim(kwdString)ArrKwdString = Split(kwdString, " ",-1,1) For iCount = 0 to UBound(ArrKwdString) If iCount < UBound(ArrKwdString) Then Criteria = Criteria & "tblLinkInfo.L_Keywords LIKE '%" & ArrKwdString(iCount) & "%' AND " Else Criteria = Criteria & "tblLinkInfo.L_Keywords LIKE '%" & ArrKwdString(iCount) & "%' " End ifNext RS.Open "SELECT * FROM tblLinkInfo Where (" & Criteria & ") AND L_Enabled = 1 ORDER BY " & SortBy & "L_Rank", CNN, 3 If RS.EOF Then If Rs.State Then RS.Close RS.Open "SELECT * FROM tblLinkInfo WHERE L_Description LIKE '%" & Replace(Request.Querystring("kwdSearch"),"''","'") & "%' AND L_Enabled = 1 ORDER BY " & SortBy & "L_Rank", CNN, 3 End If
RESULTS --- Display results with Repeater1.DataBind(); etc
Exit SubEnd If
View 3 Replies
View Related
Apr 2, 2004
Hi
I am involved in a product development and want to understand the current best practices from the conception to product rollout. I have few questions. Appreciate your help and suggestions
Our project in a nutshell: Our team has developed the apps. using GUI-Oracle Forms & DBMS-Oracle 8i/9i with weblogic, Corba, windows 2000 server environment. It’s meant for 1000s of users with million of data. We are trying to integrate additional services/capability - messaging (wireless, chat etc.). As per the initial plan we have a central database and users will be using a local footprint database. The deltas (the changes) will be synchronized with the central database at a frequency say daily or nightly... We are concerned that having the database at the users desktop could leave the door wide-open for others to take a look at our code/design...
Questions:
1. UML case tools-- What’s the best tool available in the market as we want to revisit the design phase and identify the things that have been missed out in the prototype-(which was developed by a third-party)?
So far we have used ERWIN to extract the data model...
2. How can we eliminate the need to have a local footprint database at the users desktop.?. Since there is a lots of data, retrieving the data via internet could be very slow for users? (hope this is the case!) That’s what led our team to think of having a local database at the users desktop. Someone suggested to use the data files or caching the data.. Appreciate if anyone shed some light on this.. Is there a better way to do it?
3. Client connectivity: What are the softwares needed at the users PC. Since we use Oracle Forms to develop the application, do we need to install the oracle clients at the users PCs? how to establish the connectivity from the Users PC to our server and to the database. IF we have to use the oracle client, does that require licenses for every User? What do we need to consider from the network connectivity stand point.
4. Application Rollout: how to package our finished product - application exe that is installable across wide array of environment. (we thought of install shield). how do we test it for accuracy etc.,
5. Database optimization: In addition to DBA help, is there any product or proceedures to ensure dataModel optimization, SQL query performance etc.,
Appreciate you sharing your valuable thoughts on this with us..
View 1 Replies
View Related
Jul 19, 2007
Why would someone choose to model a problem with a case and nested table versus just using a case tables with multiple rows?
For example, a simple customer and product scenario where you could say:
Mining Model DT_CustProd
(
[Id] ,
[Gender] ,
[Age]
[Products] Predict
(
[ProductName] ,
[Quantity]
)
)
But you could also model as:
Mining Model DT_CustProd
(
[Id] ,
[Gender] ,
[Age]
[ProductName] Predict,
[Quantity] Predict
)
and just insert multiple rows per Id/Gender/Age? Is there any rule of thumb to use here when deciding to model with a nested table?
I understand that a nested table essentially pivots the data (http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=408840&SiteID=1) and the data becomes an attribute, but how do you know if you want that, or you want the data as a value of an attribute?
View 3 Replies
View Related
May 17, 2006
Hi, all here,
I have a question about nested table use. I dont quite clearly see through why the nested table is very much necessary? I mean if we need information from both the current case table and nested table for mining models, we can just join both tables?
Thanks a lot in advance for any guidance and help.
View 4 Replies
View Related
Dec 6, 2005
Dear all,I have table called CATEGORY, which is defined as follows:CREATE TABLE CATEGORY(CATEGORY_ID INTEGER IDENTITY(1,1) NOT NULL,CATEGORY_NAME VARCHAR(40) NOT NULL CONSTRAINTUC__CATEGORY__CATEGORY_NAME UNIQUE,PARENT_CATEGORY_ID INTEGER,CATEGORY_ICON IMAGE,DEPTH INTEGER,CONSTRAINT PK__CATEGORY PRIMARY KEY (CATEGORY_ID))Supposly, the following snap shot was taken later:================================================== ============| CATEGORY_ID | CATEGORY_NAME | PARENT_CATEGORY_ID | DEPTH |================================================== ============| 1 | PC | NULL | 1 |--------------------------------------------------------------| 2 | Networks | 1 | 2 |--------------------------------------------------------------| 3 | Audio | 1 | 2 |--------------------------------------------------------------| 4 | Video | 1 | 2 |--------------------------------------------------------------| 5 | TV Cards | 4 | 3 |--------------------------------------------------------------| 6 | Graphics Cards | 4 | 3 |--------------------------------------------------------------| 7 | AGP | 6 | 4 |--------------------------------------------------------------| 8 | PCI | 6 | 4 |--------------------------------------------------------------| 9 | Input Devices | 1 | 2 |--------------------------------------------------------------and I'd like to create out of this hierarchy the following desired XMLfile:<?xml version="1.0" encoding="utf-8" ?><Hardware><Catgeory name="PC" id="1"><Catgeory name="Networks" id="2" /><Catgeory name="Audio" id="3" /><Catgeory name="Video" id="4"><Catgeory name="TV Cards" id="5" /><Catgeory name="Graphics Cards" id="6"><Catgeory name="AGP" id="7" /><Catgeory name="PCI" id="8" /></Category></Category><Catgeory name="Input Devices" id="9" /></Catgeory></Hardware>The reason for this file is that it will be a datasource of theTreeView Control new in asp.net 2.0.Now, programmateiclally using C#.net i started using the XmlDocument,XmlTextWriter and XmlTextReader Namespaces and started using susingrecurrsion to genearete this desired XML file out of the records in thesnapshot, but ...Is there an easy way of doing this using SqlServer 2005 with the newdatatype XML?*Any hint would also be ok*Best regards
View 12 Replies
View Related
Mar 1, 2007
Hey gang,
I'm having some issues with nested table. This is my setup. [ProductTable] is the case table, and [CustomersTable] is a nested table. I'm trying to organize my algorithms around products.
[ProductTable]<---[CustomersTable]
[ProductTable] table only has product ID, and it is key.
[CustomersTable] table has variety of customer attributes (productID, customerID, location, demographics...) and CustomerRevenue is predict_only. ProductName is the key for the nested table.
I keep getting this error when I'm processing the mining models (Logical Regression and Neural Net).
Error (Data mining): In mining model, Estimate Neural Net, the algorithm does not allow table column as predictable.
Error (Data mining): Error validating attribute for the 'Estimate Neural Net' mining model.
When using Decision Tree, it processes OK, but the result is totally wrong. The model is empty.
Any ideas?
-Young K.
P.S. I'm trying to great a single model for multiple products. This is a label saving device that I'm trying. If this doens't work, I'll have to create a model for each product.
View 5 Replies
View Related
Sep 14, 2006
Hi Guys
Am new to sql, and I wold appreciate help with optimising the folloing example. The result of the example should be to list a result with details of the Column names:
OPBal| Receipt| IssTrns| Transfer| ClBal
SELECT dbo.inventory.location, dbo.inventory.itemnum,
(select sum(dbo.matrectrans.linecost) where dbo.matrectrans.issuetype LIKE 'RECEIPT' ) As Receipt,
( select sum(dbo.matrectrans.linecost)where dbo.matrectrans.issuetype LIKE 'TRANSFER' ) As Transfer,
( select(dbo.IST_ITEMDETAIL.curbal*dbo.IST_ITEMDETAIL.avgcost)where dbo.IST_ITEMDETAIL.logdate='2006-07-20' ) As OpBal,
( select (IST_ITEMDETAIL.curbal*IST_ITEMDETAIL.avgcost)where IST_ITEMDETAIL.logdate='2006-08-21' ) As ClBal,
( sum(matusetrans.linecost) ) As IssTrnf
FROM dbo.matrectrans, dbo.matusetrans, dbo.IST_ITEMDETAIL , ( dbo.inventory inner JOIN dbo.item
ON dbo.inventory.itemnum = dbo.item.itemnum AND dbo.inventory.orgid = dbo.item.orgid )
WHERE dbo.inventory.location = dbo.matusetrans.storeloc
AND dbo.inventory.itemnum = dbo.matrectrans.itemnum AND dbo.inventory.siteid = dbo.matrectrans.siteid
OR dbo.inventory.location = dbo.matrectrans.tostoreloc AND dbo.inventory.itemnum = dbo.matusetrans.itemnum
AND dbo.inventory.siteid = dbo.matusetrans.siteid OR dbo.inventory.location = dbo.matrectrans.fromstoreloc
OR
dbo.inventory.location = dbo.ist_itemdetail.location AND dbo.inventory.itemnum = dbo.ist_itemdetail.itemnum
GROUP BY dbo.inventory.location, dbo.inventory.itemnum,dbo.matrectrans.issuetype,(dbo.IST_ITEMDETAIL.curbal*dbo.IST_ITEMDETAIL.avgcost),
dbo.IST_ITEMDETAIL.logdate,dbo.IST_ITEMDETAIL.curbal,dbo.IST_ITEMDETAIL.avgcost
View 20 Replies
View Related
Jan 30, 2007
hi all,
i have speed issue on displaying 4k line of records using temp table.. before this it works fine and fast.. but maybe when i starts joining group by it loads slower.
SELECT DISTINCT customlotno, itemid, ItemName, Ownership, TotalCTNInPlt, TotalCarton, sum(CartonPcs) AS CartonPcs, StorageID, StorageStatus ,OriginUOM, PickQtyUOM, WhsID, WhsName, LocID, Zone, Expirydate, recvDate
INTO #ByItemID
FROM (
SELECT * FROM tblItemdetail
)AS L1
GROUP BY customlotno, itemid, ItemName, ownership, TotalCTNInPlt, TotalCarton, StorageID, StorageStatus ,OriginUOM, PickQtyUOM, WhsID, WhsName, LocID, Zone, Expirydate, recvDate
SELECT *
FROM #ByItemID
ORDER BY CustomLotNo
DROP TABLE #ByItemID
----------------------------
or maybe just use something like nested SELECT like this, but cannot work:-
select customlotno, itemid, locid(
select * from tblitemdetail
where customlotno='IN28606000'
) AS T
GROUP BY customlotno, itemid, locid
~~~Focus on problem, not solution~~~
View 12 Replies
View Related
Jan 9, 2007
I am running the DMX below and I am getting an error we I go to train my structure. It is probably something stupid but I do not see the problem. It seems like the SKIP isn't being recognized but I am not sure. Here is the error:
INSERT INTO error: The '[MSA].[HospitalID]' nested table key column is not bound to an input rowset column.
DMX:
CREATE MINING STRUCTURE [Hospital_Structure] (
[HospitalID] LONG KEY,
[SponsorshipTypeID] LONG DISCRETE,
[GeographicTypeID] LONG DISCRETE,
[CaseMixIndex] DOUBLE CONTINUOUS,
[PercentGovtPayers] DOUBLE CONTINUOUS,
[TotalNumberInpatientCases] LONG CONTINUOUS,
[MSA] TABLE (
[HospitalID] LONG KEY,
[MSAGroupMember] TEXT DISCRETE
)
);
GO
ALTER MINING STRUCTURE [Hospital_Structure]
ADD MINING MODEL [Hospital_Model] (
[HospitalID],
[SponsorshipTypeID],
[GeographicTypeID],
[CaseMixIndex],
[PercentGovtPayers],
[TotalNumberInpatientCases],
[MSA] (
[HospitalID],
[MSAGroupMember]
)
) USING Microsoft_Clustering;
GO
INSERT INTO MINING STRUCTURE [Hospital_Structure]
(
[HospitalID],
[SponsorshipTypeID],
[GeographicTypeID],
[CaseMixIndex],
[PercentGovtPayers],
[TotalNumberInpatientCases],
[MSA] (SKIP, [MSAGroupMember])
)
SHAPE {
OPENQUERY([localhost],'
SELECT
[HospitalID],
[SponsorshipTypeID],
[GeographicTypeID],
[CaseMixIndex],
[PercentGovtPayers],
[TotalNumberInpatientCases]
FROM
[dm].[vw_HospitalClustering_Inputs]
ORDER BY
[HospitalID]') }
APPEND
(
{OPENQUERY([localhost],'
SELECT
[HospitalID],
[MSAGroupMember]
FROM
[dm].[vw_HospitalClustering_InputsNested]
ORDER BY
[HospitalID],
[MSAGroupMember]')
}
RELATE [HospitalID] TO [HospitalID]
) AS [MSA]
Thanks in advance
View 1 Replies
View Related
Aug 2, 2006
If your prediction join is to a SQL datasource, you can easily write a SQL query which returns a nested table like:
SELECT
Predict([Subcategories],2) as [Subcategories]
FROM
[SubcategoryAssociations]
NATURAL PREDICTION JOIN
(SELECT
(SELECT 'Road Bikes' AS Subcategory
UNION SELECT 'Jerseys' AS Subcategory
) AS Subcategories
) AS t
What about if your datasource is a cube? Is there some special MDX syntax similar to the SQL syntax above? Or do you have to utilize the SHAPE/APPEND syntax as follows?
SELECT t.*, $Cluster as ClusterName
FROM [MyModel]
PREDICTION JOIN
SHAPE {
select [Measures].[My Measure] on 0,
[My Dimension].[My Attribute].[My Attribute].Members on 1
from MyCube
}
APPEND (
{
select [Measures].[Another Measure] on 0,
NON EMPTY [My Dimension].[My Attribute].[My Attribute].Members
*[Product].[Product].[Product].Members on 1
from MyCube
}
RELATE [[My Dimension]].[My Attribute]].[My Attribute]].[MEMBER_CAPTION]]]
TO [[My Dimension]].[My Attribute]].[My Attribute]].[MEMBER_CAPTION]]]
)
AS [My Nested Table] AS t
ON [MyModel].[Product].[Product] = t.[My Nested Table].[[Product]].[Product]].[Product]].[MEMBER_CAPTION]]]
View 7 Replies
View Related
Aug 28, 2007
I have the following table
Region Table
ID
ParentID
RegionName
RestaurantTable
ID
RestaurantName
RegionID
What i tried to do is count the number of restaurants by specific regionname. My current query is
Select RegionID, RegionName, count(*) as RestaurantNo
From Region Inner Join Restaurant
On Region.ID = Restaurant.RegionID
However I only get the results below
RegionID RegionName RestaurantNO
1 A1 0
2 A1.1 2
3 A1.2 1
4 A1.3 0
Where A1.1 , A1.2, and A1.3 are children of A1 in Region table
The result is not correct due to A1 should have 3 in RestaurantNo due to it contains A1.1 , A1.2 and A1.3
Could anyone help me to solve this problem.
Thank you
View 6 Replies
View Related
Oct 8, 2012
I have added some SQL to an Access form which updates the dbo_BM_Map table when the user hits the Apply button. There is a temp table with various fields, two being "Chapter_No" and "Initial_Mapping_Complete" which the update is based on.
I want this update to only apply to chapters that only have one name in the "Initial_Mapping_Complete" column. If a chapter has more than one then the update should ignore it. The attached screengrab shows you. The update should ignore chapter 19 as there are two people (Jim and James) in the Initial_Mapping_Complete field. Here is my code.
pdate dbo_BM_Map inner Join Temp_Progression_Populate
on dbo_BM_Map.Product_ID = Temp_Progression_Populate.Product_ID
Set dbo_BM_Map.Initial_Mapping_Complete = Temp_Progression_Populate.Initial_Mapping_Complete
Where dbo_BM_Map.Chapter_No = Temp_Progression_Populate.Chapter_No
And Temp_Progression_Populate.Initial_Mapping_Complete in
(Select count(Initial_Mapping_Complete), Chapter_No
from Temp_Progression_Populate
Group by Chapter_No
Having Count(Initial_Mapping_Complete) = 1)
View 2 Replies
View Related
Sep 11, 2007
Hi,
I have a query that is executing properly but i want to delete the results of the query. I am trying to do it but i am messing up somewhere in the syntax
Can anybody help me out with this problem?
Below is the query
DELETE FROM DPT_NEW_BINS WHERE(
Select BIN,LEFT(ACCT_NUM_MIN,16), LEFT(ACCT_NUM_MAX,16), ISO_CTRY_CD, REGN_CD ,PROD_TYPE_CD FROM DPT_NEW_BINS o
WHERE EXISTS (SELECT BIN,LEFT(ACCT_NUM_MIN,16), LEFT(ACCT_NUM_MAX,16), ISO_CTRY_CD, REGN_CD ,PROD_TYPE_CD FROM DPT_temp_NEW_BINS i
WHERE o.ACCT_NUM_MIN = i.ACCT_NUM_MIN AND o.ACCT_NUM_MAX = i.ACCT_NUM_MAX))
CAN SOMEBODY POINT OUT MY MISTAKE?
View 3 Replies
View Related
Sep 24, 2015
Is there any way to convert a bind variable, which is a list of integer or string values, to nested table in MS SQL Server. I am looking for something like
CAST in Oracle, which converts a varray type column into a nested table. Do we have something like this in SQL Server.
in Oracle:
SELECT CAST(s.addresses AS address_book_t)
FROM states s
WHERE s.state_id = 111;
I have read about Table valued Parameter, but I am looking for another solution.Â
View 4 Replies
View Related
Dec 14, 2007
Hi, I'm calling the cross validation SP like this
call SystemGetCrossValidationResults([V Product View Event],[V Product Event 1],4,500,'V Product View Event')
and I get this error:
Parsing the query ...
Error (Data mining): The attribute, 'V Product View Event', is not valid in the current procedure call because the attribute is not a PREDICT or a PREDICT_ONLY attribute for the model, 'V Product Event 1'.
Parsing complete
In my model 'V Product View Event' is a predictable attribute. It so happens that I'm using association rules. And 'V Product View Event' is a nested table (a TableMiningStructureColumn). Inside the 'V Product View Event' nested table I have a 'Product' ScalarMiningStructureColumn. Is there any way to call the SP with nested tables in models? I'm using SQL Server 2008 June CTP.
thanks,
Gustavo Frederico
View 1 Replies
View Related
May 15, 2015
I have been wrestling with the code all day to accomplish the following: I need to update a table based on values from another table. So far, I have been able to do the below:
DECLARE @LookUpTerm VARCHAR(25)
, @SearchCol VARCHAR(255)
, @LogonIDToProcess VARCHAR(50)
, @Matched CHAR
, @Cycle INT = 1
IF OBJECT_ID('tempdb..#Glossary','U') IS NOT NULL DROP TABLE #Glossary
IF OBJECT_ID('tempdb..#Employees','U') IS NOT NULL DROP TABLE #Employees
[code]...
View 7 Replies
View Related
Aug 31, 2006
hi
Here are the two tables again.
1)PATIENT(PATIENT_ID,NAME,CITY)
2) DISEASES(DISEASE_ID,NAME)
I am trying to select patient table as case and diseases table as nested to create an association model. i m getting following error.
Disease table cannot be used as a nested table because it does not have a many-to-one relationship with the case table. You need to create a many-to-one relationship between the two tables in the data source file.
i have created a relationship by dragging Disease_id from diseases table on Patient_id in patient table. when i am trying to select Patient_id as key, City as input, it is not showing disease_id to choose as a predict column.
please suggest me if i am doing anything wrong? i have not done any thing to do my datbase, just selected the tables i want to create an association model on and trying to create association model.
your help and insight is highly appreciated.
regards
Raju
View 4 Replies
View Related
Dec 10, 2007
Hi,
Referring to the book "Data Mining with SQL Server 2005" written by ZhaoHui Tang, I created a Mining Structure and a Mining Model with the AMO API after creating Database and Data Access Objects(referred to code lists from 14-1 to 14-6). I added Nested Table by creating a table column and added a key column to the nested table, while the error showed that in my structure the column of the nested table didn't include effective data bindings when processing.
Thanks for any suggestion!
View 3 Replies
View Related
Jun 8, 2001
We are migrating a SQL 6.5 application with 1900 stored procedures that use 100's of temp tables to SQL 2000.
A problem we have encountered was that we started out getting an "invalid column" errors on certain procedures. Investigation determined that the error was being generated in a nested procedure. The table that caused the error ended up being a temp table that was created using "select into". The following select statement from that temp table gave the invalid column error.
First thinking it was the "Select Into" we then discovered that the outer most procedure had created a temp table of the same name prior to executing the lower level procedure. After the select into, the next statement was a SELECT that went against what it thought was the inner temp table. However, it grabbed the outermost temp table and then couldn't find the appropriate columns and generated the error.
The solution, of course, was to rename the inner most temp table. We also remove the "select into" in the procedure by explicitly creating the temp table.
We tried creating some test procedures to attempt to reproduce this scenario without complete success.
Our test created 3 procedures (sp1 calling sp2 calling sp3) to mimic the current scenario. Sp1 created a temp table and executed sp2, which executed sp3. Sp3 created another temp table using the same name as the one created in sp1.
If we create all three procedures at the same time, it doesn't matter if we change the order in which they are created or whether we create the inner temp table explicitly or with a "select into", SQL Query Analyzer won't let us create the procedure because it finds that the temp table has been declared twice. If we create the procedures separately however, they compile and allow sp3 to create a temp table by the same name as sp1. After creating the procedures independently, they runs properly in all cases with everything in proper scope and no problems.
Admittedly, this is bad coding to start with, but what is happening with the scope of the temp tables within the stored procedures?
Thanks,
Glen Smith
View 1 Replies
View Related