Master-Details Insert
Jan 21, 2007
Master table (tlbProduct) having productID as Primary key and
which acts as reference key for table (tlbCategory).
Fields for tlbProduct are productID,productName
Fields for tlbCategort are productID,CategoryID(primary key),CategoryName,Prize
both productID,CategoryID are autoincrementing.
but when i write two inserts simultaneously as follows
insert into tlbProduct(productName)values(@productName)
insert into tlbCategory(CategoryName,Prize) using sqldatasource
I get the error that ProductID value is null which is not provided
But (productId in both is autoincremented) and relationship is there in both tables
How to resolve this problem without adding ProductID in second Insert
?
SWati
View 1 Replies
ADVERTISEMENT
Jun 19, 2007
I got a File with sales orders and their details.
Step 1. First I am filtering the Sales Order information and inserting it in my Sales Orders table.
Step 2.Then I am filtering the details from the sales Order and inserting them in the respective table.
My Problem is that the Sales Order File does not contain the Sales Order key (ID), this is generated by the SQL Server. How can get it in order to use it in the second step? I need it because it is a foreign key in the details table.
Any Idea?
View 4 Replies
View Related
Mar 20, 2006
HI, I'm using Visual Web Developer and SQL Server 2005 Express Editions. I have a database with two tables, say AccountsTable and PersonsTable, with a one to many relationship respectively.
Given a particular selected record in PersonsTable, I need to look up the corresponding master record in AccountsTable. Here's what I've done:
SqlDataSource1 has a "SELECT * FROM PersonsTable" and a GridView1 which uses this as its datasource and the 'enable Selection' checkbox is On. This works fine.
Then, I create a second SqlDataSource2. When I click on the WHERE button in the Configure Data Source page, I have chosen the following parameters:
Column:PrimaryKeyField; Operator:=; Source=Control; ControlID=GridView1; Default Value='I left this blank' but the Value field shows GridView1.SelectedValue when I click the ADD button.
<asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:bizConnectionString %>"
SelectCommand="SELECT * FROM [AccountsTable] WHERE ([AccountNumber] = @AccountNumber)">
<SelectParameters>
<asp:ControlParameter ControlID="GridView1" Name="AccountNumber" PropertyName="SelectedValue"
Type="Int32" />
</SelectParameters>
</asp:SqlDataSource>
I have bound DetailsView1 to SqlDataSource2. When I run the page, the GridView1 is shown with Persons records OK. Then I click the 'Select' next to a record in the Gridview expecting the corresponding lookup to the master record (Account) to be shown in the DetailsView, but it does not show anything.
What am I doing wrong? Is there a better way of doing this?
Your help is much appreciated. Thank you.
PS. I could find Tutorials showing Master/Details retrieving records in a top down fashion (1:n), but I could not find the reverse (n:1)
View 6 Replies
View Related
Jan 25, 2006
My question is setting up master detail pages using stored procedrues. In the tutorials C# Master-Details (Seperate Pages) example they use the following code for the master page for the navigation.
<asp:HyperLinkField HeaderText="View Details..." Text="View Details..." DataNavigateUrlFields="au_id" DataNavigateUrlFormatString="DetailsView_cs.aspx?ID={0}" />
The call to the Details Page DetailsView_cs.aspx uses the following code
<asp:SqlDataSource ID="SqlDataSource1" Runat="server" SelectCommand="SELECT dbo.authors.au_id, dbo.titles.title_id, dbo.titles.title, dbo.titles.type, dbo.titles.price, dbo.titles.notes FROM dbo.authors INNER JOIN dbo.titleauthor ON dbo.authors.au_id = dbo.titleauthor.au_id INNER JOIN dbo.titles ON dbo.titleauthor.title_id = dbo.titles.title_id WHERE (dbo.authors.au_id = @au_id)" ConnectionString="<%$ ConnectionStrings:Pubs %>"> <SelectParameters> <asp:QueryStringParameter Name="au_id" DefaultValue="213-46-8915" QueryStringField="ID" /> </SelectParameters> </asp:SqlDataSource>
I can replicate the example calling the detail page but I am unable to make the detail page work when using a stored procedure as the asp:SQLDataSource. Using the above sql code as a stored procedure in the <SelectParameters> I am not able to return the data set using either asp:QueryStringParameter or asp:Parameter as I have built other forms using stored procedures and have tested the procedure and know that it works. Can someone point me in the right direction.
Thanks
View 2 Replies
View Related
May 22, 2001
i have go master records as well child records
how do i delete all the master records so that all
my corresponding child records get deleted ,as we do in
oracle using undeleted cascade
please help me
manas
View 1 Replies
View Related
Sep 15, 2006
Hi,
I am having problem in getting result out of two table, one table is Item Mater which stores global items for all offices and other is stock file which stores office wise stock items as follows:
ITEM MASTER
--------------
NCODE ITEMNAME
1 A
2 B
3 C
4 D
5 E
STOCKDETAILS
-----------------------------------
NCODE ITEMCODE OFFICEID
1 1 1
2 2 1
3 3 1
4 1 2
5 2 2
6 4 2
7 5 3
I want office wise stock details which inludes items found in stock file and remaining itmes from item master. example for office 1
--------------------------------------------
FOR OFFICE - 1
--------------------------------------------
ITEMCODE ITEMNAME OFFICEID
--------------------------------------------
1 A 1
2 B 1
3 C 1
4 D NULL
5 E NULL
i want a single view from which i can select data like i shown above, any kind of help is highly appriciated, what i tried is , i created union of both tables and tried to get data out of union view but result is not up to desire.
Thanks in advance
View 8 Replies
View Related
Dec 7, 2007
I have the following data
MASTER
id
name
DETAIL
id
master_id
name
I want a perform a query where i can get all the rows of the master table which have no relationed rows in detail table.
How can I do that???
View 1 Replies
View Related
Sep 11, 2006
Hello, I'm new to the forum and new to SQL, ASP.NET, etc. I am creating an intranet site for my company in VS 2005 and have run into a very annoying problem that I can't seem to solve. I have tried Googling it and came up empty. I have a database in SQL Express 2005 and my website will be accessing several tables within the database. I can retrieve info just fine and I can update, delete, etc just fine using gridview or other prebuilt tools, but when I add a few text boxes and wire a button to the SqlDataSource.Insert() command, I get a new record that is full of null values except for the identity key I have set. The kicker is that I am also using a master page and when I duplicate the web page without the master page link, everything works just fine. The following snippets show what I'm doing:<InsertParameters><asp:FormParameter Name="Name" Type="String" FormField="txtName" /><asp:FormParameter Name="Location" Type="String" FormField="ddlLocation" /><asp:FormParameter Name="Issue" Type="String" FormField="txtProblem" /></InsertParameters>Of course I match the formfields to the text boxes, create an onclick event for my button, the sqldatasource is configured correctly, it just doesn't work with the master page no matter what I do. Any help would be appreciated. Thanks
View 3 Replies
View Related
Apr 12, 2007
I have tried just about everything i could find on the internet to fix this.
Anyway.....I have a sql databasewith 3 colums: Client ID, Client Name, and Client Address
I have no trouble reading the database through the gridview, but when i try to add a script that allows me to add to that database off of my site, I get error after error.
Anyone who can figure this out must be a sql genius (or I am a complete idoit).
Here is the code I have so far:
<%@ Page Language="VB" MasterPageFile="~/MasterPage.master" %>
<asp:Content ID="Content1" runat="server" ContentPlaceHolderID="ContentPlaceHolder1">
<script runat="server">
Dim strClient_Name As String
Dim strClient_Address As String
</script>
<asp:DetailsView ID="DetailsView1" runat="server" AutoGenerateRows="False" DataKeyNames="Client ID"
DataSourceID="SqlDataSource1" Height="50px" Width="125px">
<Fields>
<asp:BoundField DataField="Client Name" HeaderText="Client Name" SortExpression="Client Name" />
<asp:BoundField DataField="Client Address" HeaderText="Client Address" SortExpression="Client Address" />
<asp:BoundField DataField="Client ID" HeaderText="Client ID" InsertVisible="False"
ReadOnly="True" SortExpression="Client ID" />
<asp:CommandField ShowInsertButton="True" />
</Fields>
</asp:DetailsView>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:clientInfoConnectionString %>"
InsertCommand="INSERT INTO [Clients] ([Client Name], [Client Address]) VALUES (strClient_Name, strClient_Address)"
SelectCommand="SELECT [Client Name], [Client Address], [Client ID] FROM Clients">
</asp:SqlDataSource>
</asp:Content>
Best Regards and Thank You,
The King
View 6 Replies
View Related
Jul 23, 2005
I use Ftp to import a comma delim file.Problem:Day 1 file has 5 records. During the course of Day 1 ,users makechanges to a field in the five records.Day 2 has same 5 records as they were at the beginning of Day 1(withoutchanges made during Day 1) plus 1 new record.I need a statement that will only add the 1 new record to the mastertable and leave the other 5 fields alone.I have a composite key that prevents duplicate addition.My original idea was to have a master table(Day 1) and a dailytable(Day 2) and do some kind of join that would give we only therecords in Day 2 that do not appear in Day 1 using the Composite key.This has not worked.Any ideas?
View 2 Replies
View Related
Sep 30, 2007
Hi !
I want to insert master/detail data using transaction if while insert if error it will Rollback. Help me! Thanks
View 2 Replies
View Related
Oct 1, 2007
now i want to learn how to make a stored procedure to insert a record to `purchase` table, and many records to `purchase_detail` table with transaction where the some value are passed from vb6 through the parameters. i've made a SP to insert 1 record to `purchase` table n 1 record to `purchase_detail` just for testing, so i set the disc value to 10. it works fine... --------------------------------------------------------------------------------- CREATE PROCEDURE `usp_save_purchase`(xpurch_id VARCHAR(10), xpurch_date VARCHAR(10), xsupp_id VARCHAR(10), xitem_id VARCHAR(10), xqty TINYINT(3), xprice DOUBLE(15,2)) BEGIN START TRANSACTION; INSERT INTO purchase(purch_id,purch_date,supplier_id) VALUES(xpurch_id, xpurch_date, xsupplier_id); INSERT INTO purchase_detail(purch_id,item_id,qty,price,disc) VALUES(xpurch_id, xitem_id, xqty, xprice, 10); COMMIT; END --------------------------------------------------------------------------------- what i need is something like that but i only pass 3 variables (purch_id, purch_date, and supp_id) to SP, and then the SP will insert 1 record of purchase to `purchase` table, and add the purchase items to `purchase_detail` automatically from `purch_temp` table, and use the disc rate based on `supplier_id` and `item_id` from supplier_disc table, which will be looked something like this: --------------------------------------------------------------------------------- CREATE PROCEDURE `usp_save_purchase`(xpurch_id VARCHAR(10), xpurch_date VARCHAR(10), xsupp_id VARCHAR(10)) BEGIN START TRANSACTION; INSERT INTO purchase(purch_id,purch_date,supplier_id) VALUES(xpurch_id, xpurch_date, xsupplier_id); /*start looping here get the disc rate for each items where supp_id = xsupplier_id and item_id = the item_id from purch_temp table, and save it in a local variable (let's say local_disc) INSERT INTO purchase_detail(purch_id,item_id,qty,price,disc) VALUES(xpurch_id, xitem_id, xqty, xprice, local_disc); */ COMMIT; END --------------------------------------------------------------------------------- can anyone help me please? thank you in advance...
View 1 Replies
View Related
Feb 4, 2015
I have a master table with after insert trigger on it.. When record is inserted into master table, the trigger fires and is captured in the backoffice table. In case the trigger fails, my record is neither in the master table nor in the back office table..
Is there anyway to capture the record either in the master table or in a separate table.
View 6 Replies
View Related
Mar 14, 2015
I have two tables. Order table and order detail table.
What I want to do is send notification to a service when an order is created. And I want to include both header and detail of the order.
I can't get working with on insert trigger . How to go around with trigger ?
View 1 Replies
View Related
Oct 17, 2007
I am developing an application in vb.net 2005 using SQL Server 2000.
In this I have two tables SessionMaster and SessionChild.
Fields of session master - SessionMastId, Start_Date, End_Date, Session_Type,
Fields of session child - SessionChildId, SessionMastId, UserName, Comment.
SessionMastId and SessionChildId are primary keys of respective tables and also they are auto increment fields.
Please how to write trigger to insert record into both tables at a time.
View 2 Replies
View Related
Dec 21, 2012
I have an API which uses the MDS WCF methods to update and insert entity members into MDS. Its working as expected. But whenever a entity member is inserted or updated, the validation flag is set to "requires re-validation" (With "?" symbol). Is there a setting which has to be set to validate the record once inserted or updated by API? Or should it be validated explicitly once the insert or update happens?
View 4 Replies
View Related
Feb 9, 2007
Hi,
My scenario:
I have a master securities table which has 7 fields. As a part of the daily process I am uploading flat files into database tables. The flat files contains the master(static) security data as well as the analytics(transaction) data. I need to
1) separate the master (static) data from the flat files,
2) check whether that data is present in the master table, if not then insert that data into the master table
3) If data present then move that existing record to an history table and then update the main master table.
All the 7 fields need to be checked to uniquely identify a single record in the master table.
How can this be done? Whether we can us a combination of data flow items or write a sql procedure to do all this.
Thanks in advance for your help.
Regards,
$wapnil
View 4 Replies
View Related
Mar 25, 2008
Hello,
I'm new to SQL and need help with a query. Not sure if this is the right place.
I have 2 tables, one MASTER and one DETAIL.
The MASTER table has a masterID, name and the DETAIL table has a detailID, masterID, and value columns.
I want to return a populated MASTER table with entries based on the DETAIL.value.
SELECT MASTER.*
FROM MASTER
WHERE DETAIL.value > 3
This is a simplified version of my problem. I can't figure out how to set the relationship between MASTER.masterID and DETAIL.masterID. If I do an INNER JOIN, the number of results are based on the number of DETAIL entries. I only want one entry per MASTER entry.
Hope this makes sense.
How can I do this?
GrkEngineer
View 9 Replies
View Related
Nov 30, 2007
Hi,
Is there any way to capture the log details such as row count of the data flow,number of success rows and failed rows in a separate table?
View 3 Replies
View Related
Aug 15, 2004
Well I made a bussiness object for registering users as well as logging them in. I dont know if my bussiness obect is screwed up or if its the database, or the SQL syntax or what. Please take a look at this. I am not getting any error messages, but nothing is being added to the server. I am using MSDE for the SQL Server.
Here's my bussiness object:
Imports System
Imports System.Data
imports System.Data.oledb
NameSpace LoveShare
Public Class UserDetails
public UserID AS Integer
public FirstName AS String
public LastName AS String
public UserName AS string
public Password AS String
public Address AS String
public City AS String
public State AS String
public Zip As Integer
public Email AS String
End Class
Public Class User
Private objConn As New oledbConnection("Provider=sqloledb;Data Source=GARAGESALELOVESHARE;Initial Catalog=LoveShare1;User Id=sa;Password=notonthispost;")
Public function Login(strUsername AS String, strPassword As String) As Integer
dim intID as integer
dim objparam AS new oledbparameter
dim objcmd AS oledbCommand
objCmd = new oledbCommand("dbo.SPLoginUser", objconn)
objcmd.commandtype = commandtype.Storedprocedure
objparam = New oledbparameter("@UserName", oledbtype.Char)
objParam.Value = strUserName
objCmd.Parameters.Add(objParam)
objParam = New oledbParameter("@Password", OleDbType.Char)
objParam.Value = strPassword
objCmd.Parameters.Add(ObjParam)
Try
objConn.Open
intID = CType(objCmd.ExecuteScalar, Integer)
objConn.Close
Catch e As Exception
Throw e
End Try
If intID.toString = "" Then
return 0
End if
Return intID
end function
Public Sub AddUser(objUser As UserDetails)
Dim intId as integer
Dim objReader As oledbdataReader
Dim objCmdID As New oledbCommand("SELECT MAX(userID) FROM tblUsers", objconn)
Dim objcmd AS New oleDBCommand("spAddUser", objConn)
Dim objparam AS OleDbParameter
objCmd.CommandType = CommandType.StoredProcedure
objParam = New oleDbParameter("@FirstName", oledbtype.Char)
objParam.value = objuser.FirstName
objCmd.Parameters.add(objParam)
objParam = New oleDbParameter("@LastName", oledbtype.Char)
objParam.value = objuser.LastName
objCmd.Parameters.add(objParam)
objParam = new oleDbParameter("@UserName", oledbtype.Char)
objParam.Value = objUser.UserName
objCmd.Parameters.Add(objParam)
objParam = New oleDbParameter("@Password", oledbtype.Char)
objParam.value = objuser.Password
objCmd.Parameters.add(objParam)
objParam = New oleDbParameter("@Email", oledbtype.Char)
objParam.value = objuser.Email
objCmd.Parameters.add(objParam)
objParam = New oleDbParameter("@Address", oledbtype.Char)
objParam.value = objuser.Address
objCmd.Parameters.add(objParam)
objParam = New oleDbParameter("@City", oledbtype.Char)
objParam.value = objuser.City
objCmd.Parameters.add(objParam)
objParam = New oleDbParameter("@State", oledbtype.Char)
objParam.value = objuser.State
objCmd.Parameters.add(objParam)
objParam = New oleDbParameter("@Zip", oledbtype.Integer)
objParam.value = objuser.Zip
objCmd.Parameters.add(objParam)
Try
objConn.Open
ObjCmd.ExecuteNonQuery
objUser.UserID = CType(objCmdID.ExecuteScalar, Integer)
objConn.Close
Catch e AS Exception
Throw e
End try
If objUser.UserID.ToString = "" then
objuser.UserID = 25
End if
End Sub
End Class
End NameSpace
Here's is my stored procedure for the registration:
CREATE PROCEDURE [dbo].[SPAddUser]
@FirstName VarChar(255),
@LastName VarChar(255),
@UserName VarChar(255),
@Password VarChar(255),
@Email VarChar(255),
@Address VarChar(255) ,
@City VarChar(255),
@State VarChar(255) ,
@Zip [INT]
AS
INSERT INTO tblUsers (FirstName, LastName, UserName, Password, Email, Address, City, State, Zip)
VALUES (@FirstName, @LAstName, @UserName, @Password, @Email, @Address, @City, @State, @Zip)
GO
And here is the actual registration page
<%@ Page Language="VB" %>
<%@ Register tagPrefix="LoveShare" TagName="Header" src="head.ascx" %>
<%@ Register tagPrefix="LoveShare" TagName="Menu" src="Men.ascx" %>
<%@ Register tagPrefix="LoveShare" TagName="Stats" src="Stats.ascx" %>
<%@ Register tagPrefix="LoveShare" TagName="Footer" src="foot.ascx" %>
<%@ Import Namespace="system" %>
<%@ Import NameSpace="System.Data" %>
<%@ Import NameSpace="LoveShare" %>
<script runat="server">
Public sub Submit(sender as object, e as eventargs)
If Page.IsValid then
dim objuserdetails as New LoveShare.UserDetails
dim objuser As New LoveShare.User
objuserDetails.FirstName=tbFirstName.Text
objuserDetails.LastName=tbLastName.Text
objUserDetails.Username=tbUserName.Text
objuserDetails.Password=tbPassword.Text
objUserDetails.Email=tbEmail.Text
objUserDetails.Address=tbAddress.Text
objUserDetails.City=tbCity.Text
objUserDetails.State=tbState.Text
objuserDetails.Zip=tbState.Text
ObjUser.AddUser(objUserDetails)
Session("UserID") = objUserDetails.UserID
FormsAuthentication.SetAuthCookie(objUserDetails.UserID, false)
Response.Redirect("index.aspx")
else
lblMessage.text="Information entered incorrectly"
End If
End Sub
</Script>
<html>
<body BGCOLOR="00ccFF">
<Table Width="800">
<tr>
<td>
<table cellpadding="0" cellspacing="0" width="100%">
<tr>
<td>
<LoveShare:Header runat="server" />
</td>
</tr>
<tr>
<td>
<Table cellpadding="0" cellspacing="15" Width="800">
<tr>
<td>
</td>
<td>
<td>
<form runat="server">
<table cellpadding="3" cellspacing="0" width="100%">
<tr>
<td colspan="2" Align="center">
<Font size="6">Sign Up Today!<BR><BR></Font>
</td>
</tr>
<tr>
<td Align="Center">
<Font color="red">
<asp:label id="lblMessage" runat="server" />
</font>
</td>
</tr>
<tr>
<td Align="right">First Name:</td>
<td Align="Left"><asp:textbox id="tbFirstName" runat="server" />
<asp:requiredfieldValidator runat="server" Controltovalidate="tbFirstName" ErrorMessage="First Name Required" Text="Forgot First Name" Display="Dynamic"/>
</td>
</tr>
<tr>
<td Align="right">Last Name:</Td>
<td Align="Left"><asp:textbox id="tbLastName" runat="server" />
<asp:requiredfieldValidator runat="server" Controltovalidate="tbLastName" ErrorMessage="Last Name Required" Text="Forgot Last Name" Display="Dynamic"/>
</td>
</tr>
<tr>
<td Align="right">Desired UserName:</td>
<td Align="Left"><asp:textbox id="tbUserName" runat="server" />
<asp:requiredfieldValidator runat="server" Controltovalidate="tbUserName" ErrorMessage="UserName required" Text="Forgot UserName" Display="Dynamic"/>
</td>
</tr>
<tr>
<td Align="right">Password:</td>
<td Align="Left"><asp:textbox id="tbPassword" Textmode="Password" runat="server" />
<asp:requiredfieldValidator runat="server" Controltovalidate="tbPassword" ErrorMessage="Password Required" Text="Forgot Password" Display="Dynamic"/>
</td>
</tr>
<tr>
<td Align="right">Verify Password:</td>
<td Align="Left"><asp:textbox id="tbVPassword" Textmode="password" runat="server" />
<asp:requiredfieldValidator runat="server" Controltovalidate="tbVPassword" ErrorMessage="Verify Password" Text="Forgot to verify Password" Display="Dynamic"/>
</td>
</tr>
<tr>
<td Align="right">Email Address:</td>
<td Align="Left"><asp:textbox id="tbEmail" runat="server" />
<asp:requiredfieldValidator runat="server" Controltovalidate="tbEmail" ErrorMessage="Email address required" Text="Forgot Email address" Display="Dynamic"/>
</td>
</tr>
<tr>
<td Align="right">Verify Email Address:</td>
<td Align="Left"><asp:textbox id="tbVEmail" runat="server" />
<asp:requiredfieldValidator runat="server" Controltovalidate="tbVEmail" ErrorMessage="Must verify Email address" Text="Verify Email address" Display="Dynamic"/>
</td>
</tr>
<td Align="right">Street Address</td>
<td Align="Left"><asp:textbox id="tbAddress" runat="server" />
<asp:requiredfieldValidator runat="server" Controltovalidate="tbAddress" ErrorMessage="Street Address Required" Text="Forgot Address" Display="Dynamic"/>
</td>
</tr>
<tr>
<td Align="right">City:</td>
<td Align="Left"><asp:textbox id="tbCity" runat="server" />
<asp:requiredfieldValidator runat="server" Controltovalidate="tbCity" ErrorMessage="City Required" Text="Forgot City" Display="Dynamic"/>
</td>
</tr>
<tr>
<td Align="right">State:</td>
<td Align="Left"><asp:textbox id="tbState" runat="server" />
<asp:requiredfieldValidator runat="server" Controltovalidate="tbState" ErrorMessage="State Required" Text="Forgot State" Display="Dynamic"/>
</td>
</tr>
<tr>
<td Align="right">Zip:</td>
<td Align="Left"><asp:textbox id="tbZip" runat="server" />
<asp:requiredfieldValidator runat="server" Controltovalidate="tbZip" ErrorMessage="Zip Code Required" Text="Forgot Zip" Display="Dynamic"/>
</td>
</tr>
<tr>
<td Align="right"> </td>
<td Align="Left"><asp:button id="btsignup" text="Sign Up" onclink="submit" runat="server" />
</tr>
</table>
</form>
</td>
<td>
</td>
</tr>
</table>
</td>
</tr>
</tr>
<td>
</td>
</tr>
<tr>
<td>
<LoveShare:Footer runat="server" />
</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>
Please help, I cannot figure out what is wrong
View 1 Replies
View Related
Mar 10, 2005
Hi,
I need to get the index_name,colum_name and table_name in entire database.
Coule you let me know how I can get that details.
Thanks,
View 7 Replies
View Related
Sep 28, 2006
Hi,
I used my DB and some tables for replication earlier, now i removed my all replication subscription and publication and my DB is out of replication.
Now i am altering my table for PK then its giving err as follows:
Cannot alter the table 'mstparty' because it is being published for replication.
From where i can find details, i mean in which sys table all replication obj are stored.
There is no Replication now on DB then why still table 'mstparty' has a replication err when i alter table.
Please advice as i am not able to alter my table or tables which earlier i used in replication and now i removed replication.
View 5 Replies
View Related
Apr 5, 2007
I have a database which has contact column eg. Mr Peter Smith
I am writing a new database which is to have three seperate columns.. saluation, first name and surname. What would be the best way to split the column up?? I was thinking on concentrating on the spaces??
Note: some conacts may not have saluation inc in the contact column, and in this case the saluation column should be blank...
Thanks
View 1 Replies
View Related
Apr 30, 2007
Hello
Is there any script or procedure which can give the object name , type ,status and owner in a database.
Thanks
View 2 Replies
View Related
Aug 28, 2007
Can somebody please go in depth detail what exactly is done in OLAP? i know it deals with the data warehouse end. but what does the SQL DBA do in the OLAP end? please elaborate. thanks.
View 5 Replies
View Related
Jul 23, 2005
How can i get the details of the error in sql server 2000 such where itoccurs in which line. I need something like i get in sql query analyzer.--Message posted via http://www.sqlmonster.com
View 4 Replies
View Related
Apr 28, 2008
I Have so many user create trigger's in my database
like create trigger trig_name
Now i want to see what does what and delete the unnecessary ones.
How can i See the logic in the trigger.
I can get the trigger name but not the logic using this query .
SELECT S2.[name] TableName, S1.[name] TriggerName,
CASE
WHEN S2.deltrig = s1.id THEN 'Delete'
WHEN S2.instrig = s1.id THEN 'Insert'
WHEN S2.updtrig = s1.id THEN 'Update'
END 'TriggerType' , 'S1',s1.*,'S2',s2.*
FROM sysobjects S1 JOIN sysobjects S2 ON S1.parent_obj = S2.[id]
How to see the logic.
View 6 Replies
View Related
Dec 12, 2006
Where is, (or even does it exists) the best place to look for some details on when package execution fails if running as a scheduled job. Obviously when you run from the command line or in VS, there is plenty of output detail on progress and on the source of errors, but when you run it as a scheduled job, it just says step 1 failed in the sql server log, and package foo failed in the NT application log . Is there anywhere to find this info or do we need to build error traps into the package to write stuff out somewhere?
THX
Dave
View 2 Replies
View Related
Nov 2, 2015
We already integrated different client data to MDS with MS Excel plugin, now we want to push back updated or new added record to source database. is it possible do using MDS? Do we have any background sync process to which automatically sync data to and from subscriber and MDS?
View 4 Replies
View Related
Nov 23, 2006
First, soapbox questions for someone who might have more direct pull with Microsoft (or at least knowledge of how I should work with what they've given us), then a more specific question:
Scenario: You install SQL Server Express (or any other version, it doesn't matter) and the feedback with all the little green checkmarks tells you it has installed successfully. "Oh goody," say people (like me) who are not super experienced with SQL Server, "it installed successfully; now I can jump in and start using it!" But it aint so--there are so many other hoops to jump through before it really becomes operational.
After successful installation, why can't some link become visible indicating what you have to do after that? I mean, it's fine to wade through all the questions in this forum and get answers from all you nice and informed guys, AFTER the problems start coming; but I would rather not have to associate with you, to be honest, in terms of time spent that could be going into my projects.
Why isn't there a comprehensive guide right off the bat? That is, something referenced immediately that tells you such things as: how to register a database with emphasis on the fact that just creating a database won't do the trick for your application; how to set permissions and rights; that (what was I reading in the advice of one post?) you have to register both the database and the user, blah blah; all about instances, the web.config file, etc. etc. I mean, doesn't it seem logical that by virtue of a person installing the database, come on, that this is a pretty good indication that he/she in all likelihood is new at it? As it is now, all they tell you on the SSE site is that you have to have the .NET Framework installed; and the green checkmarks indicating that you've installed it correctly (sorry for mentioning that twice).
"OK, self," I say, "I have the Framework installed and SSE installed correctly, so let's get to work." Then the trouble begins. Unless Microsoft's purpose is to keep you tech guys and book writers in business, I don't understand why they don't give more up-front guidance. Any thoughts on why they work it this way? Bueller, Bueller? Anyone, anyone?
Now, to the question that's pressing me at the moment: I've installed SSE and I'm going through a tutorial ("How Do I: Create Data-Driven Web Sites?" on http://www.asp.net/getstarted/default.aspx?tabid=61). Yeah, the guy makes it look really easy. He creates a database then shuts down the connection. I try to do the same things and I'm informed that I don't even have a valid connection! How SQL-Server-Express fun and easy is that? It's a real AdventureWorks, if you ask me.
OK, that's my rant; and since MS didn't think in advance and implement my idea of a link to jump off from the installation menu, I have to face the reality of learning this by putting all the pieces together myself. So, my question is, before I try to go through the video and get more frustrated, WHERE DO I GO FOR THE MOST BASIC OF ALL THE STEPS I NEED TO DO, ONE BY ONE? This is like the second "beginner" video I've tried to go through but even these don't start at the very beginning with information on how to register a new database, making the user a part of aspnetWHATEVER, what permissions to dole out, etc.
Guidance is solicited and will be most appreciated. Thanks, Bryan
View 1 Replies
View Related
Jul 14, 1999
Does anyone know if the enhanced data types (character length up to 8,000 bytes for some types) and the increase in the number of tables used in joins are available when using the 65 backward compatibility mode?
Many thanks in advance...
View 1 Replies
View Related
Aug 31, 2004
Please may I have your assistance with the following
I’m struggling to view the transaction log for a database.
I’m using the following command structure
DBCC log ( {dbid|dbname}, [, type={-1|0|1|2|3|4}] )
PARAMETERS:
Dbid or dbname - Enter either the dbid or the name of the database
in question.
type - is the type of output:
0 - minimum information (operation, context, transaction id)
1 - more information (plus flags, tags, row length)
2 - very detailed information (plus object name, index name,
page id, slot id)
3 - full information about each operation
4 - full information about each operation plus hexadecimal dump
of the current transaction log's row.
-1 - full information about each operation plus hexadecimal dump
of the current transaction log's row, plus Checkpoint Begin,
DB Version, Max XACTID
Which I got from a web site, however the output does not make sense to me
Ideally I would like to analyse which SQL insert commands are predominantly using the log file
Any ideas how to do this or a tool that u recommend
Thanks in advance for your help
:confused:
View 4 Replies
View Related
Feb 13, 2006
Need to ask this, 'cause as ya'all know I'm a GUID sort of guy with a sever IDENTITY crisis.
Got a client that erroneously deleted some records from a table with an IDENTITY key. We have a backup that we can restore to a new db to isolate the records that need to be reloaded. Question is, when we set IDENTITY INSERT to ON temporarily to reload the affected records, does the db need to be in single-user mode, or will it go merrily on creating IDENTITY values for new records if the db is in use during our fix? It is a 24/7 production db with web users around the country/world.
View 4 Replies
View Related