Activex Script - DTSGlobalVariables.Parent - Error
Sep 5, 2006
Hi,
I migrated DTS From sql server 2000 to 2005 .
But i have problemes with the ativex :
Error: 0xC0048006 at Loop action, ActiveX Script Task: Retrieving the file name for a component failed with error code 0x000F5544.
In DTS ActiveX scripting it was common to get a reference to the package itself using the following line of code:
Dim package = DTSGlobalVariables.Parent
This was used to navigate over the DTS object model , to loop.
Someone can help me to know haw I can do the same thing with the SSIS.
Regards,
View 3 Replies
ADVERTISEMENT
Jul 28, 2006
This error occurs when the ActiveX task tries to execute:
[ActiveX Script Task] Error: Retrieving the file name for a component failed with error code 0x001B6438.
Anybody know how to troubleshoot these errors? I can't find anything on this error code. The same script works in DTS.
View 8 Replies
View Related
Apr 28, 2005
Hello,
I have a DTS package that has an ActiveX task. This task works with access to create databases and push out data to them. The problem is, I'm getting an error trying to establish a connection to the SQL Server database as such:
set objConn = Server.CreateObject("ADODB.Connection")
I get this as a resolution:
http://support.microsoft.com/default.aspx?scid=kb;en-us;201740
But I wasn't sure since I'm not dealing with ASP. I'm trying to run the task as myself manually, not scheduled also, for testing purposes. Any ideas?
Thanks.
View 1 Replies
View Related
Oct 17, 2003
I get this error msg when I run my ActiveX script in a DTS package.
Err number: 429
Err Message: ActiveX component can't create object
When I Set crApplication = CreateObject("CrystalRuntime.Application.9")
if Err.Number <>0 then
'I get the message here
ne one know what this is about? I'm running this package on SQL server 2000 with Admistrative access
View 5 Replies
View Related
Oct 6, 2005
I am tying to run this DTS:
the job has an activex part which uses :
"Set fso = CreateObject("Scripting.FileSystemObject")"
this row gives me the following error:
"ActiveX Scripting encountered a Run Time Error during the execution of the script. "
the dts worked when I run it local on my station but when I try running it on the server this error comes
can u help???
10x
View 1 Replies
View Related
Apr 14, 2005
Hello All,
I have an ActiveX script that runs DTS pachkages. In the event that a package fails I want to display the error message. I found the following code (in bold) for doing this but I keep getting an error message as follows.
Type mismatch 'oSoStep.GetExecutionErrorInfo'
All help appreciated.
Thanks, Gary
View 2 Replies
View Related
Nov 30, 2007
HI Experts,
I am having 2 severs (SQL2000 & SQL2005), there is already one DTS package in SQL 2000, now i have migrated DTS package to SSIS package. Now the problem is DTS package is having ActiveX script and it was executing perfectly in 2000 server but after migrated to 2005 server if i am executing the coverted SSIS package it is giving one error and the error is displaying here.
Error1Validation error. DTSTask_DTSDataPumpTask_1: OLE DB Destination [181]: SSIS Error Code DTS_E_CANNOTACQUIRECONNECTIONFROMCONNECTIONMANAGER. The AcquireConnection method call to the connection manager "Microsoft OLE DB Provider for SQL Server Copy" failed with error code 0xC0202009. There may be error messages posted before this with more information on why the AcquireConnection method call failed.SearsCDCC_Transfer (1).dtsx00
and i am also displaying the ACtiveX code as well and here oma11pngrdb02 is 2000 server and sant01pngrdb is 2005 server.
'**********************************************************************
' Visual Basic ActiveX Script
'************************************************************************
Dim gsErrorFile
gsErrorFile = "\oma11pngrdb02App_Data_ReportingSearserrors2.txt"
Function Main()
Main = DTSTaskExecResult_Success
set objftp = CreateObject("ftpx.aspftp")
objftp.sServerName = "10.1.3.175"
objftp.sUserID = "COS.FTP"
objftp.sPassword = "SENDFILE"
if objftp.bConnect then
dim fname, lfname
fname = "$IOMH04.PRDFFTAP.ST462330"
lfname = "\oma11pngrdb02App_Data_ReportingSearscdccfile.txt"
If objFTP.bGetFile (fname, lfname ) then
Main = DTSTaskExecResult_Success
Else
logError("Error getting file: " & objFTP.sErrorDesc)
Main = DTSTaskExecResult_Failure
End If
Else
logError("Error connecting: " & objFTP.sErrorDesc)
Main = DTSTaskExecResult_Failure
end if
End Function
Function logError(sErrorMsg)
Dim objErrorFile, objFSO
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objErrorFile = objFSO.OpenTextFile(gsErrorFile, 2,True)
objErrorFile.writeLine "Error!! Error!! Error!! Error!! Error!! Error!! Error!! Error!! Error!! Error!! "
objErrorFile.writeLine FormatDateTime(Now(),vbShortdate) & " " & FormatDateTime(Now(),vbShorttime)
objErrorFile.writeLine sErrorMsg
objErrorFile.writeLine "Error!! Error!! Error!! Error!! Error!! Error!! Error!! Error!! Error!! Error!! "
objErrorFile.close
Set objErrorFile = Nothing
Set objFSO = Nothing
End Function
Can any one give me the solution as early as possible, and your help is soo Appreciable
-Thanks N Regards,
Kanthi.
View 2 Replies
View Related
Oct 26, 2006
My ActiveX code wrote:
Function Main()
msgbox "Hello" & DTSTaskExecResult_Failure & DTSTaskExecResult_Success
Main = DTSTaskExecResult_Failure
End Function
However - it displays "Hello10" - but SSIS will not throw an error - it executes successfully.
Any ideas?
View 5 Replies
View Related
Jan 27, 2006
Hi,
I'm trying to reset the below Global varialbe in SSIS - Activex script.
Function Main()
DTSGlobalVariables("GxvFilename").value =null
Main = DTSTaskExecResult_Success
End Function
Getting the below Error when executing the package.
[ActiveX Script Task] Error: Retrieving the file name for a component failed with error code 0x060339E4
Please provide me solution for this.
Thanks,
View 2 Replies
View Related
Feb 25, 2005
I am using ActiveX Script tasks to branch out on the different tasks that I have within the DTS. When I want a particular branch of tasks not to be executed, I give a "Main = DTSStepScriptResult_DontExecuteTask"
This seems to be working fine in terms of functionality, but there is an error that is displayed saying "Task reported failure on execution".
How do I get rid of this? I need to exit the task, and still just get one message box at the end of it all that happily reads "Succesfully completed tasks"
View 2 Replies
View Related
Nov 30, 2007
HI Experts,
I am having 2 severs (SQL2000 & SQL2005), there is already one DTS package in SQL 2000, now i have migrated DTS package to SSIS package. Now the problem is DTS package is having ActiveX script and it was executing perfectly in 2000 server but after migrated to 2005 server if i am executing the coverted SSIS package it is giving one error and the error is displaying here.
Error 1 Validation error. DTSTask_DTSDataPumpTask_1: OLE DB Destination [181]: SSIS Error Code DTS_E_CANNOTACQUIRECONNECTIONFROMCONNECTIONMANAGER. The AcquireConnection method call to the connection manager "Microsoft OLE DB Provider for SQL Server Copy" failed with error code 0xC0202009. There may be error messages posted before this with more information on why the AcquireConnection method call failed. SearsCDCC_Transfer (1).dtsx 0 0
and i am also displaying the ACtiveX code as well and here oma11pngrdb02 is 2000 server and sant01pngrdb is 2005 server.
'**********************************************************************
' Visual Basic ActiveX Script
'************************************************************************
Dim gsErrorFile
gsErrorFile = "\oma11pngrdb02App_Data_ReportingSearserrors2.txt"
Function Main()
Main = DTSTaskExecResult_Success
set objftp = CreateObject("ftpx.aspftp")
objftp.sServerName = "10.1.3.175"
objftp.sUserID = "COS.FTP"
objftp.sPassword = "SENDFILE"
if objftp.bConnect then
dim fname, lfname
fname = "$IOMH04.PRDFFTAP.ST462330"
lfname = "\oma11pngrdb02App_Data_ReportingSearscdccfile.txt"
If objFTP.bGetFile (fname, lfname ) then
Main = DTSTaskExecResult_Success
Else
logError("Error getting file: " & objFTP.sErrorDesc)
Main = DTSTaskExecResult_Failure
End If
Else
logError("Error connecting: " & objFTP.sErrorDesc)
Main = DTSTaskExecResult_Failure
end if
End Function
Function logError(sErrorMsg)
Dim objErrorFile, objFSO
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objErrorFile = objFSO.OpenTextFile(gsErrorFile, 2,True)
objErrorFile.writeLine "Error!! Error!! Error!! Error!! Error!! Error!! Error!! Error!! Error!! Error!! "
objErrorFile.writeLine FormatDateTime(Now(),vbShortdate) & " " & FormatDateTime(Now(),vbShorttime)
objErrorFile.writeLine sErrorMsg
objErrorFile.writeLine "Error!! Error!! Error!! Error!! Error!! Error!! Error!! Error!! Error!! Error!! "
objErrorFile.close
Set objErrorFile = Nothing
Set objFSO = Nothing
End Function
Can any one give me the solution as early as possible, and your help is soo Appreciable
View 4 Replies
View Related
Mar 31, 2008
Hey...
I am running a parent SSIS package (running sp2, 9.0.3042) that calls several child packages.
On our development server, we now cannot run this because we get 1 or more of these errors:
"Error 0x80004003 while preparing to load the package. Invalid pointer . "
"Error 0xC0011008 while preparing to load the package. Error loading from XML. No further detailed error information can be specified for this problem because no Events object was passed where detailed error information can be stored. . "
It is not occuring on the same packages. It varies every time it is run.
I can run every one of the child packages individually, using the same login ID that the parent is executed under.
The parent package works fine on my local machine and other servers running the same version of SSIS. Just not on this server.
Does anyone have any ideas???
Thanks
BobP
View 17 Replies
View Related
Oct 1, 2007
I am getting an Error on Line 4 of sample code, any idea, where?
if isdate(mid(DTSSource("Col016"), 5, 2) & "/" &
right(DTSSource("Col016"), 2) & "/" & left(DTSSource("Col016"), 4)) then
DTSDestination("DOB") = mid(DTSSource("Col016"), 5, 2) &
"/" & right(DTSSource("Col016"), 2) & "/" & left(DTSSource("Col016"), 4)
else
DTSDestination("DOB") = NULL
end if
View 6 Replies
View Related
Feb 27, 2007
when i run activex Script it's shows this error
[ActiveX Script Task] Error: Retrieving the file name for a component failed with error code 0x001B6438
View 2 Replies
View Related
Jun 19, 2008
i get a error message like this: Table RENTAL_ITEM in RENTALB23 does not have a matching parent key.
this is the sql:
CREATE TABLE RENTALB23/RENTAL_ITEM (RENTALITEM# INT PRIMARY KEY,
RENTALTYPE CHAR(3), TITLE CHAR(30), CATEGORY CHAR(15), DUEDATE DATE,
FOREIGN KEY(RENTALTYPE) REFERENCES
RENTALB23/RENTAL_CHARGE(RENTALTYPE), FOREIGN KEY(CATEGORY)
REFERENCES RENTALB23/RENTAL_CHARGE(CATEGORY))
this is the sql for the rental_charge table:
CREATE TABLE RENTALB23/RENTAL_CHARGE (RENTALTYPE CHAR(3),
CATEGORY CHAR(15), CHARGE DECIMAL(5,2), PRIMARY KEY(RENTALTYPE,
CATEGORY))
any ideas what can cause this?
View 4 Replies
View Related
Mar 28, 2008
I'm building a page that will display link categories with the links under each one. I have that part working however there is a code issue that I cant quite figure out related to the SQL query.
I want to be able to have the category only display if the 'linkcolumn' is set to 1 in the database. (so I can later separate which ones show in each column of the page.
However, I get an error if I try to make my 'select' statement have a 'where' in it. I think it does this because it ends up not showing all the records but I'm not sure why.
Exception Details: System.ArgumentException: This constraint cannot be enabled as not all values have corresponding parent values.
My codebehind file:
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
using System.Data.Sql;using System.Data.SqlTypes;
public partial class Modules_NCG_NCGLinks : System.Web.UI.UserControl
{public void Page_Load(object sender, EventArgs e)
{
//Create the connection and DataAdapter for the Category table.SqlConnection cnn = new SqlConnection(ConfigurationManager.ConnectionStrings["mystringname"].ConnectionString);
SqlDataAdapter cmd1 = new SqlDataAdapter("select * from NCG_Links_Category Where LinkCategory = 'Test'",cnn);
//Create and fill the DataSet.DataSet ds = new DataSet();
cmd1.Fill(ds, "NCG_Links_Category");
//Create a second DataAdapter for the Links table.SqlDataAdapter cmd2 = new SqlDataAdapter("select * from NCG_Links",cnn);
cmd2.Fill(ds,"NCG_Links");
//Create the relation bewtween the Category and Links tables.ds.Relations.Add("myrelation",
ds.Tables["NCG_Links_Category"].Columns["LinkCategory"],ds.Tables["NCG_Links"].Columns["LinkCategory"]);
//Bind the Category table to the parent Repeater control, and call DataBind.parentRepeater.DataSource = ds.Tables["NCG_Links_Category"];
Page.DataBind();
//Close the connection.
cnn.Close();
}private void Page_Init(object sender, EventArgs e)
{
InitializeComponent();
}private void InitializeComponent()
{ this.Load += new System.EventHandler(this.Page_Load);
}
}
View 2 Replies
View Related
Nov 7, 2007
I am very new to SQL Server 2005, and I am currently trying to migrate a 2000 db to 2005.
I have now migrated all the DTS to SSIS, removing any legacy & replacing with new functionality.
I have been through a group of related packages ironing out any problems. They ALL now run fine when called individually.
However, I am now having problems with the parent package that is used to string these all together. It will not even run the 1st package.
For info, the first task of this package is a "Transfer SQL Server Objects Task". I am copying a few tables with data, but WITHOUT indexes, etc.
Following this, there is an "Execute SQL Task" that creates an index on one of those copied tables.
To get past another issue I had to set the "CopySchema" property of the "Transfer..." task to true, but did not select any schemas to transfer.
Now, when running the PARENT package, it is failing at the 1st step of the 1st package as follows:
Error: 0xC002F325 at Copy LT Data Tables, Transfer SQL Server Objects Task: Execution failed with the following error: "ERROR : errorCode=-1071636471 description=SSIS Error Code DTS_E_OLEDBERROR. An OLE DB error has occurred. Error code: 0x80004005.
An OLE DB record is available. Source: "Microsoft SQL Native Client" Hresult: 0x80004005 Description: "The statement has been terminated.".
An OLE DB record is available. Source: "Microsoft SQL Native Client" Hresult: 0x80004005 Description: "Cannot insert duplicate key row in object 'dbo.Hidden Hearing Limited$Telemarketer' with unique index 'IX_Hidden Hearing Limited$Telemarketer1'.".
helpFile=dtsmsg.rll helpContext=0 idofInterfaceWithError={8BDFE893-E9D8-4D23-9739-DA807BCDC2AC}".
I have been searching and searching, finding similar problems, and even the same error codes, but nothing quite matching this particular scenario.
I have been trying to set the "DelayValidation" at various levels, but with no luck.
I would greatly appreciate any help in trying to resolve this. Has anyone else had the same, or similar, issue?
Many Thanks,
Simon
View 3 Replies
View Related
Nov 7, 2007
I am very new to SQL Server 2005, and I am currently trying to migrate a 2000 db to 2005.
I have now migrated all the DTS to SSIS, removing any legacy & replacing with new functionality.
I have been through a group of related packages ironing out any problems. They ALL now run fine when called individually.
However, I am now having problems with the parent package that is used to string these all together. It will not even run the 1st package.
For info, the first task of this package is a "Transfer SQL Server Objects Task". I am copying a few tables with data, but WITHOUT indexes, etc.
Following this, there is an "Execute SQL Task" that creates an index on one of those copied tables.
To get past another issue I had to set the "CopySchema" property of the "Transfer..." task to true, but did not select any schemas to transfer.
Now, when running the PARENT package, it is failing at the 1st step of the 1st package as follows:
Code BlockError: 0xC002F325 at Copy LT Data Tables, Transfer SQL Server Objects Task: Execution failed with the following error: "ERROR : errorCode=-1071636471 description=SSIS Error Code DTS_E_OLEDBERROR. An OLE DB error has occurred. Error code: 0x80004005.An OLE DB record is available. Source: "Microsoft SQL Native Client" Hresult: 0x80004005 Description: "The statement has been terminated.".An OLE DB record is available. Source: "Microsoft SQL Native Client" Hresult: 0x80004005 Description: "Cannot insert duplicate key row in object 'dbo.Hidden Hearing Limited$Telemarketer' with unique index 'IX_Hidden Hearing Limited$Telemarketer1'.". helpFile=dtsmsg.rll helpContext=0 idofInterfaceWithError={8BDFE893-E9D8-4D23-9739-DA807BCDC2AC}".
I have been searching and searching, finding similar problems, and even the same error codes, but nothing quite matching this particular scenario.
I have been trying to set the "DelayValidation" at various levels, but with no luck.
I would greatly appreciate any help in trying to resolve this. Has anyone else had the same, or similar, issue?
Many Thanks,
Simon
View 15 Replies
View Related
May 7, 2008
Hi,
I have a child package running under main parent pakage.
I am passing value of integer & string type variables from parent package to child package's variables ( as disscussed in following artical http://msdn.microsoft.com/en-us/library/ms345179(SQL.100).aspx) ,values assigned in child package variables are futher used to build connection string for flat file connection manager in child package.
I have been using this whole SSIS package sucessfully for last three months,but suddenly the following error arises
"OnError,,,,,,,The result of the expression
Code Snippet
"@[User::StrTextFileImpDirectory] +"SomeTextStringHere"+ @[User::StrANTTextFileName] +(DT_STR,30,1252) @[User::Staging_Date_Key]+ "SomeTextStringHere"
on property "ConnectionString" cannot be written to the property. The expression was evaluated, but cannot be set on the property."
When I see the result of above mentioned expression through Log file than it appears that my string variable
Code Snippet"@[User::StrTextFileImpDirectory]
in child package has not been populated with any value from parent package variable, I.e it has been populated with empty string(While this is not desired value).
Same problem arises with my integer type variable
Code Snippet@[User::Staging_Date_Key]
,it has ben populated with value zero (i.e default value at design time for integer type),while this is not desired value.
Can some one guide me how to figure out the cause for error....
Is it possible that such kind of error may arise due to any change in enviornment of server....
View 1 Replies
View Related
Apr 23, 2008
Hello,
I am getting this error when trying to open a report created with the cube. We use dundas olap chart to generate the xml for the report from the base cube or default perspective. What we do is change the xml dynamically to a different perspective for security purposes and then load the report. If the report xml accesses a dimension that is hidden the assigned perspective then we get the error shown below. Does anyone know how to handle this error?
Exception Details: System.NullReferenceException: Internal error. Dimension level or it's parent is NULL.
This only happens with some of our dimensions. With the other hidden dimensions we get no data message on the chart which is what we want.
I am comparing our dimensions to the Adventure Works cube dimensions which seem to work (I have not tried all of their dimensions yet). Nothing sticks out to me as being a setting that will make the error go way. Anyone have suggestions?
Other things I tried but didn't help were removing the parent child hierarchies and Role based security that uses one of the dimensions that throws the error. I also did a trace on the cube when the error is thrown. I could not see any errors and I was able to execute all of the MDX queries without any problems (I copied and pasted the mdx into SSMS).
As an aside we tried used the Cube Roles and Dimension security (Hiding measures in the Measures Dimension too) but the error that MS (#Error or #Value) throws causes dundas not to work. We also looked UDFs and Cell Level Security but both are more complex/what we need for now.
Thanks in advance,
Sean
View 10 Replies
View Related
Aug 29, 2007
I am trying to pass back the number of errors encountered by a child package to the Parent package. I have a script within the child package, which will set the value of the Parent package's variable (ChildErrCount). However, I have no idea how to access the Child package's Errors collection to get a count.
Any ideas? Has someone figured out a way to reference the current package's properties (besides what's available from Dts.* ?
Thanks!
View 11 Replies
View Related
Nov 21, 2012
I have the below query which in turn goes in the where clause
Code:
SELECT CASE WHEN EXISTS (SELECT child.id FROM InspectionType parent,
InspectionType child WHERE parent.id = child.parentId AND
parent.code = 'INSPECTION_TYPE_SAFETY_LIFE' AND parent.zoneId = 10129)
THEN (SELECT child.id FROM InspectionType parent, InspectionType child
WHERE parent.id = child.parentId AND parent.code ='INSPECTION_TYPE_SAFETY_LIFE' AND parent.zoneId = 10129)
ELSE (SELECT id FROM InspectionType WHERE code = 'INSPECTION_TYPE_SAFETY_LIFE' AND zoneId = 10129)
END
I am getting below error
Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression.
I tried to solve this problem with If and else but it is not going well with in-clause
Code:
select * from InspectionType where id in (select IF EXISTS (SELECT child.id FROM InspectionType parent,
InspectionType child WHERE parent.id = child.parentId AND
parent.code = 'INSPECTION_TYPE_SAFETY_LIFE' AND parent.zoneId = 10129)
BEGIN (SELECT child.id FROM InspectionType parent, InspectionType child
WHERE parent.id = child.parentId AND parent.code ='INSPECTION_TYPE_SAFETY_LIFE' AND parent.zoneId = 10129)
END
ELSE (SELECT id FROM InspectionType WHERE code = 'INSPECTION_TYPE_SAFETY_LIFE' AND zoneId = 10129) )
I am using select * from InspectionType where id in() for illustation only. The sub-query results will go another query
Code:
SELECT child.id FROM InspectionType parent, InspectionType child
WHERE parent.id = child.parentId AND parent.code ='INSPECTION_TYPE_SAFETY_LIFE' AND parent.zoneId = 10129
This returns more than one row.I know why is the error message but need to achieve this functionality.
View 1 Replies
View Related
Jan 8, 2007
Hi,
This error comes up immediately after opening:
Unhandled exception has occurred in a component in your application
If you click Continue, the application will ignore this error and attempt to
continue.
Cannot create a stable subkey under a volatile parent key.
It then provides a whole pile of (to the absolute beginner) mumbo-jumbo under a details button.
It does provide the option to continue, whereupon everything appears
normal; however, I consider this rather unwise at my very first opening
of Management Studio Express.
I have created a databse in VB Express (I have completed the Lesson 09
Video) dealing with databinding - I created the application etc with
the video to enhance my learning.
Should this affect it? It's the only database I have created.
This looks to me (my Express illiteracy intact, of course) like the
kind of message one would get after having an error in something
already created or in the process of being created.
What is this? I was going to begin the video tutorials for SQL, but not with this message.
I have only just installed the Express 'suite' a few days ago.
Please keep replies non-jargonistic - absolute beginner.
Fran...
View 5 Replies
View Related
May 19, 2015
Given the sample data and query below, I would like to know if it is possible to have the outcome be a single row, with the ChildTypeId, c.StartDate, c.EndDate being contained in the parent row. So, the outcome I'm hoping for based on the data below for ParentId = 1 would be:
1 2015-01-01 2015-12-31 AA 2015-01-01 2015-03-31 BB 2016-01-01 2016-03-31 CC 2017-01-01 2017-03-31 DD 2017-01-01 2017-03-31
declare @parent table (Id int not null primary key, StartDate date, EndDate date)
declare @child table (Id int not null primary key, ParentId int not null, ChildTypeId char(2) not null, StartDate date, EndDate date)
insert @parent select 1, '1/1/2015', '12/31/2015'
insert @child select 1, 1, 'AA', '1/1/2015', '3/31/2015'
[Code] .....
View 6 Replies
View Related
Apr 25, 2007
Iam running sql sever 2005 express with advanced services but when i try to launch sql sever management studio express, i get the following message message and i have no idea why.
unhandled exception has occurred in a component in your application. If you click continue the application will ignore the this error and attempt to continue .
Can not create a stable key under a volatile parent key.
View 7 Replies
View Related
May 22, 2006
Hi all,
I got an error message 156, when I executed the following code:
////--SQLQueryParent&Child.sql---////////
Use newDB
GO
----Creating dbo.Person as a Parent Table----
CREATE TABLE dbo.Person
(PersonID int PRIMARY KEY NOT NULL,
FirstName varchar(25) NOT NULL,
LastName varchar(25) NOT NULL,
City varchar(25) NOT NULL,
State varchar(25) NOT NULL,
Phone varchar(25) NOT NULL)
INSERT dbo.Person (PersonID, FirstName, LastName, City, State, Phone)
SELECT 1, "George", "Washington", "Washington", "DC", "1-000-1234567"
UNION ALL
SELECT 2, "Abe", "Lincoln", "Chicago", "IL", "1-111-2223333"
UNION ALL
SELECT 3, "Thomas", "Jefferson", "Charlottesville", "VA", "1-222-4445555"
GO
----Creating dbo.Book as a Child table----
CREATE TABLE dbo.Book
(BookID int PRIMARY KEY NOT NULL,
BookTitle varchar(25) NOT NULL,
AuthorID int FOREIGN KEY NOT NULL)
INSERT dbo.Book (BookID, BookTitle, AuthorID)
SELECT 1, "How to Chop a Cherry Tree", 1
UNION ALL
SELECT 2, "Valley Forge Snow Angels", 1
UNION ALL
SELECT 3, "Marsha and ME", 1
UNION ALL
SELECT 4, "Summer Job Surveying Viginia", 1
UNION ALL
SELECT 5, "Log Chopping in Illinois", 2
UNION ALL
SELECT 6, "Registry of Visitors to the White House", 2
UNION ALL
SELECT 7, "My Favorite Inventions", 3
UNION ALL
SELECT 8, "More Favorite Inventions", 3
UNION ALL
SELECT 9, "Inventions for Which the World is Not Ready", 3
UNION ALL
SELECT 10, "The Path to the White House", 2
UNION ALL
SELECT 11, "Why I Do not Believe in Polls", 2
UNION ALL
SELECT 12, "Doing the Right Thing is Hard", 2
GO
---Try to obtain the LEFT OUTER JOIN Results for the Parent-Child Table
SELECT * FROM Person AS I LEFT OUTER JOIN Book ON I.ID=P.ID
GO
////---Results---//////
Msg 156, Level 15, State 1, Line 5
Incorrect syntax near the keyword 'NOT'.
////////////////////////////////////////////////////
(1) Where did I do wrong and cause the Error Message 156?
(2) I try to get a Parent-Child table by using the LEFT OUTER JOIN via the following code statement:
Msg 156, Level 15, State 1, Line 5
Incorrect syntax near the keyword 'NOT'.
Can I get a Parent-Child table after the error 156 is resolved?
Please help and advise.
Thanks,
Scott Chang
View 9 Replies
View Related
Apr 23, 2001
How do I use ActiveX script in DTS to do a 'Save As' on an excel file and
convert that to a tab delimited text file ?
Help is much appreciated.
Hayes
View 2 Replies
View Related
Jan 29, 2004
I have to put some ActiveX code in the first step of a DTS package, which will search thru all the files in some folder and if it finds a file with filename starting with "Test" (like TestFile.txt), the script will rename it and then use it for transforming data to SQL tables.
In VB Dir$ function could have been used, what should I use in ActiveX?
Thanks a lot for your help
View 3 Replies
View Related
Sep 26, 2006
hello friends, i heard from my colleagues that xml and activex are necessary for DBA
is it so? how could we use in our daily activities?
can any one provide me good links for this concepts please?
thank you very much.
View 8 Replies
View Related
Aug 12, 2000
Hi there,
Can I be able to call a Activex DLL from Sp or from triggers.
Sachi
Looking for a answer..
View 1 Replies
View Related
Jan 19, 2001
I'm attempting to write my first activex script. Not familiar with VB script so bear with what might seem like a simple question.
I'm trying to use an activex script in a dts to do a transformation. I have all the columns as straight copies except for one which I'm doing an activex script. What I'm trying to do is if the date is less than 1900-01-01 I want to default it to 1900-01-01. Every once in awhile a date comes across from the source file with a date of 0001-01-01 which sql doesn't like so I want to default it to 1900-01-01 instead. The script I've created parces fine but when I run the dts I get an error that the activex script encountered an invalid data value for source column LLAI. I don't understand why. any suggestions would be greatly appreciated.
Here is the script.
Function Main()
If DTSSource("LLAI") >= "1900-01-01" Then
DTSDestination("LastActivityISODate") = DTSSource("LLAI")
Else
DTSDestination("LastActivityISODate") = "1900-01-01"
End If
Main = DTSTransformStat_OK
End Function
View 1 Replies
View Related
Jan 19, 2000
Hi,
Am having trouble writing to a table on the SQL 7 Server database, using a DTS ActiveX script.
When I try a .ADDNEW function, the following error comes up.
"The opperation required by the application is not supported by the provider."
The line preceding the .ADDNEW are as follows.
-----
SET Conn=CreateObject("ADODB.Connection")
SET RS = CreateObject("ADODB.RecordSet")
Conn.ConnectionString = "PROVIDER=SQLOLEDB;DATABASE=DataIn;User ID=sa;Password="
Conn.Open
RS.Open sqlSites, Conn
----
Q - Whats wrong ?
View 1 Replies
View Related
Feb 22, 2005
Hi all,
I have a problem with a SQL Agent JOB on SQL 2K SP3 installation (on Win2K Server).
SQL Agent is running under a domain account with local Admin privileges and SA privileges in SQL server.
A job with an ActiveXScript step fails with "Permission denied: 'CreateObject line..."
If I execute the same ActiveXScript as cmdexec step (calling CSript with the VBScript as parameter) it works without any problem.
The ActiveXScript for reference:
Dim oXls
Dim oWorkBook
Dim oSheet
Set oXLS = CreateObject ("Excel.Application")
oXls.Visible = True
oXls.DisplayAlerts = True
Set oWorkBook = oXLS.WorkBooks.Add
Set oSheet = oWorkBook.ActiveSheet
oSheet.Name = "Test AG"
oWorkBook.SaveAs "C:TempTestAg.Xls"
oWorkBook.Close
Set oSheet = Nothing
Set oWorkBook = Nothing
oXls.Quit
Set oXlS = Nothing
Does anybody have any idea why approach 1 fails while approach 2 does work happily?
View 2 Replies
View Related