We got a €œSql Server€? and an €œAS400€? System. I can Read the information from the AS400 using a DataReader- Source my problem ist that I can not manage to write in the €œAS400€?. Using a DataReader- Destination I am not able to specify the destination table.
Hello, I have to write a trigger to truncate at a scheduled time.Truncate statement is not allowed in the trigger.What should I do.I mean how to go for it. Thanks for any help. JAY
Hello, I have to write a trigger to truncate a table at a scheduled time.Truncate statement is not allowed in the trigger.What should I do.I mean how to go for it.How can I test my trigger if it's working fine or not. Thanks for any help. JAY
I have table name employee with attributes like eno,ename dno,salary. My problem is that i need select complete information of the emloyee's when employee getting same salary in same depatment.
Eg: I have the table like this eno ename dno salary 1 Noor D10 10000.50 2 Ahmed D20 20000.75 3 jaya D30 15000.65 4 hema D10 10000.50 5 rupa D20 20000.75 6 prabha D40 20000.75 7 lalitha D40 12000.75 8 vetri D40 12000.75 and i need the output as fallows
eno ename dno salary 1 Noor D10 10000.50 4 hema D10 10000.50 7 lalitha D40 12000.75 8 vetri D40 12000.75 2 Ahmed D20 20000.75 5 rupa D20 20000.75
so I written the query like this
SELECT * FROM employee where dno in(SELECT dno FROM employee group by dno,salary having count(dno)>1) and salary in(SELECT salary FROM sub group by dno,salary having count(salary)>1)
but i got the output as fallows
eno ename dno salary 1 Noor D10 10000.50 4 hema D10 10000.50 7 lalitha D40 12000.75 8 vetri D40 12000.75 2 Ahmed D20 20000.75 5 rupa D20 20000.75 6 prabha D40 20000.75 so plz somebody help me to get the output what i need........
hi, here i had created two table named table1,table. both the tables are homogenously belongs to same group. if i eneter any data say pinno in table1 the same pinno has to be enterd into table so i had wirtten a trigger for table here like this: create trigger Tg_Table1 on Table1 for insert as insert into Table2(pinno) select pinno as pinno from table1. the query is getting compiling correctly but the data entered into table2 while entering into the table1 is coming with duplicate values like: output of table2: pinno 1001 -> when i inserted 1001 in table1 1001 -> when i inserted 1002 in table1 1002 1001 -> when i inserted 1003 in table1 1002 1003
the column name pinno in table1 is also same for table2.
intially i had primary keys for two tables for column pinno. at that time it has shown error wqhile i am trying to insert data into table1. so i dropped the PK constarint for table2. this time the out put coming with replicated values.
pls some one show me a way to clear this problem
One can never consent to creep,when one feels an impulse to soar RAMMOHAN
I need to read data from a table, on a remote server, and write the data to an identical table on the local server. (That I did and all works fine.) The local server is were we do analysis services. So, with the data from the remote, I need to write parts of it to 2 tables other than the local identical table. (I hope this is clear) What tools do I use to accomplish this?
If this is not clear, let me know and I will try to clarify.
Can someone please help I'm writting the following query. SELECT (SELECT c.column_name FROM information_schema.tables T JOIN information_schema.columns C ON t.table_name = c.table_name WHERE t.table_type = 'base table' and t.table_name like 'L_%' ) INTO #TempTable FROM TableA A LEFT JOIN [Server-Name].DB_Name.dbo.TableB B ON A.ID = B.ID
I'm trying to put commas between column names. How do I go about doing that?
I'm trying to write a transformation script to write multiple rows from 1 input row. In SQL Server 2000 DTS I could do this by using DTSTransformStat_SkipFetch and DTSTransformStat_SkipRow. In SQL server 2005 it looks like I need to use EndOfRowset but I do not know how to use it for sure.
If this correct can someone show me a code example and if I am incorrect can someone tell me how to do this?
Hi Friends, I am trying to write SQL statement for getting information about Cube metadata. When we create any table in MSSQL server, we can trace out its information from system tables in master database by querying tables like sysobjects, syscolumns etc. Like that I have created a cube using MS Analysis services and I can see Metadata (like Creation Date, Processed on etc) on 'Metadata' tab of cube. But I want to access its contents by writting SQL statement. For this I could not locate any system level table where this information gets stored. Could any one help me for writting htis system table level query for accessing metadata info of cube?
I am using Sql Server 2000. I have a customer table with fields - CustId, Name, Address, City, StdCode, Phone. I used to insert entries in this table from an excel file. One excel file will contain thousands of customer. In this table combination of StdCode and Phone should not be repeated. If I do it in my VB.Net coding.then application gets drastically slow. So I want to write a procedure or trigger for this. Here what I will do, I will send all records into database then this trigger or procedure will check for any existing entry of combination of StdCode and phone. If entry exists then this will delete new entry or will not allow this new entry. Is this possible to do using Trigger or stored procedure?
In both VB6 and VB2005 Both are loaded on same computer. When attempting to write to an access database table using ADO I get a runtime error: -2147217887(80040e21) "mutiple-step operation generates errors. Check each status value. " Reading the database is no problem. I only get the errors when writting to database. I have used the following code forever in VB6 and never got this error. Now that I have Visual Studio 2005 loaded on the same machine. I get this error. I get the exact same error when using this code in VB2005. I know VB6 but am just learning 2005. The following code is writting to a database table from various user imputed text and combo boxes. I used basicly the same code in VB2005 and get the same exception error. This code works on machines that do not have VB .net loaded. How do I fix this. My application is useless unless the user can make changes to their data.
Public Function ActionToDb() Dim noPo As Integer Dim SQL As String, rst As ADODB.Recordset, dataSourceName As String
Set rst = New ADODB.Recordset With rst SQL = "Select [mLVbuNo], [mStratInit], [mMerticLv],[mSubMetLv],[mTaskAction],[mImpact]," & _ "[mStatus], [mOwner], [mTitle],[mOrigDate],[mCurrentDate],[mCopmpleteDt],[mComment],[mSource]," & _ "[mStatColor],[mHyperlink],[CompCheck] From [tblMasterActionItem]" .CursorLocation = adUseClient .Open SQL, dbConn, adOpenKeyset, adLockBatchOptimistic, adCmdText noPo = .RecordCount 'If .RecordCount > 0 Then .MoveLast .AddNew rst.Fields("mLVbuNo") = giRecNo rst.Fields("mStratInit") = frmActionDe.cboStatInit.Text rst.Fields("mMerticLv") = frmActionDe.cboMetricLever.Text rst.Fields("mSubMetLv") = frmActionDe.cboSubMet.Text rst.Fields("mTaskAction") = frmActionDe.txtTask.Text rst.Fields("mImpact") = frmActionDe.txtImpact.Text rst.Fields("mStatus") = frmActionDe.txtStatus.Text rst.Fields("mOwner") = frmActionDe.cboOwn.Text rst.Fields("mTitle") = gstOwnT rst.Fields("mOrigDate") = frmActionDe.txtOrigDt.Text rst.Fields("mCurrentDate") = frmActionDe.txtCurDt.Text rst.Fields("mCopmpleteDt") = frmActionDe.txtCompDt.Text rst.Fields("mComment") = frmActionDe.txtComments.Text rst.Fields("mSource") = frmActionDe.cboSource.Text rst.Fields("mStatColor") = frmActionDe.txtStatColor.Text rst.Fields("mHyperlink") = frmActionDe.txtHyperlink.Text If optCompCheck.Value = True Then rst.Fields("CompCheck") = True Else rst.Fields("CompCheck") = False End If 'End If .Update .Close End With dbConn.Close
ExitSub: On Error Resume Next dbConn.Close Set rst = Nothing Set dbConn = Nothing Exit Sub ErrorHandler: WriteToErrorLogEnd Err.Description & " in ActionToDb" Resume
One of my client is using AS400 machine and wants to migrate from flat files to SQL server/Oracle. But they do not want to buy a new hardware. They like to use the same machine.
Is there any Emulator or simulator available for AS400 machine to simulate NT or Alpha environment?
I was wondering if anyone could give some insight into the tools or applications needed to utilize a AS400 to query info. from a sql database to gain performance and reliability. I need to know about methods for connection, library changes needed, software etc. Please Help,I do not have much experience with databases.
I try run DTS from SQL with connection to AS400 (Client Access 32-bit ver. 8).I know this should be about 9000 records, but after 5000 records it's stopped.
I have been handed the directive that I am to ftp flat files from our AS400 to the SQL server where the web interfaces will read the data.
I need to know if anyone out here knows how to automate the FTP download from the AS400 system.
I don't know any UNIX and even if I did the SQL box is also running a 3rd party shipping label system that disallows the use/installation of MSK Toolkit.
I thought I could use the FTP Task in the DTS package but I don't know what to put for the internet location and this is certainly not a Mapped path.
I need some help here. I am trying to do a DTS from As400 from SQL Server 2000. However, the file that I require have members. IF I just do a select statement, it will retrieve the earliest member.
Does anyone know how I can access the latest member?
I'm trying to connect SQL SERVER with my AS/400. I linked my as400 with linkedserver.
When I execute a query with analyse query it works fine, but if I make a store procedure as schedule this job to get information from my as400 I got this msg:
Executed as user: NT AUTHORITYSYSTEM. OLE DB provider 'IBMDA400' reported an error. Access denied. [SQLSTATE 42000] (Error 7399) OLE DB error trace [OLE/DB Provider 'IBMDA400' IUnknown::QueryInterface returned 0x80070005: Access denied.]. [SQLSTATE 01000] (Error 7300). The step failed.
I have been tring to connect to the as400 through the IBM ODBC (IBMDA400), but have run into a wall. I was wondering, could i set up the 400 in SQL Server 2K as a DB or Table or something and maybe access it through SQLOLEDB?
I had tried this connection before using ODBC to connec to AS400 using the SQL statment "SELECT * FROM TableName1 LEFT JOIN TableName2 ON fieldname1=fieldname2" but Im using the same statement but only one table to be queried and is giving me an error, I use this one :
...
strAs400="DSN=DsnName"
connAS400.Open strAS400,UserID,Password
rsAS400.activeconnection=connAS400 rsAS400.Open "SELECT * FROM TableName1 WHERE fieldDate >=" & RangeDateFr " AND TableName1 <=" & RangeDateTo ,,adopendynamic,adlockoptimistic
...
On the above codes, I dont know what might wrong. It is giving me an error message ...SQL0104 - token fieldDate was not valid. Valid Tokens: FOR WITH FETCH...
Please help if someone knows this. I would appreciate it a lot...
I am migrating from 2000 to 2005 and dts to SSIS on several projects. I have not been able to successfully (without error) pull from an AS400 table using "SELECT *". If I reference all field names, it works fine. SELECT * actually works in the sense that it pulls over all the data, but it fails at the end, almost like an unepected end of stream. Normally it wouldn't be a problem tp qualify each field, but when I do the data gets sorted. In this instance I can't have it sorted because (without going into the stupid details) the production needs to match the development to suit my boss.
Connection = .Net Provider for OleDb/IBM DB2 UDB for iSeries IBMDA400 OLE DB Provider Data Source = DataReader Source (I have yet to be able to use and OLE Source for AS400 without error, although my colleagues can - weird)
Here is the error I get when I change:
SELECT FieldName1, FieldName2, FieldName3 FROM LIBRARY.FILENAME
to
SELECT * FROM LIBRARY.FILENAME
Error: 0xC0047038 at DTF_LoadSqlServer_BOSS_Tebosspf8H, DTS.Pipeline: SSIS Error Code DTS_E_PRIMEOUTPUTFAILED. The PrimeOutput method on component "OLE_SRC_Tebosspf8H" (4492) returned error code 0x80004003. The component returned a failure code when the pipeline engine called PrimeOutput(). The meaning of the failure code is defined by the component, but the error is fatal and the pipeline stopped executing. There may be error messages posted before this with more information about the failure.
Error: 0xC0047021 at DTF_LoadSqlServer_BOSS_Tebosspf8H, DTS.Pipeline: SSIS Error Code DTS_E_THREADFAILED. Thread "SourceThread0" has exited with error code 0xC0047038. There may be error messages posted before this with more information on why the thread has exited.
I
Any suggestions? Is there a property on the task or connection that will fix this? Or any idea why I can't use an OLE Source to pull from AS400?
I have been trying to transfer some data from a file located in a AS400 Server to SQL , but the file has more than one Member Name. I'm not sure how to specify a different member name on the SQL query . Please help.
The name of the file is:
Library = MTGLIBP2
File Name = CHSAVQPL
Member Name = INS
this is the query I have so far but I still need to reference the Member Name
SELECT * FROM OPENQUERY(AS400PL,'SELECT * FROM mtglibp2.CHSAVQPL')
I have been trying to transfer some data from a file located in a AS400 Server to SQL , but the file has more than one Member Name. I'm not sure how to specify a different member name on the SQL query . Please help.
The name of the file is:
Library = MTGLIBP2
File Name = CHSAVQPL
Member Name = INS
this is the query I have so far but I still need to reference the Member Name
SELECT * FROM OPENQUERY(AS400PL,'SELECT * FROM mtglibp2.CHSAVQPL')
I am trying to transfer information from the AS400 to SQL Server tables but I am having problems trying to connect and get information from the AS400. In the data source I select the iseries connection and type in the ip address, username, and password. When I click the test connection button, it connects but under the initial catalog all I get is the computer name. If anyone has any solutions to my problem that would be great
I need to query data through SSIS from what I was told is an AS400 DB2 member table. I am assuming this is a sub-table of the main table. I was going to write a correlated sub-query in SQL to get this data, however our AS400 contracted programmer says that there is an easier way and she pointed me to the main table's member. I do not know how to go about accessing this.
Has anybody had experience with this? The AS400 programmer is familiar with SQL syntax, however she does not know how to have SQL grab the data from a member table.
If all else fails, I will just construct my correlated sub-query.
I'm new in SSIS and I'm trying to activate a lookup on a table reside on DB2/AS400. Iget the following message when I try to join the input column to the lookup column:
TITLE: Microsoft Visual Studio ------------------------------
The following columns cannot be mapped:
[STOREK_S, STOREK_S]
One or more columns do not have supported data types, or their data types do not match.
------------------------------ BUTTONS:
OK ------------------------------
I know both columns have the same format on the DB2 table.
What I'm doing wrong ?
P.S: I'm using the IBM DB2 UDB for iSeries IBMDASQL OLE DB Provider as connection.
If I try with the Microsoft OLE DB Provider for DB2, I was unable to get the list of my table on teh AS400.
Test connection failed because of an error in initializing provider. The host resource could not be found. Check that the Initial Catalog value matches the host resource name. SQLSTATE: HY000, SQLCODE: -360
I have been asked to make it possible for our SQL 7 server to pull infromation from AS/400 and utilize it in web applications, and such. Is there any way of doing this? I have heard that you can export the data on the as400 to a DB2 file, and import it with SQL. Is this the only way of access info off of the 400?
I am trying to link SQL2000 to AS400. I have created the link and can access the data on the Server, but when I try to access from a client I get the following error:
Error 7399: OLE DB Provider 'MSDASQL' Reported an error. Data Source Name not found and no default driver specified.
Has anyone run into this and if so does anyone have a solution to this problem?