Identity Not Displayed Until I Move Into Another Record
Oct 17, 2007
Hello,
I am using Access with tables linked to sql server 2005. I need the identity to be displayed directly when entering data so that i can enter enter data into other tables using this identity on the form without the need to go back and forward to other records to display the identity. Is there a feature in Sql server 2005 which permits this?
Thank you
View 2 Replies
ADVERTISEMENT
Dec 13, 2007
I have a problem with a report, and I am running out of ideas on how to approach it. I have a report with groupings of data displayed, and once per group I need to display an image. When I place the image in a record, it shrinks it down to the height of the record and repeats the image for each record despite what formulas I put in the hidden property.
View 1 Replies
View Related
Feb 18, 2006
hi, i have no problem to select all records from the table, but how to copy or move these selected records to other table which contain same field as the orriginal.thanks
View 5 Replies
View Related
Jul 20, 2005
I've moved the database tables from the .mdb file to Sql Svr and now I havean *intermittent* problem. When I select a record from a combo box, it willintermittently pull up the wrong record. The code that does the search isbelow. I have a column named 'ProsId' that is a unique number (identitycolumn). The error -- when it happens -- seems to only happen on higherProsId numbers. At first it appeared to me as some sort of data conversionthing, but I'm not so sure now. Here's some examples:Record selected Record actually displayed---------------- -------------------------100,000 41,85959,073 15,79457,000 11,27357,001 11,27445,000 45,000 <--- appears to return correctvalue every time. Numbers lower than this also seem to return the correctrecord every time.Private Sub cboFindProsName_AfterUpdate()' Find the record that matches the control.Dim rs As ObjectIf Len(Trim(Me.cboFindProsName.Text)) > 0 ThenSet rs = Me.Recordset.Cloners.FindFirst "[ProsId] = " & (Me![cboFindProsName])Me.Bookmark = rs.BookmarkEnd IfEnd SubMany Thanks!
View 5 Replies
View Related
Jul 18, 2007
Hi,
i have simple requirement...but dont know how to proceed. I need to move the first record from a flat file (file1) to another flat file(file2) using SSIS, file1 will have many records but i just need the first one alone to be moved. Any pointers on this would be of much help.
Thanks,
raj
View 4 Replies
View Related
Oct 9, 2013
I'm trying to move specific data from three linked tables on a source database to three tables on a destination database by generating dynamic SQL INSERT scripts but am getting stuck on the last set of INSERT statements. I don't think I can use SSIS because the source autonumber fields may already exist on the destination side but I could be wrong.
For simplicity, Table 1 (T1) has one autonumber key of PK1 as well as other fields (A1, B1, etc.).
Table 2 (T2) has one autonumber key of PK2 and a foreign key (FK1) that links back to PK1 as well as other fields (A2, B2, etc.).
Table 3 (T3) has one autonumber key of PK3 and a foreign key (FK2) that links back to PK2 as well as other fields (A3, B3, etc.).
Like this:
T1: PK1, A1, B1, etc.
T2: PK2, FK1, A2, B2, etc.
T3: PK3, FK2, A3, B3, etc.
So, I'm able to query the source database T1 to generate my dynamic SQL INSERT statements that will be run on the destination side. I'm also able to generate my dynamic SQL statements to insert into T2 but when I get to T3 I currently am stuck figuring out how to insert because the destination side is unable to match it's FK2 to the just inserted PK2. It throws the 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.
View 3 Replies
View Related
Jan 18, 2005
I am using VS.net (2003) SQLcommand TEXT. with input params.
SQL server 2000
Can anyone tell me how to get the Identity value (field value, Idenity col) when you do an insert? I want to get the Identity value, then redirect the user to another page and use this identity value so they can update more (other) fields that are on that page.
My code so far that works... but Where do I put @@IDENTITY ?
How do I call or assign the @@IDENTITY value to a value in my aspx.vb code page?
Question: how do I get the Identity value from the ID column.
Question: How do I assign that value to some variable in code, say, assign it to (Session("App_ID")) = IdentityValueOrSomething?Help...
---------------------
INSERT INTO App
(AppName, Acronym, Description,bla bla bla bla........)
VALUES (@AppName, @Acronym, @Description, bla bla bla bla........)
-----------------------------
Private Sub btnAddApp_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAddApp.Click
With cmdAddApp
'.Parameters("@app_id").Value = Session("App_ID")
.Parameters("@AppName").Value = txtAppName.Text
.Parameters( bla bla bla.............
.Parameters( bla bla bla.............
.Parameters( bla bla bla.............
End With
Try
cnAppKBdata.Open()
cmdAddApp.ExecuteNonQuery()
cnAppKBdata.Close()
''''''''''''''Session("App_ID") = whatever the @@IDENTITY is....'''''''''''''''''''''''''''??
Response.Redirect("AppUpdate.asp")
Catch ex As Exception
End Try
End Sub
Anyone have the lines of code that does this?
Any advise or examples :) thanks you.
View 1 Replies
View Related
Nov 15, 2001
Does anyone know how to get the indentity of the last updated record in a table. I need it for a cascading trigger.
Thank you,
Jody
View 3 Replies
View Related
Mar 28, 2006
i have a table with the following fiels ,
Column NameDataType
Sno intIdentity = Yes , Identity Speed =1 , Identity Increament =1
namechar
Now i entered data and coneected to database, worked.Now after cheking all the data entered with the form , now i have to send the table to client place.
The problem is , the sno column has the value which i entered last. now if i delete all records , then also the record no doesnot become 0.
what i have to do, to set the sno column to 1 again.
View 3 Replies
View Related
Oct 29, 2006
Hi, I have 2 tables in my database PrescriptionHeader and PrescriptionDetails.My PrescriptionHeader table has the following fields:PrescriptionID -identity fieldPatientID PatientfNamePatientlname PrescriptionDetails table has the following fields:PrescriptionDetailID -identityPrescriptionID -from PrescriptionHeader table MedicineDosage The function InsertPrescription inserts values into the table PrescriptionHeader. I want the same function to then insert the value of MedicineDosage into PrescriptionDetails with the same PrescriptionID inserted into PrescriptionHeader. How do I tell the function to insert the PrescriptionID that was automatically inserted into PrescriptionHeader also into table PrescriptionDetails . How do I return the identity before proceeding to insert into PrescriptionDetails table?ThanksFunction InsertPrescription(ByVal PatientID As String, _ByVal PatientFname As String, _ByVal Patientlname As String, ByVal MedicineDosage as String)Dim DBAdapter As SqlDataAdapterDim DBDataSet As DataSetDim SQLString As StringDim DBCommandBuilder As SqlCommandBuilderSQLString = "SELECT * FROM PrescriptionHeader WHERE PrescriptionId = ''"DBAdapter = New SqlDataAdapter(SQLString, DBConnection)DBDataSet = New DataSetDBAdapter.Fill(DBDataSet)Dim AddedRow As DataRow = DBDataSet.Tables(0).NewRow()AddedRow("PatientID") = PatientIDAddedRow("PatientfName") = PatientFnameAddedRow("Patientlname") = PatientlnameDBDataSet.Tables(0).Rows.Add(AddedRow)DBCommandBuilder = New SqlCommandBuilder(DBAdapter)DBAdapter.Update(DBDataSet) End Function
View 1 Replies
View Related
Jan 30, 2008
Ok I've been researching this for a day now and I'm not coming up with much. I want to store the auto-incrementing ID of the last inserted record in a session variable, so that I may put it in a foreign key column in another table, if the user wishes to fill out a form on another page. I think my stored procedure is correct. But don't know what code to add to my aspx page. Any help will be greatly appreciated.
Here is my VB ScriptProtected Sub submitButton_Click(ByVal sender As Object, ByVal e As System.EventArgs)
Dim personalContactDataSource As New SqlDataSource()personalContactDataSource.ConnectionString = ConfigurationManager.ConnectionStrings("DataConnectionString1").ToString()
personalContactDataSource.InsertCommandType = SqlDataSourceCommandType.StoredProcedure
personalContactDataSource.InsertCommand = "PersonalContactInsert"
personalContactDataSource.InsertParameters.Add("FirstName", FirstName.Text)
personalContactDataSource.InsertParameters.Add("LastName", LastName.Text)personalContactDataSource.InsertParameters.Add("KeyPerson", KeyPerson.Checked)
personalContactDataSource.InsertParameters.Add("DayPhone", DayPhone.Text)personalContactDataSource.InsertParameters.Add("EveningPhone", EveningPhone.Text)
personalContactDataSource.InsertParameters.Add("Fax", Fax.Text)personalContactDataSource.InsertParameters.Add("Email", Email.Text)
personalContactDataSource.InsertParameters.Add("HomeAddress", HomeAddress.Text)personalContactDataSource.InsertParameters.Add("City", City.Text)
personalContactDataSource.InsertParameters.Add("State", State.Text)personalContactDataSource.InsertParameters.Add("Zip", Zip.Text)
personalContactDataSource.InsertParameters.Add("ReqEffectDate", ReqEffectDate.Text)personalContactDataSource.InsertParameters.Add("MRID", MRID.Text)
personalContactDataSource.InsertParameters.Add("CurrentPremium", CurrentPremium.Text)personalContactDataSource.InsertParameters.Add("CurrentCarrier", CurrentCarrier.Text)
personalContactDataSource.InsertParameters.Add("CurrentDeductible", CurrentDeductible.Text)personalContactDataSource.InsertParameters.Add("CurrentCoins", CurrentCoins.Text)personalContactDataSource.InsertParameters.Add("ReasonForQuote", ReasonForQuote.Text)
End Sub
And here is my Stored ProcALTER PROCEDURE dbo.PersonalContactInsert
@FirstName varchar(30),@LastName varchar(30),
@DayPhone varchar(14),@EveningPhone varchar(14),
@Fax varchar(14),@Email varchar(60),
@HomeAddress varchar(80),@City varchar(30),
@State char(2),@Zip char(5),
@KeyPerson bit,@ReqEffectDate smalldatetime,
@CurrentCarrier varchar(30),@CurrentPremium smallmoney,
@CurrentDeductible smallmoney,@CurrentCoins smallmoney,
@ReasonForQuote varchar(150),@MRID int,
@ClientNumber int OUT
AS
INSERT INTO PersonalContact(FirstName, LastName, DayPhone, EveningPhone, Fax, Email, HomeAddress, City, State, Zip, KeyPerson, ReqEffectDate, CurrentCarrier, CurrentPremium, CurrentDeductible, CurrentCoins, ReasonForQuote, MRID, DateTimeStamp)
VALUES(@FirstName,@LastName,@DayPhone,@EveningPhone,@Fax,@Email,@HomeAddress,@City,@State,@Zip,@KeyPerson,@ReqEffectDate,@CurrentCarrier,@CurrentPremium,@CurrentDeductible,@CurrentCoins,@ReasonForQuote,@MRID, GetDate())
SET @ClientNumber = SCOPE_IDENTITY()
RETURN
View 8 Replies
View Related
Oct 28, 2005
I am storing product information in a SQL Server database table; the product information has no unique fields so I have created an Identity field called ‘uid’. Is there a way of querying the table to find out what value will be given to the next ‘uid’ field before the next record is written to the table? I need to use this as a FK in other tables.
View 3 Replies
View Related
Mar 7, 2001
hello everyone
I have table that look like
CREATE TABLE GuestAccount
(
Id_Guest smallint,
SeqNo int IDENTITY(1,1),
account money Null
PRIMARY KEY(Id_Guest,SeqNo)
)
Q?
I want my SeqNo start from 1 for new Id_Guest
is it possible ?
tnanks
View 3 Replies
View Related
Aug 21, 2014
Best way to retrieve the identity key of the record just inserted?This question is for discussion purposes; the business process that spurred the question is currently working.Using SQL Server 2008 R2, a record is inserted from a stored procedure. Let's say the sp has something like this:
Code:
BEGIN
BEGIN TRANSACTION
INSERT INTO tblTools
([Desc],CreateDate,Model,CreatedBy,Notes)
[code]....
In Access, when you add a new record to the recordset, the identity field comes "pre-populated" making it east to get the actual, correct identity value assigned to the record you are inserting. In SQL Server, I know options include:
Code:
IDENT_CURRENT('tblX')
SCOPE_IDENTITY
@@IDENTITY
among other methods.
Each has pros and cons, such as user privileges (IDENT_CURRENT requires the user to have Select privileges on the table, and catches records created by other things, such as users and triggers), and the other two give you the last key inserted and don't allow specifying the object (which is a problem if the insert added records to multiple tables, or you have multiple inserts).
View 2 Replies
View Related
Oct 5, 2006
i recently found a little error in a stored procedure that was included in a project handed over to me....
the sp was rather simple. it just inserted a record into a table and returned the identity and the timestamp as follows
IF @@ERROR>0
BEGIN
SELECT @int_InterventionID = 0
RETURN @@ERROR
END
ELSE
BEGIN
SELECT @int_InterventionIDReturned = MAX(InterventionID) FROM tblIntervention
SELECT @ts_TimestampReturned = [Timestamp] FROM tblIntervention WHERE InterventionID = @int_InterventionIDReturned
SELECT @int_InterventionID = @int_InterventionIDReturned, @ts_Timestamp = @ts_TimestampReturned
RETURN 0
END
i figured that it should be using @@Identity for the interventionIdentity rather than max(InterventionID)
so i changed to...
IF @@ERROR>0
BEGIN
SELECT @int_InterventionID = 0
RETURN @@ERROR
END
ELSE
BEGIN
SELECT @int_InterventionIDReturned = @@IDENTITY
SELECT @ts_TimestampReturned = [Timestamp] FROM tblIntervention WHERE InterventionID = @int_InterventionIDReturned
SELECT @int_InterventionID = @int_InterventionIDReturned, @ts_Timestamp = @ts_TimestampReturned
RETURN 0
END
it returns the @int_InterventionIDReturned but the timestamp now comes back as null??? why??
how can i ensure that i always get the timestamp of the record it has just inserted
any help greatly appreciated,
Cheers,
Craig
View 3 Replies
View Related
Nov 26, 2005
We're using ASPUpload as a tool to upload files to our server and savethe details to SQLServer. However, I have an application where I needto return the pkID of the just saved file. I'm assuming that I coulduse the @@Identity command but cannot get this to function.Has anyone used this command with ASPUpload with an success, or anyother methods that could be used?Thanks.
View 8 Replies
View Related
Jan 16, 2006
Hi, All:Please help. I use sql server as back end and Access 2003 as front end(everything is DAO).A table on SQL server has an identity column as the key.We have trouble on adding records to this table using the following SQL.strSQL = "INSERT INTO myTableOnSQLServer (A, B, C, D, E) SELECT A, B, C, D,E FROM myTableonAccessLocal"db.execute strSQLThe schema of the table "myTableOnSQLServer" and the schema of the table"myTableonAccessLocal" are all the same except that the "myTableOnSQLServer"has an identity column (ID). The key of the "myTableOnSQLServer" is "ID" andthe table "myTableonAccessLocal" does not have a key.When we try to run the query, it gives errors indicating the key is violatedor missing.Should I figure out the autonumber for it first and then add to the SQLserver table?Many thanks,HS
View 1 Replies
View Related
Oct 7, 2015
I have table contains more columns and first column have ID int not null primary key and auto increment by 1 seed by 1 the ID 165000 record and instant Jump to 166000 and increment by 1 ...
View 5 Replies
View Related
Jun 23, 2006
Hello
Using Visual Studio 2005 Prof and SQL Server everywhere.
How do get the identity column value after insert record.
With SQL Server 2005, its quite easy to get by creating and insert statement on the tabledapter ( Insert statement followed by a select statement where identitycolumn = scope_identity())
How do this is sql everywhere??
regards
View 1 Replies
View Related
Jun 18, 2007
Hi all,
(I am using SQL Server 2005)
I have created a new 'CUSTOMERS' table and created a colum 'CustomerID' as an Identity column.
Now, a problem I find is that when I delete a particular record, its Identity value is used automatically for the New record I insert later!
I do not want to re-use the already used Identity value.
I just want to have the last CustomerID to be higher that all the previous ones.
Is there any way to do this?
Thanking you in advance,
Tomy
View 2 Replies
View Related
Jun 5, 2006
is there any way of getting the identity without using the "@@idemtity" in sql??? I'm trying to use the inserted event of ObjectDataSource, with Outputparameters, can anybody help me???
View 1 Replies
View Related
Nov 10, 2005
Hi,
I have just installed MS SQL in my computer and I am trying to run MS
SQL and Visual studio for the first time. However I have run into a
problem that I can't solve. Basically the problem is that the data I
fetch from the database is not being displayed/bound to the ddl I have
on the page.
I have used VS to configure the sqlDataAdapter, DataSet, sqlConnection,
and the sqlCommands. Basically the data is being fetched from the
Northwind sample database. From the preview option on the
sqlDataAdapter I am able to preview the information from the database.
So it seems to work. I have also configured the ddl settings so that
the Categories table is the datasource. I have also set the ddl.DataTextField = "CategoryName"; ddl
.DataValueField = "CategoryID";
When I compiled and run the page, no error messages are generated, but
the ddl is still completely blank and I can't understand why.
Does anybody know how I can solve this?? :s
View 3 Replies
View Related
Jul 19, 1999
When using sp_who and sp_who2 on SQL Server 6.5 I seem to get inaccurate results .
Each spid seems to be using the same host name, and the host name used is one that hasn't been connected to SQL server for several months.
Is there a problem with the connection management ? If so how do I find this out ? and how do I fix it ?
View 2 Replies
View Related
Jan 4, 2007
We have a SQL Server 2005 database which holds all the companies scanned documents (in image fields). I have developed a report which allows the user to search for a contract and all relevant scanned documents are returned.
When I preview the report with Visual Studio Report Designer...SOME of the images are not displayed, I get the little red cross icon in the top left corner.
When viewed using Report Manager with a browser... The report displays ALL images... However, when I click on the print button and then the print preview button in Report Manager, some of the images do not appear (the same images that don't appear in the Report Designer preview.
Can anyone tell why I can see all the images through Report Manager and my Browser (IE7) but only some of the images when in Report Designer preview or Print Preview?
Any help would be appreciated.
View 1 Replies
View Related
Feb 23, 2007
Hi,
I have setup Merge replication with 2 publishers and one subscriber. On the subscription machine I can see publisher 1 listed under local subscriptions but not publisher 2. I have created the second subscription on publisher 2 and also tried to create the subscription again on the subscription machine but i get an error saying the 'Subscription already exists'.
Neither do I see the second subscription nor does it work as if it is subscribed to Publisher 2. What could be going wrong.
I would appreciate any help.
Thanks
tribal
View 5 Replies
View Related
Jun 12, 2006
1. I am using the webservice to render the images from a report, and they dont render.
I paste this URL to the browser
http://agamenon:90/ReportServer?%2fGescomRpts%2fRPT_MediosDesarrollo&rs%3aFormat=HTML4.0&rs:ImageID=6c809239-753f-4988-abcf-231416dff0d6
and I get this
No se encuentra la secuencia. No se encuentra el identificador de secuencia proporcionado a una operación en la base de datos del servidor de informes. (rsStreamNotFound) Obtener ayuda en pantalla
This is the code
the problem is that I need to know the streamid, and to know the streamid I first have to render the report where the image is to be placed.
This is the page getimage.aspx
protected void Page_Load(object sender, EventArgs e)
{
string reportPath = Server.UrlDecode(Request["report"]);
//string streamID = Request["streamid"];
ReportExecutionService rs = (ReportExecutionService)Session["rs"];
DataSourceCredentials[] credentials = null;
string showHideToggle = null;
string encoding;
string mimeType;
string extension;
Warning[] warnings = null;
ParameterValue[] reportHistoryParameters = null;
string historyID = null;
string[] streamIDs = null;
ServerInfoHeader sh = new ServerInfoHeader();
rs.ServerInfoHeaderValue = sh;
byte[] result = null;
ParameterValue[] reportParameterValues2 = null;
string deviceInfo = "<DeviceInfo>" +
//"<StreamRoot>" + streamRoot + "</StreamRoot>" +
"<Toolbar>False</Toolbar>" +
"<Parameters>False</Parameters>" +
"<HTMLFragment>True</HTMLFragment>" +
"<StyleStream>False</StyleStream>" +
"<Section>0</Section>" +
"<Zoom>" +
"</Zoom>" +
"</DeviceInfo>";
result = rs.Render("HTML4.0", deviceInfo, out extension, out mimeType, out encoding, out warnings, out streamIDs);
string streamID = streamIDs[0];
string encodingImage;
string mimeTypeImage;
byte[] image;
ParameterValue[] pv = (ParameterValue[])Session["reportParameterValues"];
//image = rs.RenderStream(reportPath, "HTML4.0", streamID, null, null, pv, out encodingImage, out mimeTypeImage);
image=rs.RenderStream("HTML4.0", streamID, null, out encodingImage, out mimeTypeImage);
Response.Clear();
Response.ContentType = mimeTypeImage;
Response.AppendHeader("content-length", image.Length.ToString());
Response.BinaryWrite(image);
Response.Flush();
Response.Close();
}
and this is the page of the report. Sorry for the long code.
if (reportCanBeRendered)
{
string deviceInfo;
string streamRoot;
Session["rs"] = rs;
streamRoot = ("getimage.aspx?report="+ (path + "&streamid="));
switch (format)
{
case "HTML4.0":
case "HTML3.2":
deviceInfo = "<DeviceInfo>" +
"<StreamRoot></StreamRoot>" +
"<Toolbar>False</Toolbar>" +
"<Parameters>False</Parameters>" +
"<HTMLFragment>True</HTMLFragment>" +
"<StyleStream>False</StyleStream>" +
"<Section>0</Section>" +
"<Zoom>" +
"</Zoom>" +
"</DeviceInfo>";
break;
default:
deviceInfo = "<DeviceInfo></DeviceInfo>";
break;
}
// SQLRS-ReportViewer
if (!(reportParameterValues == null))
{
//reportParameterValues2 = reportParameterValues.ToArray(typeof(ParameterValue));
//reportParameterValues2 = (ParameterValue[])reportParameterValues.ToArray(typeof(ParameterValue));
}
DataSourceCredentials[] credentials = null;
string showHideToggle = null;
string encoding;
string mimeType;
string extension;
Warning[] warnings = null;
ParameterValue[] reportHistoryParameters = null;
string historyID = null;
string[] streamIDs = null;
ServerInfoHeader sh = new ServerInfoHeader();
rs.ServerInfoHeaderValue = sh;
byte[] result = null;
ParameterValue[] reportParameterValues2 = null;
result = rs.Render(format, deviceInfo, out extension, out mimeType, out encoding, out warnings, out streamIDs);
streamRoot = "getimage.aspx?report=" + path + "&streamid=" + streamIDs[0];
//string reportPath2 = Server.UrlDecode(Request["report"]);
//string streamID = streamIDs[0];
////string streamID = "";
//ReportExecutionService rs2 = new ReportExecutionService();
//Session["rs"] = rs;
//rs2=(ReportExecutionService)Session["rs"];
//////ReportingService rs = (ReportingService)Session["rs"];
//string encodingImage;
//string mimeTypeImage;
//byte[] image;
//ParameterValue[] pv = (ParameterValue[])Session["reportParameterValues"];
//////image = rs.RenderStream(reportPath, "HTML4.0", streamID, null, null, pv, out encodingImage, out mimeTypeImage);
//image = rs2.RenderStream("HTML4.0", streamID, null, out encodingImage, out mimeTypeImage);
//Response.Clear();
//Response.ContentType = mimeTypeImage;
//Response.AppendHeader("content-length", image.Length.ToString());
//Response.BinaryWrite(image);
//Response.Flush();
//Response.Close();
// store ReportingServices and parameters object is session layer in case we need it for image streams
Session["rs"] = rs;
Session["reportParameterValues"] = reportParameterValues2;
switch (format)
{
case "HTML4.0":
case "HTML3.2":
System.Text.Encoding enc = System.Text.Encoding.UTF8;
// get the report as a string
string tmpReport = enc.GetString(result);
// replace all occurrences of report server link with current page link
tmpReport = tmpReport.Replace(reportServerURL.Replace("/ReportService.asmx", "?"), ("http://"
+ (Request["SERVER_NAME"]
+ (Request["SCRIPT_NAME"] + "?Report="))));
ReportPlaceholder.InnerHtml = tmpReport;
break;
default:
Response.ClearContent();
Response.AppendHeader("content-length", result.Length.ToString());
Response.ContentType = mimeType;
Response.BinaryWrite(result);
Response.Flush();
Response.Close();
break;
}
}
View 4 Replies
View Related
May 22, 2008
This is a situation I haven't handled before.
I have a stored procedure which uses a column of a table. Unfortunately, the table exists, but the column does not. Still when we create or alter it, it shows 'completed successfully'.
Also, when this script is executed on another server, it gives the respective error, correctly.
Is there any database option or setting which has been tampered or changed by mistake.
Your helpful suggestions are welcome. Thanks in advance.
View 2 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
Nov 3, 2005
I have the following query where I want to add more user friendly names to the column names that are selected in the query. For instance, I want to display the field Articlegroupname as Product Category. How do I do this ithout altering the underlying field name in the database?
SELECT Article.articleId
, Article.articleGroupId
, POHeader.poHeaderId
, POHeader.poHeaderId
, POHeader.supplierId
, POHeader.locationId
, POHeader.deliverydate
, POHeader.poDeliveredValue
, POHeader.poStatus
, POHeader.estTotalValue
, POHeader.receivedTotalValue
, POHeader.poCurrMultiplier
, POHeader.poCurrCode
, POHeader.ourRef
, POHeader.yourRef
, POHeader.poComment1
, POHeader.poComment2
, POHeader.UserId
, POHeader.poCurrFactor
, POHeader.InternalExternal
, POHeader.CompanyId
, POHeader.CustKeyIn
, POLines.poLineId
, POLines.poHeaderId
, POLines.articleId
, POLines.orderQty
, POLines.receivedQty
, POLines.articleCost
, POLines.poLineStatus
, POLines.newPrice
, POLines.receiveddate
, POLines.UserId
, POLines.spesArticle
, POLines.invoicedPrice
, POLines.invoicedValuta
, POLines.invoicedNOK
, articleGroup.ArticleGroupName
, articleGroup.exportAccount
, articleGroup.exportDept
, Articlegroup_2.g2_name
, Article.abc_code
, Article.articleName
, Article.articleStatus
, Article.articleUnit
, Article.stockInfoId
, Article.suppliers_art_no
, Article.tex_color
, Article.tex_quality
, Article.tex_size_id
, Brands.brandLabel
, Location.locationName
, Sesong.Sesongnavn
, Sesong.sesongutgaatt
, Supplier.name
FROM HIP.dbo.POLines POLines
LEFT JOIN HIP.dbo.POHeader
ON POHeader.poHeaderId=POLines.poHeaderId
LEFT JOIN HIP.dbo.Article
ON Article.articleId=POLines.articleId
LEFT JOIN HIP.dbo.articleGroup
ON Article.articleGroupId=articleGroup.articlegroupid
LEFT JOIN HIP.dbo.Articlegroup_2
ON Article.articleGROUPid2=Articlegroup_2.Articlegrou p_2_Id
LEFT JOIN HIP.dbo.articleStock
ON Article.articleId=articleStock.articleId
LEFT JOIN HIP.dbo.Brands
ON ARTICLE.BRANDID=BRANDS.BRANDID
LEFT JOIN HIP.dbo.Location
ON POHeader.locationID=location.locationID
LEFT JOIN HIP.dbo.Sesong
ON Article.sesongID=Sesong.SesongId
LEFT JOIN HIP.dbo.Supplier
ON Article.supplierID=supplier.supplierID
View 1 Replies
View Related
May 4, 2006
Hi,
What I mean is:
I have a decimal(19,10) variable called @value and it has the value 66.6666666666
I can round it using ROUND(@value, 0) and the result is 67.000000000
But what I really want is to get rid of all the zero's and the decimal point so that I end up with just 67
Thanks in advance,
Ian.
View 6 Replies
View Related
Jul 23, 2015
All of a sudden my user variables are not displayed.
I know that they exist because the package run is successful.
For better, quicker answers on T-SQL questions, click on the following...
[URL]
For better answers on performance questions, click on the following...
[URL]
View 4 Replies
View Related
May 27, 2008
Hi Guys,
I am creating a report in Reporting Services 2000. I have a stored procedure that returns 4 columns with one column having 21 weeks of entries in it. I am using matrix to group these 21 weeks as 21 week columns created dynamically but when I preview the report it is only displaying columns for first 5 weeks.
Any idea why Reporting services is not displaying the rest of the columns? Any limitation on maxiumum number of columns that can be generated dynamically in SSRS 2000?
Any help will be highly appreciated.
View 3 Replies
View Related
Sep 27, 2007
Hello,
I have a Sales cube and I want to be able to display Products and the
Price at which they were purchased in a given period. I have a
Product dimension while Price is a measure in my Sales Fact Table. Is there a way to have a "Group By" aggregation instead of a Sum? This way, I can show Products grouped by their list price.
My Product Dimension consists of product_numbers (such as 100, 101,
102 etc...)
My Sales Fact Table consists of sales data (such as product_key,
price, net_sales, returns, etc...) at the transaction level.
I want to be able to view the data like this:
Price Net_sales Returns
Product
100 $5.99 $2005 $320
101 $3.51 $7110 $998
where Net_sales and Returns are "summed" and Price is simply a "Group
By". In other words, this report would show the net sales and returns
by product for a given price.
I'd rather not use a Price dimension since we have hundreds of
products at hundreds of different prices. Moreover, this data is
already in the Sales Fact table.
Thanks for any help provided
View 1 Replies
View Related