DTS Won't Transfer DB2 Timestamps
Nov 10, 2000
When i try to load tables from DB2 OS390 Via DTS and DB2 ODBC it
give me an error with the timestamp field. Its (DTS) says the timestamp
field on SQL is marked read only.
Is there anyway around this problem?
View 1 Replies
ADVERTISEMENT
Mar 30, 2007
I have read the forums and fail to be encouraged about using the timestamp to handle concurrency. I have SQL 2005 and am using the DataReader and command objects for data manipulation. The database has about a dozen related tables to each other in some way. Correct me if I am wrong, but using timestamps means I must store each table's original rowversion at read time in several possible combinations of variables (based on the joined tables at the time of read). Is this right? Then at update time, what if some related tables are timestamped with the original value and others have changed since read time? How would each update stored procedure know which other dependent tables were fetched at read time? It's easy to corrupt the data this way.
SELECT s.OrderNumber, a.UserName AS OrderedBy, cn.LastName + ', ' + cn.FirstName AS ContactName, s.CarbonCopy, s.Application, s.OrderDate,
s.FollowUpDate, s.ProdStartDate, s.InternalNote, s.SampleNote, s.UpdatedBy, s.DateLastUpdated, cn.EMail AS ContactEmail, s.MfgID,
co.CompanyName, s.ShipVia, cn2.LastName + ', ' + cn2.FirstName AS ContactName2, co2.CompanyName AS Expr1,
cn3.LastName + ', ' + cn3.FirstName AS ContactName3, s.MfgContactID, s.DistributorID, s.DistContactID, s.CustomerContactID,
s.VersionStamp, a.VersionStamp, cn.VersionStamp, co.VersionStamp, cn3.VersionStamp <------- Is all this really necessary?
FROM Samples AS s LEFT OUTER JOIN
Associates AS a ON s.OrderedByID = a.AssociateID LEFT OUTER JOIN
Contacts AS cn ON s.CustomerContactID = cn.ContactID INNER JOIN
Companies AS co ON s.MfgID = co.CompanyID LEFT OUTER JOIN
Contacts AS cn3 ON s.DistContactID = cn3.ContactID LEFT OUTER JOIN
Contacts AS cn2 ON s.MfgContactID = cn2.ContactID LEFT OUTER JOIN
Companies AS co2 ON s.DistributorID = co2.CompanyID
WHERE (s.SampleID = @SampleID)
What would be a simple way to update a table that depends on other tables having original version stamps? Then at runtime how would I enforce it without generating violations when the users were updating, say, the Samples table and just viewing the dependent tables' columns, not changing them.
View 4 Replies
View Related
Oct 5, 2007
Hello!
I think I am missing some essential idea when working with a timestamp column, maybe someone around here can give me the needed pointers on how-to...
My situation is: I want to copy data periodically from one DB to another. Both are in the same SQL instance, so there are no transaction, networking or similar issues involved. It all really comes down to identifing the new rows in source and moving them over to destination.
I added a TIMESTAMP column to my source, and I can see it count up slowly for every line inserted. On the destination side, I added a table containig just one field, type binary(8) to store the last value to which the last transfer ran.
Notice that on source side I got the counter on every row, but on destination side I got only one value, I thought it would be waste to carry over the data for every row when I really only need the latest one.
Now, what my package does is:
a) Select the last used binary(8) value into a package variable named TS of type object (works)
b) Start a dataflow, where the source is SELECT statement and the WHERE clause is TIMESTAMP > package variable TS (works)
c) Multicast the data into two recordsets
d) One recordset makes most of the columns flow through some Lookups, Derive Columns into a Destination and are written back. (works)
e) The other exit of the Multicast shall go through all lines and catch the highest TIMESTAMP that came by using an Aggregate and write it down, since that is the point I need to pick up later. (and that is the problem)
Problems are: I cannot run Aggregate max on the TIMESTAMP. Only Count is allowed.
So I need to convert the BINARY(8) into a number to be able to catch the max value. Converting between BINARY(8) and DT_I8 or similar seems not possible, or the result is wrong due to the byte ordering (MSB/LSB, most/less significant byte first)
Later on, I need to write out my new found highest value again, but here the same problem applies. How do I convert from DT_I8 back to BINARY(8)?
Having my own reference value stored as bigint instead of binary(8) does not work either: You cannot assign bigint from a select to a package variable, bigint are loaded as string (as I read in a blog, and I think they are right since I get exactly the same errors).
So...
HOW does one work in an efficient way with a TIMESTAMP column to Aggregate it to max and store out this max value?
Or do you all keep the TIMESTAMP from source appended to your rows and stored with each row in destination (Wasting eight precious bytes a row)?
Thanks for your comments!
Ralf
View 3 Replies
View Related
Jan 19, 2005
Hi Everyone....
Crazy one here....
I need to populate a table with all the times that
are available in a 24 hour period, down to the 5 minute
interval.
So the table should look like....
id ds (datetime stamp)
--- --------------------------
0 1/1/2005 00:00:00
1 1/1/2005 00:05:00
2 1/1/2005 00:10:00
3 1/1/2005 00:15:00
.........
xx 1/1/2005 23:55:00
Please advise on a way to accomplish this in a script....
thanks
tony
View 14 Replies
View Related
Mar 18, 2008
I'm trying to filter out timestamps that land exactly at .000 milliseconds. (e.g. 2007-12-05 16:30:50.000) Do I have to convert the timestamp to a string first and then use the LIKE statement? If so, can somebody show me how. I'm pretty green to SQL but know the basics. Any help would be greatly appreciated!
View 2 Replies
View Related
Jul 20, 2005
I have an Access XP ADE application connected to a SQL Server 7.0 SP4database. I have created a timestamp column in the main table.Unfortunately, I am now getting persistent write conflict errors.The order of operations are:1. The application starts and loads the recordset into the form using astored procedure.2. I modify a field and press a save button which uses me.dirty=false toforce a save.3. The field is saved to the database. Using profiler I can observe themodified field being saved. As I would expect, the update statement isusing the primary key and the timestamp column value. For the sake of thisdiscussion let's assume the value of the timestamp is 5ad9.4. Without navigating off the record, I alter the same field (or adifferent field) and press save again and a write conflict will appear.Using profiler I can see the update statement that is attempting to updatethe record. The update statement is using the previous value (5ad9) of thetimestamp column.I thought that the timestamp column value is incremented each time therecord is updated. The ADE application does not appear to be recognizingthe new timestamp value.Any help or advice you could give would be appreciated.ThanksGeorge
View 3 Replies
View Related
Mar 19, 2007
Facundo writes "Hi:
How can i add a timestamp to a generated file of a complete database backup, the idea is to archive full database backups using the date to identified it.
Thanks a lot.
FB"
View 1 Replies
View Related
Apr 1, 2008
How do you add a specific timestamp to a backup? For example, if the backups are going to the same drive location on disk and you want to retain 3 days worth of backups online, how do you add the timestamp to the filename to make each backup unique?
F:MSSQL.1MSSQLBackup and your user database is <xyz>_<timestamp>.bak
The user database dumps each night at 9 PM.
You want to keep 3 days of online backups.
View 9 Replies
View Related
Nov 27, 2006
Greetings once again SSIS friends,
I have some source tables which contain timestamp fields (that's timestamp data type not datetime). My dimension table holds the maximum timestamp value as a varbinary(8).
I want my package to have a variable that holds that value but I don't know which data type to use for this. The reason for this is because I want to use that variable to then retrieve all records from my source table that have a timestamp value greater than the value stored in the variable.
Please advise on what data type is suitable.
Thanks for your help in advance.
View 2 Replies
View Related
Oct 22, 1998
I am using transfer manager in SQL 6.5 to copy a database and
all objects with data to another server. Transfer manager is not recreating all stored procedures. This even happens when I used it to another database on the same server. Any ideas??
View 3 Replies
View Related
May 30, 2008
Is it possible/advisable when transfering very large amounts of data from server to server to:
trasnfer the data to a new table first
second alter new table adding indexes, defaults, ets based on original table
if it is what flow item would be used to transfer/alter the indexes and defaults?
I'm very new to ssis so the more detail you can give the better.
Thanks
View 5 Replies
View Related
Feb 16, 1999
Hello:
I have been trying to run transfer manager to transfer all of the data
from the production database on one server to a test database on another
server(to refresh it). In order to make sure it runs on the server, I have
been scheduling it under EM to do so and I am pointing to the log on the
destination server on the EM Transfer panel.
For some reason, I am getting the following message in the destination
server error log:
99/02/16 10:24:41.42 ods Error : 17824, Severity: 10, State: 0
99/02/16 10:24:41.42 ods Unable to write to ListenOn connection
'.pipesqlquery', loginname 'sa', hostname 'TEMP09'.
99/02/16 10:24:41.42 ods OS Error : 232, The pipe is being closed.
99/02/16 10:24:41.42 spid17 Error : 1608, Severity: 21, State: 2
99/02/16 10:24:41.42 spid17 A network error was encountered while sending
results to the front end. Check the SQL Server errorlog for more
information.
I checked the event viewer error log and see no messages for today.
Can any one advise me what I need to do for this to run successfully?
Thanks. Any information furnished will be greatly appreciated.
David Spaisman
View 1 Replies
View Related
Mar 19, 2014
In the full recovery model, if i run a transaction that inserts 10MB of data into a table, then 10 MB of data is moved in the data file. Does this mean then that the log file will grow by exactly 10MB as well?
I understand that all transactions are logged to the log file to enable rollback and point in time recovery, but what is actually physically stored in the log file for this transactions record? Is it the text of the command from the transaction or the actual physical data from that transaction?
I ask because say if I have two drives, one with 5MB/s write speed for the log file and one with 10MB/s write speed for the data file, if I start trying to insert 10 MB of data per second into the table, am I going to be limited to 5MB/s by the log file drive, or is SQL server not going to try and log all 10 MB each second to the log file?
View 6 Replies
View Related
Mar 1, 2007
Hi,
I have the following method which transfers data SQL to SQL on the same server but when I try to change the destination server it won't transfer the data. The method runs through as expected with no exceptions or errors but with no data transfered.
Private Sub TransferSQLData(ByVal SourceDetails As Admin_upload.EnvironmentDetails, ByVal DestinationDetails As Admin_upload.EnvironmentDetails)
'Transfer database from source to destination.
Dim oPackage As New DTS.Package2
Dim oConnection As DTS.Connection2
Dim oStep As DTS.Step2
Dim oTask As DTS.Task
Dim oCustomTask As DTS.TransferObjectsTask2
Try
oStep = oPackage.Steps.New
oTask = oPackage.Tasks.New("DTSTransferObjectsTask")
oCustomTask = oTask.CustomTask
oPackage.FailOnError = False
With oStep
.Name = "Copy Database design and data"
.ExecuteInMainThread = True
End With
With oTask
.Name = "GenericPkgTask"
End With
With oCustomTask
.Name = "DTSTransferObjectsTask"
.SourceServer = "MYSERVER"
.SourceUseTrustedConnection = True
.SourceDatabase = SourceDetails.MetaDB
.SourceLogin = SourceDetails.MetaUser
.SourcePassword = SourceDetails.MetaPWD
.DestinationServer = "MYSERVER"
.DestinationUseTrustedConnection = True
.DestinationDatabase = DestinationDetails.MetaDB
.DestinationLogin = DestinationDetails.MetaUser
.DestinationPassword = DestinationDetails.MetaPWD
.CopyAllObjects = True
.IncludeDependencies = False
.IncludeLogins = False
.IncludeUsers = False
.DropDestinationObjectsFirst = True
.CopySchema = True
.CopyData = DTS.DTSTransfer_CopyDataOption.DTSTransfer_ReplaceData
End With
oStep.TaskName = oCustomTask.Name
oPackage.Steps.Add(oStep)
oPackage.Tasks.Add(oTask)
oPackage.Execute()
Catch ex As Exception
LabelUploadMeta.Text = "Failed to Upload MetaData: " & ex.Message
Throw ex
Finally
oConnection = Nothing
oCustomTask = Nothing
oTask = Nothing
oStep = Nothing
If Not (oPackage Is Nothing) Then
oPackage.UnInitialize()
End If
End Try
End Sub
This works fine but when I set the following within the method:
.DestinationServer = "ANOTHERSERVER"
It won't transfer the data.
I can access the remote server and read and write data to it.
Any ideas?
View 1 Replies
View Related
Jun 16, 2000
Hi ,
Can anyone suggest me to transfer a database from 65 to 70.
I trasfer a database using DTS, but i am only getting data. I need my users , views, stored procedures, permissions.
I need to upgrade three databases from 65 to another 70 server.
i also generated a script from 65, but which is showing errors.
Could u pls give any suggestions.
thank u.
--Raj
View 1 Replies
View Related
Oct 8, 1999
I recently transferred a db from our production machine to a test machine. After the transfer was complete I realized that all copied logins were copied with blank passwords. Is this default behavior? Can I set the transfer to include passwords?
Dave King
View 3 Replies
View Related
Sep 13, 2005
Hi,
stupid question but i have forgotten how to transfer a DTS package between servers, its been so long since i last had to!!!
TIA
View 1 Replies
View Related
Feb 4, 1999
Hi Everybody...
I have recently tried to transfer my database over from one machine to another, but failed to do so because it gets jammed on 30%. I am just wondering if there is any other ways I can take to migrate the database over.
I am currently running sql server 6.5 in concurrent with iis 4 and nt4. I am trying to seperate the iis to a new server machine and sql server to another server.
Please advise me which route to take if you have any suggestions and your solution is important to me. Thanks!
-Ken
View 1 Replies
View Related
Oct 19, 2007
Hi,
I want to transfer rows from one database to another.
Source My Source tables in database 'Staging'
CustomersEng
Name
Age
StCode
CityCode
InternalID
CustomersSpanish
Name
Age
StCode
CityCode
InternalID
CustomersEng and CustomersSpanish contains a replica..only difference being that 'Name' in the CustomerSpanish table is written in spanish language. The Stcode, citycode and Internalid together makes the row unique.
Code BlockSample script
Create table #CustomersEng (name nvarchar(20),age int, st_code int,
citycode int, internalid int)
Insert into #CustomersEng values('Aron',23,1,1,12);
Insert into #CustomersEng values('Cathy',28,1,1,13);
Insert into #CustomersEng values('Zarog',33,1,1,14);
Insert into #CustomersEng values('Michale',25,1,2,12);
Insert into #CustomersEng values('Linda',43,1,2,13);
Insert into #CustomersEng values('Burt',53,1,2,14);
Create table #CustomersSpanish (name nvarchar(20),age int, st_code int,
citycode int, internalid int)
Insert into #CustomersSpanish values('Arona',23,1,1,12);
Insert into #CustomersSpanish values('Cathylo',28,1,1,13);
Insert into #CustomersSpanish values('Zarogo',33,1,1,14);
Insert into #CustomersSpanish values('Michalo',25,1,2,12);
Insert into #CustomersSpanish values('Lindalo',43,1,2,13);
Insert into #CustomersSpanish values('Burto',53,1,2,14);
---------------------------------------------------------------------------------------------------------------
Destination tables in database 'CMO'
CustomerMaster
CustomerId (identity) (pk)
StCode
CityCode
InternalID
CustomerDetails [customerid and languagecode together are primary keys]
CustomerId (fk)
Name
Age
languagecode
Language
languagecode (pk)
languagename
Code Block
Create table #CustomerMaster (customerid int identity(1,1), st_code int,
citycode int, internalid int)
Create table #CustomerDetails (customerid int,name nvarchar(20),age int,
languagecode int)
Create table #CustLanguage (languagecode int, languagename varchar(10))
Insert into #CustLanguage VALUES (1,'English')
Insert into #CustLanguage VALUES (2,'Spanish')
Code BlockEXPECTED OUTPUT
CustomerMaster
1 1 1 12
2 1 1 13
3 1 1 14
4 1 2 12
5 1 2 13
6 1 2 14
CustomerDetails
1 Aron 23 1
1 Arona 23 2
2 Cathy 28 1
2 Cathylo 28 2
3 Zarog 33 1
3 Zarogo 33 2
4 Michale 25 1
4 Michalo 25 2
5 Linda 43 1
5 Lindalo 43 2
6 Burt 53 1
6 Burto 53 2
How can i write t-sql for this?
thanks
View 4 Replies
View Related
Feb 23, 2007
Hi All;
I know that in the SQL Server, the logins are not contained in the database (thanks to Kevin Yu) but I don't know where are they stored. For example if I want to transfer to another server I'll have to backup users too; but HOW?
In order to be more clear: When I simply take a backup from my server and restore it to my computer I can not login again with the user login information which is created on the server; However even if I make some changes; after backing the DB up from my computer and restoring to the server the logins are working (with re-mapping)
Thanks...
View 7 Replies
View Related
Mar 26, 2007
I had Sql Server 2005 installed on my machine, with that I am working on Visual Studio 2005. I just need to add an existing database into the app_data folder. The database is existing in the Sql server, it contains 180 tables so I cannot manually copy that tables in the app_data folder. for that is there any another way to copy all the tables into the database into the folder app_data with the data in the table.
Thanks & Regards
Girish Nehte
View 4 Replies
View Related
Apr 16, 2004
I recently transferred my SQL DB from one server to another, I backed the DB up, copied across and restored it into the new location, the problem is that I get the following error.
System.Data.SqlClient.SqlException: Invalid object name 'Table Name'
I have created a new user for this database and changed my code accordingly.
<%@ Import Namespace="System.Data.SqlClient" %>
<%@ Page Language="VB" Debug="true" %>
<Script Runat="Server">
Sub Page_Load
Dim conPubs As SqlConnection
Dim cmdSelectContacts As SqlCommand
Dim dtrContacts As SqlDataReader
conPubs = New SqlConnection("Server=Treebeard;UID=Intranet;Pwd=glglgl;Database=Contacts")
ConPubs.Open()
cmdSelectContacts = New SqlCommand ("Select * From Clientdata", ConPubs)
dtrContacts = cmdSelectContacts.ExecuteReader()
While dtrContacts.Read()
Response.Write( "<li>" )
Response.Write( dtrContacts( "c_forename" ))
End While
dtrContacts.Close
conPubs.Close()
End Sub
</script>
Any Ideas?
View 4 Replies
View Related
Aug 22, 2005
Hi everyone,I need some help transfering my database(SQL2005) to the host's server.In SQL 2000 I had the Management tools > DTS or ImportExport tools.SQL2005 lacks this, all I've got is Express Manager > can't connect to multiple databases.Can connect to one database and has a screen to excute TSQL commands.I don't want to have to recreate the whole database on the server.....This would be crazy... 150 stored procedures and 30 tables. Not to mention all the individual settings for each column.I know there is SQL Studio Management tools for the full version of SQL 2005. Anyone got any idea's ?Any input/suggestions is greatly appreciated.Thanks,JShep
View 1 Replies
View Related
Jan 16, 2006
I am trying to transfer my database from my computer where built it to another computer. I have microsoft SQL server 2005 CTP on my computer and the other computer has Microsoft SQL server.
Does anyone have any suggestions on how to do this??? I cannot find much info on SQL server 2005 CTP. I have found some info about the copy database wizzard, but I cannot find that in CTP.
Please any ideas or info would be wonderful
Thanks
Sarah
View 6 Replies
View Related
Mar 1, 2002
If I’m using the DTS Transfer SQL Object to move all objects and data from one server to another server and I make a schema change to source server, why is the dts package failing the next time I run it? Do I have to do some sort of refresh?
Any help!
View 1 Replies
View Related
May 11, 2001
I have a corrupt master db due to a rogue script that inserted lots of information into it. I have two SQL servers, and I could use some advice on the best way to copy the files over to the second server, then back after a reload of the first server. My main concern is the DTS packages I have built- I can't afford to lose those.
View 4 Replies
View Related
Jul 26, 2000
Hi,
I am in the process of upgrading database in sql server 6.5 to 7.0.
For that i am following one computer upgrade.
For creating dev environment in my computer i am using Transfer/Objects in 6.5
for transferring database from remote(production) computer to my computer.
Do i need only to transfer Userdatabase alone or do i need to Transfer Master and other ?
Or Is it better to restore dump ?
Thanks
View 4 Replies
View Related
Jul 12, 2000
HI,
If i transfer logins from one server to another server using dts, I am getting all the logins and permissions... How will i get passwords too..
-thank u.
--Siva
View 2 Replies
View Related
Sep 18, 2000
Does anyone have a sample SQL DMO script to transfer SQL Server logins from one server to another including the passwords ? any pointers will be greatly appreciated
View 1 Replies
View Related
Jul 30, 2000
Hello. Firstly apologies for what might appear as a basic question, but being a newbie and all :-). .
I have a SQL 7 DB, loads of sp, vw, tables etc. I want to copy this DB to another server so that all the DB and sp permissions stay current, all the sql logins come across etc etc.
I have tried restoring a backup to the new server (which worked fine), but then I appear to have lost the permissions for the tables and sp's.
I have then tried taking a copy of the original SQL master table and restoring this to the new server - but no luck.
Can anyone advise a sure method of copying an entire table and related entries (meaning sql logins etc) to a new server.
Appreciate any comments.
Regards
View 3 Replies
View Related
Aug 3, 2000
can any body can tell how data trnsfer from oracle database to sql server database. what is the methods i can use? is it required to write scripts.
if scripts required, can anybody can give me sample scipt.
View 1 Replies
View Related
Apr 6, 2000
Does anyone know whats the best to transfer sqlserver to new server but maintain the same Sqlserver name. The reason for this is that we have thousands of users out in the field and it would be too much trouble to identify these users and update the odbc entry to point to new sqlserver.
Thanks in advance for all your help.
View 1 Replies
View Related
Nov 16, 2000
SQL v7.0 - DTS
Tying to transfer all object info, sp's, constraints and data in to a fresh new database in the same instance, but it's hit and miss when it comes to getting everything transferred. Followed step by step instructions (GUI/Scripts) and sometimes the table structure will transfer without PK's, as well as some data and if you're lucky, some constraints. Stored proc's have a tendency to show up 20 minutes later. I'm testing this on a machine with IE 5, SP2 and fresh new Dll's (just in case something was corrupted). Is there a priority as far as what to transfer first? For example, tables only 1st, then constraints on down to records parent to child? I am assumming you should be able to transfer all at the same time since it's built in to the utility. Or, does it come down to something in the schema? If anyone out there has experienced something similar and found a solution, please advise.
View 1 Replies
View Related