Why Identity Didn't Rollback ?
Jun 8, 2007
First latest Identity column is 5
I try to insert value to table which have Identity column by ExecuteNonQuery() method.
There was some error and rollback this transaction.
and then I modified code for completely saving
after that I try to insert value again by running program although this transaction completely
But value in identity is 7 ( It seems value 6 didn't rollback when not completely saveing )
Please advise me
How can I rollback Identity column value ?
View 1 Replies
ADVERTISEMENT
Feb 4, 2007
So any help? I tried the stuff in the FAQ
View 3 Replies
View Related
Jan 14, 1999
I have a transaction log that is 80% full and will not dump. I have used the "dump transaction dbname with no_log" command. It return the usual "This command did not return data, and it did not return any rows". However, this didn't do anything. The transaction log is still full. I don't want to restart the server if I don't have to. Any ideas?
View 5 Replies
View Related
Oct 14, 2007
We have Active/Passive cluster on Windows 2003. It is a 2 nodes cluster. The active server came down and the Cluster didn't failover. Then we had to manually failover. Can you help me to decipher the Cluster.log to find out why it didn't failover?
00000d08.000012a8::2007/10/12-04:04:40.847 ERR SQL Server <SQL Server>: [sqsrvres] CheckQueryProcessorAlive: sqlexecdirect failed
00000d08.000012a8::2007/10/12-04:04:40.847 ERR SQL Server <SQL Server>: [sqsrvres] printODBCError: sqlstate = HYT00; native error = 0; message = [Microsoft][SQL Native Client]Query timeout expired
00000d08.000012a8::2007/10/12-04:04:40.847 ERR SQL Server <SQL Server>: [sqsrvres] OnlineThread: QP is not online.
0000077c.000003dc::2007/10/12-04:04:43.785 INFO [CP] CppRegNotifyThread checkpointing key SoftwareMicrosoftMicrosoft SQL ServerMSSQL.1MSSQLSERVER to id 4 due to timer
0000077c.000003dc::2007/10/12-04:04:43.785 INFO [Qfs] QfsGetTempFileName C:DOCUME~1SVC_CL~1LOCALS~1Temp, CLS, 13522 => C:DOCUME~1SVC_CL~1LOCALS~1TempCLS34D2.tmp, status 0
0000077c.000003dc::2007/10/12-04:04:43.785 INFO [Qfs] QfsDeleteFile C:DOCUME~1SVC_CL~1LOCALS~1TempCLS34D2.tmp, status 0
0000077c.000003dc::2007/10/12-04:04:43.785 INFO [Qfs] QfsRegSaveKey C:DOCUME~1SVC_CL~1LOCALS~1TempCLS34D2.tmp, status 0
0000077c.000003dc::2007/10/12-04:04:43.785 INFO [CP] CpSaveData: checkpointing data id 4 to quorum node 1
0000077c.000003dc::2007/10/12-04:04:43.785 INFO [CP] CppWriteCheckpoint checkpointing file C:DOCUME~1SVC_CL~1LOCALS~1TempCLS34D2.tmp to file Q:MSCS 592a048-5457-426a-a46d-996441ef0182 0000004.CPT
0000077c.000003dc::2007/10/12-04:04:43.785 INFO [Qfs] QfsCreateDirectory Q:MSCS 592a048-5457-426a-a46d-996441ef0182, status 183
0000077c.000003dc::2007/10/12-04:04:43.785 INFO [Qfs] QfsOpenFile C:DOCUME~1SVC_CL~1LOCALS~1TempCLS34D2.tmp => 3, 36cf960 status 0
0000077c.000003dc::2007/10/12-04:04:43.785 INFO [Qfs] QfsOpenFile Q:MSCS 592a048-5457-426a-a46d-996441ef0182 0000004.CPT => 2, 36cf8d0 status 183
0000077c.000003dc::2007/10/12-04:04:43.785 INFO [Qfs] ReadFile 928 (regf) 32768 16384, (0=>0) 0 status 0
0000077c.000003dc::2007/10/12-04:04:43.785 INFO [Qfs] WriteFile 95c (regf) 16384, status 0 (0=>0)
0000077c.000003dc::2007/10/12-04:04:43.785 INFO [Qfs] ReadFile 928 (regf) 32768 0, (0=>0) 0 status 0
0000077c.000003dc::2007/10/12-04:04:43.785 INFO [Qfs] QfsFlushBuffers 95c, status 0
0000077c.000003dc::2007/10/12-04:04:43.785 INFO [Qfs] QfsCloseHandle 928, status 0
0000077c.000003dc::2007/10/12-04:04:43.785 INFO [Qfs] QfsCloseHandle 95c, status 0
0000077c.000003dc::2007/10/12-04:04:43.785 INFO [Qfs] QfsDeleteFile C:DOCUME~1SVC_CL~1LOCALS~1TempCLS34D2.tmp, status 0
0000077c.000003dc::2007/10/12-04:06:23.084 INFO [CP] CppRegNotifyThread checkpointing key SoftwareMicrosoftMicrosoft SQL ServerMSSQL.1MSSQLSERVER to id 4 due to timer
0000077c.000003dc::2007/10/12-04:06:23.084 INFO [Qfs] QfsGetTempFileName C:DOCUME~1SVC_CL~1LOCALS~1Temp, CLS, 13523 => C:DOCUME~1SVC_CL~1LOCALS~1TempCLS34D3.tmp, status 0
0000077c.000003dc::2007/10/12-04:06:23.084 INFO [Qfs] QfsDeleteFile C:DOCUME~1SVC_CL~1LOCALS~1TempCLS34D3.tmp, status 0
0000077c.000003dc::2007/10/12-04:06:23.084 INFO [Qfs] QfsRegSaveKey C:DOCUME~1SVC_CL~1LOCALS~1TempCLS34D3.tmp, status 0
0000077c.000003dc::2007/10/12-04:06:23.084 INFO [CP] CpSaveData: checkpointing data id 4 to quorum node 1
0000077c.000003dc::2007/10/12-04:06:23.084 INFO [CP] CppWriteCheckpoint checkpointing file C:DOCUME~1SVC_CL~1LOCALS~1TempCLS34D3.tmp to file Q:MSCS 592a048-5457-426a-a46d-996441ef0182 0000004.CPT
0000077c.000003dc::2007/10/12-04:06:23.084 INFO [Qfs] QfsCreateDirectory Q:MSCS 592a048-5457-426a-a46d-996441ef0182, status 183
0000077c.000003dc::2007/10/12-04:06:23.084 INFO [Qfs] QfsOpenFile C:DOCUME~1SVC_CL~1LOCALS~1TempCLS34D3.tmp => 3, 36cf960 status 0
0000077c.000003dc::2007/10/12-04:06:23.084 INFO [Qfs] QfsOpenFile Q:MSCS 592a048-5457-426a-a46d-996441ef0182 0000004.CPT => 2, 36cf8d0 status 183
0000077c.000003dc::2007/10/12-04:06:23.084 INFO [Qfs] ReadFile 95c (regf) 32768 16384, (0=>0) 0 status 0
0000077c.000003dc::2007/10/12-04:06:23.084 INFO [Qfs] WriteFile 928 (regf) 16384, status 0 (0=>0)
0000077c.000003dc::2007/10/12-04:06:23.084 INFO [Qfs] ReadFile 95c (regf) 32768 0, (0=>0) 0 status 0
0000077c.000003dc::2007/10/12-04:06:23.084 INFO [Qfs] QfsFlushBuffers 928, status 0
0000077c.000003dc::2007/10/12-04:06:23.084 INFO [Qfs] QfsCloseHandle 95c, status 0
0000077c.000003dc::2007/10/12-04:06:23.084 INFO [Qfs] QfsCloseHandle 928, status 0
0000077c.000003dc::2007/10/12-04:06:23.084 INFO [Qfs] QfsDeleteFile C:DOCUME~1SVC_CL~1LOCALS~1TempCLS34D3.tmp, status 0
0000077c.000003dc::2007/10/12-04:08:08.259 INFO [CP] CppRegNotifyThread checkpointing key SoftwareMicrosoftMicrosoft SQL ServerMSSQL.1MSSQLSERVER to id 4 due to timer
0000077c.000003dc::2007/10/12-04:08:08.259 INFO [Qfs] QfsGetTempFileName C:DOCUME~1SVC_CL~1LOCALS~1Temp, CLS, 13524 => C:DOCUME~1SVC_CL~1LOCALS~1TempCLS34D4.tmp, status 0
0000077c.000003dc::2007/10/12-04:08:08.259 INFO [Qfs] QfsDeleteFile C:DOCUME~1SVC_CL~1LOCALS~1TempCLS34D4.tmp, status 0
0000077c.000003dc::2007/10/12-04:08:08.259 INFO [Qfs] QfsRegSaveKey C:DOCUME~1SVC_CL~1LOCALS~1TempCLS34D4.tmp, status 0
0000077c.000003dc::2007/10/12-04:08:08.259 INFO [CP] CpSaveData: checkpointing data id 4 to quorum node 1
0000077c.000003dc::2007/10/12-04:08:08.259 INFO [CP] CppWriteCheckpoint checkpointing file C:DOCUME~1SVC_CL~1LOCALS~1TempCLS34D4.tmp to file Q:MSCS 592a048-5457-426a-a46d-996441ef0182 0000004.CPT
0000077c.000003dc::2007/10/12-04:08:08.259 INFO [Qfs] QfsCreateDirectory Q:MSCS 592a048-5457-426a-a46d-996441ef0182, status 183
0000077c.000003dc::2007/10/12-04:08:08.259 INFO [Qfs] QfsOpenFile C:DOCUME~1SVC_CL~1LOCALS~1TempCLS34D4.tmp => 3, 36cf960 status 0
0000077c.000003dc::2007/10/12-04:08:08.259 INFO [Qfs] QfsOpenFile Q:MSCS 592a048-5457-426a-a46d-996441ef0182 0000004.CPT => 2, 36cf8d0 status 183
0000077c.000003dc::2007/10/12-04:08:08.259 INFO [Qfs] ReadFile 7e0 (regf) 32768 16384, (0=>0) 0 status 0
0000077c.000003dc::2007/10/12-04:08:08.259 INFO [Qfs] WriteFile 95c (regf) 16384, status 0 (0=>0)
0000077c.000003dc::2007/10/12-04:08:08.259 INFO [Qfs] ReadFile 7e0 (regf) 32768 0, (0=>0) 0 status 0
0000077c.000003dc::2007/10/12-04:08:08.259 INFO [Qfs] QfsFlushBuffers 95c, status 0
0000077c.000003dc::2007/10/12-04:08:08.259 INFO [Qfs] QfsCloseHandle 7e0, status 0
0000077c.000003dc::2007/10/12-04:08:08.259 INFO [Qfs] QfsCloseHandle 95c, status 0
0000077c.000003dc::2007/10/12-04:08:08.259 INFO [Qfs] QfsDeleteFile C:DOCUME~1SVC_CL~1LOCALS~1TempCLS34D4.tmp, status 0
0000077c.00000844::2007/10/12-04:09:11.323 INFO [Qfs] GetDiskFreeSpaceEx Q:MSCS, status 0
0000077c.000003dc::2007/10/12-04:09:56.652 INFO [CP] CppRegNotifyThread checkpointing key SoftwareMicrosoftMicrosoft SQL ServerMSSQL.1MSSQLSERVER to id 4 due to timer
0000077c.000003dc::2007/10/12-04:09:56.652 INFO [Qfs] QfsGetTempFileName C:DOCUME~1SVC_CL~1LOCALS~1Temp, CLS, 13525 => C:DOCUME~1SVC_CL~1LOCALS~1TempCLS34D5.tmp, status 0
0000077c.000003dc::2007/10/12-04:09:56.652 INFO [Qfs] QfsDeleteFile C:DOCUME~1SVC_CL~1LOCALS~1TempCLS34D5.tmp, status 0
0000077c.000003dc::2007/10/12-04:09:56.652 INFO [Qfs] QfsRegSaveKey C:DOCUME~1SVC_CL~1LOCALS~1TempCLS34D5.tmp, status 0
0000077c.000003dc::2007/10/12-04:09:56.652 INFO [CP] CpSaveData: checkpointing data id 4 to quorum node 1
0000077c.000003dc::2007/10/12-04:09:56.652 INFO [CP] CppWriteCheckpoint checkpointing file C:DOCUME~1SVC_CL~1LOCALS~1TempCLS34D5.tmp to file Q:MSCS 592a048-5457-426a-a46d-996441ef0182 0000004.CPT
0000077c.000003dc::2007/10/12-04:09:56.652 INFO [Qfs] QfsCreateDirectory Q:MSCS 592a048-5457-426a-a46d-996441ef0182, status 183
0000077c.000003dc::2007/10/12-04:09:56.652 INFO [Qfs] QfsOpenFile C:DOCUME~1SVC_CL~1LOCALS~1TempCLS34D5.tmp => 3, 36cf960 status 0
0000077c.000003dc::2007/10/12-04:09:56.652 INFO [Qfs] QfsOpenFile Q:MSCS 592a048-5457-426a-a46d-996441ef0182 0000004.CPT => 2, 36cf8d0 status 183
0000077c.000003dc::2007/10/12-04:09:56.652 INFO [Qfs] ReadFile 928 (regf) 32768 16384, (0=>0) 0 status 0
0000077c.000003dc::2007/10/12-04:09:56.652 INFO [Qfs] WriteFile 7e0 (regf) 16384, status 0 (0=>0)
0000077c.000003dc::2007/10/12-04:09:56.652 INFO [Qfs] ReadFile 928 (regf) 32768 0, (0=>0) 0 status 0
0000077c.000003dc::2007/10/12-04:09:56.652 INFO [Qfs] QfsFlushBuffers 7e0, status 0
0000077c.000003dc::2007/10/12-04:09:56.652 INFO [Qfs] QfsCloseHandle 928, status 0
0000077c.000003dc::2007/10/12-04:09:56.652 INFO [Qfs] QfsCloseHandle 7e0, status 0
0000077c.000003dc::2007/10/12-04:09:56.652 INFO [Qfs] QfsDeleteFile C:DOCUME~1SVC_CL~1LOCALS~1TempCLS34D5.tmp, status
View 5 Replies
View Related
Jan 24, 2007
You can use a Select top @variable in sql server 2005:Thus:--'Throttle' the result set:Select Top (@MaxBatchSize)KeyID, LId, ArrivalDt, CaptureDt, Lat, LongFrom GPSDataOrder By CaptureDt DescMakes messing with Set Rowcount *so* redundant :-)
View 1 Replies
View Related
Nov 16, 2006
hi ..
i made an application using vb6 that access the table in a sqlserver database and in the load event i write
cn.mode=adsharedenyread
and i make two copies of the application and run them both of them read the data and no deny happen !!! although both of the applications have adsharedenyread
how can i make privilage for some users to read or write ?
by the way is that can be done in ado.net 2.0 ?
thanks in advance.
View 9 Replies
View Related
Apr 4, 2006
After installing the March SQLExpress Advanced package, I noticed that SQLXML4 did not install.
Is there a way to install the proper version separately, or do I just need to reinstall the entire package?
Thanks,
Paul
View 1 Replies
View Related
Mar 4, 2004
--create a temp table like:
select * into #tmp from
(select 1 as ID
union all select 2
union all select 3
union all select 4
) as A
-then run this query:
select B.ID,isNull(B.GID,0) as GID from
(select #tmp.ID,A.GID
from
#tmp
left outer join
(select ID,1 as GID from #tmp where ID in (2,4)) A
on #tmp.ID = A.ID
) as B
--I thougth it should return:
10
21
30
41
--but it actually returned:
IDGID
11
21
31
41
--if I change GID value in '...(select ID,1 as GID from #tmp where ID in (2,4)...', for example 2, then it return:
IDGID
12
22
32
42
WHY?
View 4 Replies
View Related
Oct 9, 2007
Hi There
I have just done my first clean install of SQL 2005. I have previously upgraded several boxes from SQL 2000 without incident.
The clean install seemed to go fine but the Maintenance Tasks didn't install? I have looked on the web but have been unable to unearth any information. Has anyone encountered this before and if so I how do I add Maintenance Tasks to the Management folder?
View 6 Replies
View Related
Apr 4, 2006
I just noticed that SQLXML4 did not install when I installed SQLExpress Advanced package (Mar 2006).
Anyone know if I can install SQLXML4 separately for SQLExpress Advanced or do I need to uninstall and re-install the entire package?
Thanks,
Paul
View 1 Replies
View Related
Jul 27, 2007
Hi every body !
I try to insert the reportViewer in my asp page, all is good, but if I want to change (by choosing another report), and i cannot call the method RefreshReport() as I saw in the msdn documentation.
I didn't understand why, I download the ReportViewer from msdn download : the version is 2.0.50727.42 from 22/01/2006...
I implement in my asp designer tools the following dll : Microsoft.SqlServer.UpgradeAdvisor.ReportViewer.dll 9.0.1399.1 from 14/10/2005
Did I forget any code line ? or did I download a bad version ?
Code Snipp
ReportViewer1.ServerReport.ReportPath += "CounterReport";
ReportViewer1.Refre.... //Visual studio didn't propose the method !!
View 1 Replies
View Related
Mar 16, 2007
I created a SSIS package that imports a file then moves the file to a folder called processed.
I created a job that runs the package. The pack works fine when I run it from the SQL Storage Area. When I run the job I get the following message:
Started: 9:58:15 AM DTExec: The package execution returned DTSER_SUCCESS (0). Started: 9:58:15 AM Finished: 9:58:21 AM Elapsed: 6.047 seconds. The package executed successfully. The step succeeded.
showing that the job supposedly completed successfully.
I know that the package the not run because the data did not get imported and the file did not move.
Can anyone explain the package may not run but we still get a job completion status of success?
View 6 Replies
View Related
Mar 9, 2006
I have 1 table:
ID pagename datevisited
1default01/01/2006
1info01/01/2006
1default02/01/2006
1info02/01/2006
1summary02/01/2006
2default02/01/2006
2info02/01/2006
2summary02/01/2006
I need to run query for ID who didn't visited a summary page(per day)
How do I do this?
View 1 Replies
View Related
Nov 28, 2005
Hello, everyone:
I have a backup plan that remove the old backup files more than two days. Last Monday, the SQL Server restart. Since that, the backup is fine, but it didn't remove the old backup files. Why and how to handle that? Thanks
ZYT
View 2 Replies
View Related
May 16, 2007
I have a very weird problem.
I ran a SQL statement to get the data from two tables using join. These two tables have a column in the same name €śID€?.
SQL=€?select * from table1 a, table2 b where a.ID=b.ID€?
Set RS=DB.Execute(SQL)
The statement worked. But when I output the records in my ASP pages, I got an error:
ADODB.Recordset error '800a0cc1'
Item cannot be found in the collection corresponding to the requested name or ordinal€?
This is the line caused error:
<%= RS(€śa.ID€?) %>
It seemed that SQL Server recordset doesn€™t carry the table aliens. If I removed a. from ID the error was gone but it gave me the value of b.ID.
How to solve the problem? Thank you.
View 4 Replies
View Related
Nov 24, 2006
hi ..
my problem is
i create a user in sqlserver from enterprise manager as follows:-
1- goto logins and new login
2-type a name and choose sqlserver authentication and type a password
3- from server roles tab i choose system administrators
4 from database access i choose the database i need that user to connect to .and OK
5-i goto database node in enterprise manager and select the database and the table
and double click on it and choose permissions and de-select the SELECT privilige
then i use ADO to connect to sqlserver through that user and when i select(SQL query) the table the data appeared normally !!!! and it suppose to give me exception
thanks in advance.
View 6 Replies
View Related
May 6, 2006
Dear all,
I have built an SSIS package by using the BI Dev Studio and enabled its configuration xml file.
The package have a variable called TranDate and I want to put it dynamically from a Calendar on my website (just like assigning a variable).
I have successfully change the value of that variable in the configuration files (affected to the xml file).
Then I loaded the package and executed it (through my web). It's still get the old value (which I have assigned while creating the package).
I didn't understand that where else can the package get the value of that variable so it still get the old value (that value have never appeared in the xml configuration file anymore when I changed it).
Thanks for reading this, and I am looking forward to seeing any helps from you guys.
View 3 Replies
View Related
Aug 27, 2007
Dear all,
I've been searching the article for error handling in SSIS but seems no article have same problem exactly as mine. In my package there's container, it contains Data Flow task and some of Script tasks. I put an error precedence from Data Flow task into Script task that contains script for log an error that might be occured. The Data Flow task imports data from flat file into SQL Server 2005 and I've set a semicolon as the column delimiter. Unfortunately there is a data in flat file that had one column contain semicolon as its value.
This would trigger an error and I hope the error would be logged into a table as I wrote inside Script task. But it didn't work. The error precedence won't work, the package stop in flat file source instead. I've been trying the event handler but it didn't work either. Maybe I got wrong implementation, anybody can help me explain the error handler and solve the problem ?
Here is the capture of my package, since I didn't know how to attach the picture in this forum.
Thanks in advance.
Best regards,
Hery
View 12 Replies
View Related
Aug 5, 2014
I am doing search through Date Range but didn't get correct result.
For Example if i created a Task on 5/8/2014 and when i have take Date Range from 1/8/2014 to 6/8/2014 then didn't get 5/8/2014 data in result but when i taken range from 1/8/2014 to 5/8/2014 then got the 5th Date data.
I am taking Range Inclusive Operator(:).
SELECT ( STRTOMEMBER(@FromDate) : STRTOMEMBER(@ToDate) )
View 1 Replies
View Related
Mar 13, 2007
Greetings,
I thought I had applied sp2 successfully but I discovered when I tried to apply the hotfix ( sqlserver2005-kb933097-x86-enu.exe), that the SQL Server Tools and Workstation Components wasn't at the 3042 level.
The recommendation in the log file is to:
"Update 3152 is dependent on prerequisite update 3042. Exit setup and refer to the Knowledge Base article to find the prerequisite patch."
Does anyone know where I find the prerequisite patch?
Any help would be appreciated.
Regards Noel
Time: 03/13/2007 18:05:39.045
KB Number: KB933097
Machine: NOEL_EVO
OS Version: Microsoft Windows XP Professional Service Pack 2 (Build 2600)
Package Language: 1033 (ENU)
Package Platform: x86
Package SP Level: 2
Package Version: 3152
Command-line parameters specified:
Cluster Installation: No
**********************************************************************************
Prerequisites Check & Status
SQLSupport: Passed
**********************************************************************************
Products Detected Language Level Patch Level Platform Edition
SQL Server Database Services 2005 (SQL2005) ENU SP1 2005.090.3042.00 x86 DEVELOPER
SQL Server Analysis Services 2005 (SQL2005) ENU SP1 2005.090.3042.00 x86 DEVELOPER
SQL Server Reporting Services 2005 (SQL2005) ENU SP1 9.00.3042.00 x86 DEVELOPER
SQL Server Notification Services 2005 ENU SP1 9.00.3042.00 x86 DEVELOPER
SQL Server Integration Services 2005 ENU SP1 9.00.3042.00 x86 DEVELOPER
SQL Server Tools and Workstation Components 2005 ENU SP1 9.1.2153 x86 DEVELOPER
**********************************************************************************
Products Disqualified & Reason
Product Reason
SQL Server Tools and Workstation Components 2005 The product instance SQL Tools does not have prerequisite update 3042 installed. Update 3152 is dependent on prerequisite update 3042. Exit setup and refer to the Knowledge Base article to find the prerequisite patch. Install the prerequisite and rerun the installation.
View 1 Replies
View Related
Apr 20, 2007
Hi,
i'm doing POS system by using C# in visual studio 2005. Recently, i installed the microsoft sql server management studio on my pc, i plan to do merge replication through local publications between my pocket pc and my pc. So, i opened the replication file which is under Object Explorer in microsoft sql server management studio, it ONLY show me the local subscription folder under the replication file.Do i install incomplete set of microsoft sql server management studio?Local publications and local subscription, which one is more suitable for POS system?
View 11 Replies
View Related
Apr 6, 2001
I have a 2.8G SQL 7 database with 1.6G used space. I want to shrink it to 1.8G, but after I issued the 'DBCC srhinkfile(datafile, 1800)', it didn't shrink the file, instead it expanded to 2.7G used space? I tried on a test server, the command worked every time although the time to complete the task tended to increase every time.
I did the DBCC DBREINDEX (fill factor 90) and updated usage, the size didn't change. DBCC CHECKDB, CATELOG AND SHOWCONTIG were all performed and there wasn't any error or fragmentation.
Now I'm wondering what's the actual size of my database, 1.6G or 2.7G? If there's a way that I can get back close to my original used sized, then I can try to shink the file again. Any comment is welcome. Thanks advance.
View 4 Replies
View Related
Nov 3, 2015
We have a sales fact table that has sales by customers, products, date etc. and dimension tables such as customers, products etc.
We built a multi-dimensional cube on top of these tables. how do we support queries like "show me top 10 products by sales amount and then show customers that didn't buy these products"?
View 4 Replies
View Related
Jul 9, 2006
While I have learned a lot from this thread I am still basically confused about the issues involved.
.I wanted to INSERT a record in a parent table, get the Identity back and use it in a child table. Seems simple.
To my knowledge, mine would be the only process running that would update these tables. I was told that there is no guarantee, because the OLEDB provider could write the second destination row before the first, that the proper parent-child relationship would be generated as expected. It was recommended that I create my own variable in memory to hold the Identity value and use that in my SSIS package.
1. A simple example SSIS .dts example illustrating the approach of using a variable for identity would be helpful.
2. Suppose I actually had two processes updating these tables, running at the same time. Then it seems the "variable" method will also have its problems. Is there a final solution other than locking the tables involved prior to updating them or doing something crazy like using a GUID for the primary key!
3. We have done the type of parent-child inserts I originally described from t-sql for years without any apparent problems. (Maybe we were just lucky.) Is the entire issue simply a t-sql one or does SSIS add a layer of complexity beyond t-sql that needs to be addressed?
TIA,
Barkingdog
View 10 Replies
View Related
Jun 30, 2006
I want to insert a new record into a table with an Identity field and return the new Identify field value back to the data stream (for later insertion as a foreign key in another table).
What is the most direct way to do this in SSIS?
TIA,
barkingdog
P.S. Or should I pass the identity value back in a variable and not make it part of the data stream?
View 12 Replies
View Related
Jan 25, 2015
I have table of three column first column is an ID column. However at creation of the table i have not set this column to auto increment. Then i have copied 50 rows in another table to this table then set the ID column values to zero.
Now I have changed the ID column to auto increment seed=1 increment=1 but the problem is i couldn't figure out how to update this ID column with zero value set to each row with this auto increment values so the ID column would have values from 1-50. Is there a away to do this?
View 6 Replies
View Related
Sep 19, 2005
Ok,I just need to know how to get the last record inserted by the highestIDENTITY number. Even if the computer was rebooted and it was twoweeks ago. (Does not have to do with the session).Any help is appreciated.Thanks,Trint
View 2 Replies
View Related
Jun 19, 2008
Hi,
I am having problem in bulk update of a sql server table haning identity column from a datatable( has no identity column) using sqlbulkcopy. I tried several approaches, but it does not show any error nor is the table getting updated. But the identity value seems to getting increased every time.
thanks.
varun
View 6 Replies
View Related
Aug 1, 2014
I'm working with a third-party database (SQL Server 2005) and the problem here is the following:
- There are a bunch of ETL processes that needs to insert rows on a table (let's call this table T) and at the same time, an ERP (owner of T) is up and running (reading, updating and inserting on T).
- The PK of T is an Integer.
Today all ETL processes uses (select max(ID) + 1 from T) to insert new rows, so just picture the scenario. It is a mess! Everyday they get duplicate key error when 2 or more concurrent processes are trying to insert a row (with the max) at the same time.
Considering that I can't change the PK, what is the best approach to solve this problem?
To sum up:
* I need to have processes in parallel inserting on T
* I can't change anything on T
* The PK is NOT an Identity
View 4 Replies
View Related
Aug 12, 2007
Hello experts, I made a huge mistake on a production server, ran an update without the WHERE clause. UPDATE myTableSET Field1 = 'SOmetext',Field2 = 'sometext2'Is there a way to rollback? I read something a while ago about transaction logs.SOS!Thanks
View 4 Replies
View Related
Sep 27, 2007
HI,
Suppose I execute any transaction say inserted some rows.
I want to delete my previous transaction using rollback.
What is the proper syntax for that.
In Query Window:
Insert ---------- executed
rollback.
it was asking for name of the transaction. How to give that.
Help me out
Thanks
Bye
View 1 Replies
View Related
Nov 12, 2003
This is my stored procedure. Problem is that a rollback does not happen when there is an error ? How can this be, am starting and ending the transaction?
CREATE Procedure opretKunde
(
@cvr int,
@url varchar(200),
@firmaNavn varchar(50),
@adresse varchar(150),
@postnr int,
@fax int,
@tlf int,
@email varchar(200),
@bruger varchar(20),
@kode varchar(32)
)
AS
BEGIN TRANSACTION
INSERT INTO login
(
brugernavn,
kodeord,
type
)
VALUES
(
@bruger,
@kode,
'k'
)
INSERT INTO kunde
(
cvr,
url,
navn,
fax,
tlf,
email,
brugernavn
)
VALUES
(
@cvr,
@url,
@firmaNavn,
@fax,
@tlf,
@email,
@bruger
)
INSERT INTO adresse
(
type,
cvr,
adresse,
postnr
)
VALUES
(
'b',
@cvr,
@adresse,
@postnr
)
COMMIT
GO
View 1 Replies
View Related