Welcome to dbFreaks.com!
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

Inline expression for INSERT INTO

 
   Database Help (Home) -> Datamining RSS
Next:  Analysis Services Algorithms  
Author Message
Nestor

External


Since: Feb 27, 2008
Posts: 5



(Msg. 1) Posted: Sat Mar 08, 2008 8:24 pm
Post subject: Inline expression for INSERT INTO
Archived from groups: microsoft>public>sqlserver>datamining (more info?)

How can I use an inline expression instead of @TrainTable in this DMX
expression?

INSERT INTO MINING MODEL [TwoLinesData_InSample_ModelRuns_99991231_235959] (
[DateS]
,[Line]
,[X]
,[Y]
) @TrainTable

Something like

Select '2001-01-01' as DateS, "Line1" as Line, 1.1 as X, 2.2 as Y
union all
Select '2001-01-02' as DateS, "Line2" as Line, 2.2 as X, 3.3 as Y

I know you can do it for PREDICTION JOIN as shown below. But I cannot find a
way to do it in an INSERT INTO command.

SELECT
T.Y as [Actual]
,Predict([Y]) as [Predict]
FROM [TwoLinesData_InSample_ModelRuns_99991231_235959]
NATURAL PREDICTION JOIN (
SELECT
'1/1/2000 12:04:00 AM' as [DateS],
'Line1' as [Line],
5.36 as [X],
38.10729061 as [Y]
) AS T


Many thanks, Nestor

 >> Stay informed about: Inline expression for INSERT INTO 
Back to top
Login to vote
Dejan Sarka

External


Since: Mar 18, 2004
Posts: 103



(Msg. 2) Posted: Sat Mar 22, 2008 8:47 am
Post subject: Re: Inline expression for INSERT INTO [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

I think you could do this by using source that supports Union, for example
SQL Server, and Openquery DMX function
INSERT INTO model
OPENQUERY([SQL Server Data Source],'Select ... Union Select...]')

--
Dejan Sarka
http://blogs.solidq.com/EN/dsarka/default.aspx

"Nestor" wrote in message

> How can I use an inline expression instead of @TrainTable in this DMX
> expression?
>
> INSERT INTO MINING MODEL [TwoLinesData_InSample_ModelRuns_99991231_235959]
> (
> [DateS]
> ,[Line]
> ,[X]
> ,[Y]
> ) @TrainTable
>
> Something like
>
> Select '2001-01-01' as DateS, "Line1" as Line, 1.1 as X, 2.2 as Y
> union all
> Select '2001-01-02' as DateS, "Line2" as Line, 2.2 as X, 3.3 as Y
>
> I know you can do it for PREDICTION JOIN as shown below. But I cannot find
> a way to do it in an INSERT INTO command.
>
> SELECT
> T.Y as [Actual]
> ,Predict([Y]) as [Predict]
> FROM [TwoLinesData_InSample_ModelRuns_99991231_235959]
> NATURAL PREDICTION JOIN (
> SELECT
> '1/1/2000 12:04:00 AM' as [DateS],
> 'Line1' as [Line],
> 5.36 as [X],
> 38.10729061 as [Y]
> ) AS T
>
>
> Many thanks, Nestor

 >> Stay informed about: Inline expression for INSERT INTO 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
Collation Problem any help - Hello all : My problem is like the following I have an online databse with a latin collation, this database is using ntext and nvarchar values that was with our previous admin ok the problem is in the data is stored should use another collation (the...

Reprocessing a mining model - I'm currently developing a user registration prototype. The aim is to classify certain types of users. However, after the registration I query a decision tree model in Analysis Services with DMX and I want to send the user data into the warehouse to....

Trying to cut down query times - I have a query that is based on two other queries that are based on tables in a database. All of the queries that are used for this final query use grouping and totals. In the application I am making, I need to choose a date range to select the subset....

Update serial number in database - Hi, I want to update specific fields in a existing table in SQL database as below example: L240100001-LG L240100002-LG *serial number is difficult to update one by one L240100003-LG L240100004-LG L240100005-LG change to L240100001-L L240100002-L..

Newbie question - I have SQL Server 2000. What add-ons do I need to try data mining, and where do I best go for resources/references?
   Database Help (Home) -> Datamining All times are: Pacific Time (US & Canada)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]