Totally Confused Connecting Two Tables?

Jan 30, 2008

 Hello everyone.
 I need some assistance here.
 I have a web form to get information about user details.
 The web form has two parts.
 the first part is user personal information  where there is few textboxes, dropdownlist , radiobuttons , checkbox etc.
 this is where user inputs his personal information.
 the second part contains the office information where there is few textboxes, dropdownlist , radiobuttons , checkbox etc too.
 but the second part is automatically populated by data from the database(lets say table1).
 this happens as soon as user selects an option from dropdownlist in second part(here an option for dropdownlist is name of the office) .
 there is also a save and cancel button at the end of the form.
now what i want here is, whenever i click a save button in my webform,
i want the data of first part of my webform (ie user personal information) to get stored in new table(say table2).
but i dont want the data of secont part of my webform(ie office information) to get stored in table2.(coz its already stored in table1.thats from where
it got populated earlier).
But i want a reference of second part of my web form(ie office info) in table2.(only the reference id of related data from table1.not the whole data)
and finally i want to display data from both the tables in one single details view.(both personal and office information)

i hope u people are gettin it?

i know i have to use foriegn keys.but i dont know how to use in this case.(sql express)

and can u plz explain how to implement this in cs file with example including source code.(c#, vwd2005 express, sql express).
 
thanks.
 
jack. 

 
 
  

View 5 Replies


ADVERTISEMENT

Brand New / Totally Confused / Am I In The Right Place?

Apr 26, 2006

I downloaded MS SQL Server 2005 Express Edition. The MS site said that it was "easy to install, use and manage." However I'm totally confused. I'm not a total neophyte but I can't even seem to launch the program.

I have an MS SQL database powering my website. I view the database on my home computer using MS Access 2000 with an ODBC connection. MS Access 2000 however, does not let me make changes to the structure of the database. I can't add, delete or modify fields in my current tables. I can't add or delete tables. Is MS SQL Server 2005 Express Edition the proper software to perform these functions? If it is, is there a guide to helping me launch the program, connect to my MS SQL database and perform these functions? If this is not the right software, what is?

I would greatly appreciate any guidance anyone can offer.

Thanks!

View 1 Replies View Related

Confused With Linking Tables

Dec 13, 2007

Hi and thanks for taking the time to read this. I get really confused really quickly when it comes to table linking, and I think I am doing it the hard way. I am going to show my stupidity and ask if there is a better way than what I do, because it takes a LOT of querying and seems like a huge waste.

In reality, I have about 20 tables to join like this, but I'm going to use three for the example:

"Main" Table
AcctNoNameHeightWeight
1Bob13
2Phil21
3Jim15
4Lisa22

"Height" Table
HeightIDHeightName
1Giant
2Tall
3Medium
4Short

"Weight" Table
WeightIDW_Name
1Skinny
2Normal
3Overweight
4Obese


What I have been doing is:

SELECT
Main.AcctNo,
Main.Name,
Height.HeightName,
Weight.WeightName
FROM
Main
INNER JOIN Height ON
Height.HeightID = Main.Height
INNER JOIN Weight ON
Weight.WeightID = Main.Weight
WHERE Main.AcctNo < 3


My question: is doing 20 INNER JOINS really the best way to do this with 20 tables, or is there some other way to link Main.Height to Height.HeightID that is less intensive?

Thanks again for reading, and in advance for any information or insight you can provide.

View 1 Replies View Related

System Tables, Dynamic Management Views: Confused

Feb 4, 2008

As im diving into my new DBA role and reading as much as I can, I am a little confused on DMV's and system tables.
I've been reading through the book "SQL Server 2005 Bible", which has been very helpful. I tend to use it in conjunction with BOL whenever I come across something I want to learn more.

Last Friday, I tinkered around with DMV's, which was really cool, but I ran into something today that confused me.

Basically, it was finding out the recovery model for all the DB's on the server. The code in the book was:


SELECT [name], recovery_model_desc
FROM sys.databases;


Which turned exactly what it says it will.

however, I am confused.
I initially thought I needed to specify something in the "[name]" section, but realized, that is not the case.
My question is, why is that?
How do I know when to use [] around something?

I found this article:

http://www.databasejournal.com/features/mssql/article.php/3587906

I have been reading it.
I guess I am just really young and raw to T-SQL to know when to use the language corectly.

Is it due to the fact that the rules or syntax is a little different when using system tables?

Hope that makes sense.

Thanks.

TCG

View 5 Replies View Related

Totally New To SQL

Jun 10, 2008

Waiting my my 431 study package turning up, any offers on any addional books etc that would help me pass this exam?

Cheers up front.

View 2 Replies View Related

Totally New To This.

Feb 17, 2008

Hi folks,

This is what I want to do,but is it possible.

I think I have got the hang of queries and stuff like that but here is what I want to do.
I am using the 2008 express freebie from microsoft with Sql server 8 freebie.

Here is waht I want to do. Place a load of buttons on a screen each one with a list in it.
so for example box one will specify all the days of the week,the others all the colors of the rainbow and the others all the month in the years.
So the the boxes will feed through to a tiny little sql server database with three tables...days..colours...months.
I want somebody to be able top come along and then click on a particular day of the week...let's say thursday...then click on a colur.lets say pink...then click on a month,lets say september..
Then a table will appear with that info in it..i.e. thursday,yellow september.

I know I could write a little prog in VB or C++ to do this but I am trying to relate it to a database.

I think the bottom line here is that I am trying to get the user to create the query and get the result of that query out onto a page.

As you can see I am just below novice level and I think the question I am really asking is that is it possible that the person using my program is actually making up a query(based on my criteria)and can get a result,rather than me have top store a query(or stored procedure) that just responds to a click on the box.

If this lot makes any sense what so ever,then could someone kind soul point me it the right direction(or any direction) :)

Thanks
Jimm222

View 1 Replies View Related

Totally Lost -- Please Help

Jul 19, 2004

I am looking thru SQL Books, browsing the forum, but still unclear of the best method to perform the following calculation. I am really struggling with this and any helpful hints would be greatly appreciated.

Situation
Table 1 = customer information. Contains customer #, name, address, etc.
Table 2 = default price list. Contains item #, item desc, price
Table 3 = Allowed discounts based on customer types. Hospital gets $1 off, Doctors get 25 cents off, individuals get no discount.

Further discounts are given for multiple purchases. The 1st item is 100%, 2nd item is 75% and 3rd and subsequent items get 50% off purchase that day.


Here is a basic query result set of customer number, price, item ordered, item description and customer type.

Cust Price ItemNo Item Type
1 $5.50 23432 Moisturizer Hospital
2 $5.55 23453 Moisturizer 2 Indvidual
2 $29.00 23243 Lotion Pkg Indvidual
3 $29.00 23243 Lotion Pkg Doctor
3 $21.25 23232 Gloves Doctor
3 $3.00 23235 Drape Doctor
3 $2.00 27821 Lube Doctor


Calculation

Customer 1 ordered 1 item @ 5.50, but because they are a hospital they get a $1.00 discount. They only ordered 1 item so they pay 100% of the discounted price.

(5.50 - 1.00) * 100% = 4.50

Customer 2 ordered 2 items @ 5.55 and 29.00 respectively. They get no discount because they are an individual client, but do qualify for the multiple item discount of 25% for the second item.

29.00 + 5.55 * 75% = $33.16

Customer 3 ordered 4 items @ 29.00, 21.25, 2.00 and 3.00 respectively. They get a 25 cent discount off each item for being a doctor. They also get a multiple item discount of 25% off the second item and and 50% off items 3 and 4.
The math ideally will look like this

(29.00 - .25)*100% + (21.25 - .25)*75% + (3.00-.25)*50% + (2.00 - .25) * 50% = $47

Problem
For customer 2 if someone entered the lower valued item first the math would look like this

5.55 + 29.00 * 75% = $27.30 (loss of revenue)

Possible Solution
The prices need to be sorted in descending order to maximize revenue prior to discounts being taken for a given day.
Should I use a "rank by clause" statement?

Then I need to multiply the first item by 100%, the 2nd by 75% and the remaining items by 50% to get a grand total of money due. Any pointers would be greatly appreciated.
I am not at all sure how to accomplish this.

View 3 Replies View Related

Stumped. Totally... (but There Must Be A Way!?)

Jul 20, 2005

Hi there...I am having a whole bunch of trouble trying to design a certain query. Ihave two tables (see a representation of them here:http://www.plankmeister.org.uk/tables.html ) one called menu_data and onecalled page_data.menu_data contains a list of defined menus (menu_group) which may be sortedaccording to the menu_group_display_order column.page_data contains a list of page definitions. Each page belongs to amenu_group. All the pages in a given group may be sorted according to thepage_display_order column. (for instance, a query to order all pages with amenu_group equal to 1 in ascending order would produce:CatsDogsFishSquirrels)What I am trying to do is to design a query that will tell me thepage_user_name of all the pages that sit at the 'top' of their menu group,but ordered by the menu_group_display_order column.So basically, it will order the data in menu_data by themenu_group_display_order colum, then comparing menu_data.menu_group topage_data.menu_group, will return the 'first' row after being ordered bypage_display_order, so that in the case of the data given, the return wouldbe:HorsesCatsBirdsRabbitsI've tried UNION, GROUP BY, TOP 1, INNER JOIN, OUTER JOIN, SLIGHTLY TO THELEFT JOIN, ONLY IF ITS A WEDNESDAY JOIN... etc etc... But I just can't getit to work! It either returns 40 rows, or one. I've spent a total of about10 hours trying to design this query, and am losing what precious littlehair I have left at an alarming rate.Hope someone can provide some insight!Plankmeister.

View 3 Replies View Related

Totally Stuck

Jan 4, 2007

I know that the answer to my problem is something that lies right infront my eyes but I got totally stuck. I cant understand why, when I deploy a database application I've made, when the application is run for the second time, the database doesn't have the data I have entered the first time... Is it something I have to tell my application?



It must be something trivial but I just can't put my finger on it.

View 5 Replies View Related

Totally Stuck With Money, Please Help!

Jan 5, 2004

i'm using query analyzer,

simply trying to use smallmoney as

In my table I have declared as:
payrate smallmoney,

Inserting values into table like this:
'258'

Error recieved is:
Disallowed implicit conversion from data type varchar to data type smallmoney,

What am I doing wrong? Also, ideally i'd like the 258 to be expressed as £258 (english pounds) if anyone can help with that also.

Thanks in advance

View 4 Replies View Related

Totally Shameless Self-promotion

Jul 23, 2005

This is a shameless plug. My new book, SQL PROGRAMMING STYLE is outnow.Joe Celko's SQL Programming Styleby Joe CelkoSave 20% and get Free Shipping if you order by Friday May 6.Place your order now or learn more below_______________________________________If you're looking for a book with a collection of tricks & tips andrules for formatting and writing portable, readable, maintainable SQLcode, you'll find what you need here!Are you an SQL programmer that, like many, came to SQL after learningand writing procedural or object-oriented code? Or have switched jobsto where a different brand of SQL is being used, or maybe even beentold to learn SQL yourself?If even one answer is yes, then you need this book. A "Manual of Style"for the SQL programmer, this book is a collection of heuristics andrules, tips, and tricks that will help you improve SQL programmingstyle and proficiency, and for formatting and writing portable,readable, maintainable SQL code. Based on many years of experienceconsulting in SQL shops, and gathering questions and resolving hisstudents' SQL style issues, Joe Celko can help you become an evenbetter SQL programmer. More specifically, this book will give youexpert advice from a noted SQL guru and award-winning columnist.Table of Contents_______________________________________FeaturesHelps you write Standard SQL without an accent or a dialect that isused in another programming language or a specific flavor of SQL, codethat can be maintained and used by other people.Enables you to give your group a coding standard for internal use, toenable programmers to use a consistent style.Gives you the mental tools to approach a new problem with SQL as yourtool, rather than another programming language-one that someone elsemight not know!Place your order here:http://books.elsevier.com/us//mk/us...r=&community=mkVolume discounts available, contact Join Bytes!

View 1 Replies View Related

Odd Things...I'm Totally Stuck

Aug 6, 2007



Hi all of you,

I've got a .dtproj project along with 10 dtsx packages. Up to here everything is fine, every package have its own source files, sql destinations and so on..
Issue comes when I try create a flat file source connection for the eleven one.

I get this message:

The component has detected potential metadata corruption during validation.
Error at Data Flow Task [Flat File Source [1]]: Failed to find any non-special error column in output "Flat File Source Error Output" (3).

It may not be possible to recover to a valid state using a component-specific editor. Do you want to use the Advanced Editor dialog box for editing this component?

Otherwise if I'm gonna to open a new .dtproj project separately no problem at all, I mean, appears the suitable window, "Connection Manager", "Column", "Error output" on the left and so on..

It's very strange. The rest of the packages, the same situation. Fortunately, all of them are stored on the server.

I don't get the point at all. Could you please tell me what the hell is happening?

Thanks in advance and regards,

View 3 Replies View Related

Connecting Tables

Mar 5, 2007

I have a table with columns Suppliers Name, Product and Quantities.
I also have another auxiliary table where I insert records(Supplier Name, Product and Quantities) from an external application. What I want is when I insert records in the second table the corresponding records of the main table to be updated and all the records in the auxiliary to be deleted.
Do I have to use stored procedures????

View 3 Replies View Related

Connecting Tables

Aug 18, 2007

Hey everyone,
I am beggining in SQL and the .NET framework and have been running into some problems trying to design a relational database. I am completely new to it so I bought a book that was recommended in this Forum called "Handbook of Relational Database Design" and it has been pretty usefull so far. RIght now I am trying to make the Logical Data Model before I make the Relational Data Model.
The problem that I am having right now is creating a table that is a derivation from another table. For example, in the book they have a table called Property, and then two other tables called MountainProperty and BeachProperty. MountainProperty and BeachProperty are a type (relationship here) of a property. So basically Property will hold some data in a table, and then MountainProperty and BeachProperty will extend that property to contain more specific data. This is very similar to what I want to do. However I am having a problem understanding how an instance (or row) in Property, will have a link (foreign key) to a piece of data that is in Mountain or BeachProperty. I understand the foreign key in Mountain and BeachProperty and how they will link back to their "parent". But how will Property know its children, where is the link for that, how can one make a link to that. You could make a column with a foreign key, but which table would it point to, can one column point to mulitple tables? That doesn't make very much sense to me.
Basically what I am trying to say is that a row in the Property table can be multiple types, and these types will store more additional data about that row. How can I link to that data from that row in the table Property.
The only way that I can think of to link to that table is by making another column called PropertyType where MountainProperty equal 1 and BeachProperty equals 2. So I would perfrom a query in my application on the row like "Select PropertyType from Property" which would give me back 1 or 2. Based upon that I would then know which table to search for in the database and would then perfrom another query on the specific table, either MountainProperty or BeachProperty.
I am terribly sorry if this is confusing or if it is so appartently easy for you, but this is the first time that I have ever tried to make a relational database and I am really struggling on seeing how to organize these tables properly. Thank yor for your time.
Jeremy

View 5 Replies View Related

Totally Sound Query Not Working In ACCESS

Jan 26, 2006

okay so i have query which sure does run fine if i drop it into a SQL server's console. however i try and put this into ACCESS so the accounting department can use it and it returns no values.

not sure if i should drop in the vb forum or what but im about to build a page in c# and have them get it that way.

Any one have any suggestions



Code:


select Doc.Dat, Doc.DocNo, Doc.IdPers, Pos.ItemNo, Pos.[Description], Pos.Quantity, Pos.SinglePrice, Pos.Discount from Pos, Doc where Doc.Dat like '%2005%' AND IdPers = (select IdPers from Pers where match = 'Aec One Stop Group, Inc.') AND Pos.IdDoc in ( select idDoc from Doc where Type = 8 ) ORDER by Dat, DocNo DESC

View 8 Replies View Related

Implementing Security In Totally Open Environment

Aug 4, 2015

I've been parachuted into a place with a few dozen servers, several thousand external users (and scheduled to grow). Right now the whole place - IT and non-IT alike - l logs in with SA.....

(where's the 'Puking' icon??)

They've got Windows logins, but that's about as tight as it gets. Honestly I've never seen anywhere as insecure....and not sure where to start.

View 0 Replies View Related

Similar Table, But Totally Different Search Performance...

Sep 20, 2007

I have two table A and B:

A 2000000 Rows 569288KB 8KB index
B 3000000 Rows 853712KB 8KB index

But when do "SELECT COUNT(*) FROM A/B", table B is significantly slower than A:

A 0 secend
B 8 seconds

Does anyone know why? So I can boost the performance to search table B.

Thanks in advance.

View 8 Replies View Related

Connecting Tables From Different Databases

Apr 23, 2007

Hey everyone. I am somewhat of a newbie to the database world.
I have been given the task of connecting two different SQL databases. Both are Microsoft SQL.

I want some of the tables of one of the databases to be linked to the tables of the other.

Is this possible?


Thanks

RoadHired

View 1 Replies View Related

Connecting SQL Tables To Access

Oct 11, 2007

I have been tinkering with connections to SQL Server 2000 from Access 2000 for a couple of days without much luck.

My most recent attempt is the following code to the click event of a command button on a form. Most of this code was acquired from other places on the net.

Dim oConn As ADODB.Connection

Set oConn = New ADODB.Connection
oConn.Open "Provider=sqloledb;" & _
"Data Source=Hed001;" & _
"Initial Catalog=My_Views;" & _
"User Id=;vel007" & _
"Password=driver"

Dim oRS As ADODB.Recordset
Set oRS = New ADODB.Recordset

oRS.Open "Select * from VOrder_Header", oConn


Amazingly, it does not error out. But what do I do next to see the records in VOrder_Header?

Just a newb blazing at trail here in the unknown...

View 1 Replies View Related

Integration Services :: Connecting To AZURE Storage Tables

Jan 25, 2011

I am trying to connect to AZURE Storage tables using SSIS.What is the Data flow source?Which Provider to select?

View 6 Replies View Related

RDLC Newbie Questions (hopefully)...connecting Dataset To Report That Contains Multiple Data Tables

Sep 12, 2007

Hi All,

We are post-deployment with a serious reporting issue that's causing us to rethink our reporting solution. We're considering moving from what we have to SQL Server Reporting Services (client side).

I have spent the past couple of days getting up to speed on this feature and seeing if we can easily migrate it into our existing application. However, I've hit a couple of stumbling blocks and was hoping perhaps someone here could either tell me the solution or point me in the right direction.

I'm not having any problems creating basic reports (e.g. flat data).

However, I am having problems creating reports where there are related tables in a dataset.

The way it works with our existing solution is that I get a dataset (which contains several data tables) and point it to the report's datasource. That report expects those tables and I have defined table-relationships in the report which process and display the information correctly.

I'm not having as much luck with RDLC.

I can go into futher detail about how I'm creating the report, but let me just ask these general questions first:
1. Can I set a dataset containing multiple datatables equal to a property on an RDLC report and that RDLC report know how to treat and display the data?
2. Is there a better/smarter than this to get a field selection from my datasource (remember, this information is coming from a stored procedure so connecting directly to the database is not an option):
a. In code, populate dataset
b. In code, write dataset schema to xml (e.g. an xsd file)
c. In Visual Studio, add the XSD file to project
d. Use fields from XSD file to drag and drop fields on report

A fancy example would be nice too. I've googled like crazy the past couple of days and downloaded as many samples as I can find (including the ones on ftponline.com, gotreportviewer.com, "Tudor's WebLog", and several others). However, I have yet to find one that uses grouping and related datatables.

Thank you so much (if, for nothing else, reading this post )

View 4 Replies View Related

Confused :-(

Sep 13, 2004

Having serious problems trying to insert date into database using sqladapter.update method gives an error saying "Converting DateTime from Character string". the funniest thing is that it works on my developement box, but when i upload to the server with thesame settings in my development box, it does not work.

View 2 Replies View Related

M Confused About Using Dbo And ..

Jan 4, 2007

Hi,
I will give someone a script that creates a database using :
create database mydatabase
my question: can I use myDatabase.dbo...... and myDatabase..Whatevertable in order to manipulate the database objects or should I be careful with putting dbo in my script.

The reason is that I will have to give the following script to someone to execute on his instance and I don t want it to fail.

The script creates a database mosaikDB737, create a table called FileListInput in that database and populates a second table called DBlistOutput with the list of names of all databases in the instance.

Please let me know if there are any (BAD) chances for the following script to fail.


create database mosaikDB737
go
use mosaikDB737

SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[FileListInput]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[FileListInput](
[FileName] [char](50) NULL
) ON [PRIMARY]
END

use master
select name into mosaikDB737.dbo.DBlistOutput from sysdatabases where name not in ('master','tempdb','model','msdb')
select * from mosaikDB737.dbo.DBlistOutput

View 5 Replies View Related

So Confused

Dec 15, 2007

OK, so I'm new to SQL server, which I'm sure you'll all see from my question below.

I am trying to migrate an access DB with queries over to sql server 2005. simple queries I can handle, but I've come accross a query that calls another query and does an update based off of my first query. The below queries work perfectly fine in access but I dont know how to get this going in SQL server. From my VERY minimal understanding in of SQL server i thought we couldnt call stored procedure (query1) and have it update the underlying tables. If I'm wrong, please show me how its done, If I'm right please show me the right way of doing this.
If you see spelling errors in the queries please ignore, that is not the full queries, it is just a cut down version to explain what I need to be able to do.

Query1

SELECT table1.assettag, table1.City, table2.Status, table2.ScheduleItems
FROM Table1 Inner join on table1.assettag = table2.assettag
where Status = "Scrubbed" or Status = "Initial"


Query2

Update Query1
SET query1.ScheduledItems = True
Where query1.Status = Scrubbed


thank you for any information or help.

View 3 Replies View Related

Very New And Very Confused!!

Mar 5, 2008

Hi,

I have never used coding before (just learning) and I need to collect username and password and check it against my SQL database. I am using the below code as a sample guide for me to figure this out. Does anyone point me to a sample code page that I may look at that actually is doing what I want to do??

Sondra





Protected Sub submit_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles submit.Click

Dim myReader As Data.SqlClient.SqlDataReader

Dim mySqlConnection As Data.SqlClient.SqlConnection

Dim mySqlCommand As Data.SqlClient.SqlCommand





'Establish the SqlConnection by using the configuration manager to get the connection string in our web.config file.

mySqlConnection = New Data.SqlClient.SqlConnection(ConfigurationManager.ConnectionStrings("ConnectionString").ToString())

Dim sql As String = "SELECT UserLogonID, UserPassword FROM MyUsers WHERE UserLogonID = '" & Me.userid.Text & "' " And "Userpassword = '" & Me.psword.Text & "'"

mySqlCommand = New Data.SqlClient.SqlCommand(sql, mySqlConnection)





Try

mySqlConnection.Open()

myReader = mySqlCommand.ExecuteReader()





If (myReader.HasRows) Then

'Read in the first row to initialize the DataReader; we will on read the first row.

myReader.Read()





Dim content As ContentPlaceHolder

content = Page.Master.FindControl("main")

Dim lbl As New Label()

lbl.Text = "The Last Name you choose, " & Me.dlLastName.Text & ", has a first name of " & myReader("FirstName")

content.Controls.Add(lbl)

End If

Catch ex As Exception

Console.WriteLine(ex.ToString())

Finally

If Not (myReader Is Nothing) Then

myReader.Close()

End If

If (mySqlConnection.State = Data.ConnectionState.Open) Then

mySqlConnection.Close()

End If

End Try





End Sub

View 1 Replies View Related

Confused About Permission

Aug 29, 2007

I read a few articles on best SQL practices and they kept coming back to using a Least Privileged Account.  So I did so and gave that account read only permissions.  The articles also said to do updates use Stored Procedures - so I created stored procedures for updating/deleting data.So here's my problem - I connect to the database using the Least Privileged Account, I use the Stored Procedures, but .NET keeps saying I lack permissions.  If I GRANT the Least Privileged Account UPDATE/DELETE permission on the table, the Stored Procedures run perfectly.  But isn't that EXACTLY what I'm trying to avoid?My greatest concern is someone hacks my website and using the Least Privileged Account, they delete all my data using that account.  So I don't want to give the Least Privileged Account the Update/Delete privileges.Thanks a MILLION in advance! 

View 3 Replies View Related

Nullable Got Me Confused

May 30, 2006

I have just started on a project which will be based on an existing MS SQL Server database. It has many columns which can be, and sometimes are, null. My basic DataReader code throws an SqlNullValueException when I try to GetInt32 but not when I try GetString. Why the difference?
Also, how do I model my class? Do I have to make all fields into nullable types? If I do that I notice a simple GridView will not show a column for that field! I am confused.

View 3 Replies View Related

SP - Dazed And Confused

Mar 13, 2000

Hello,

I am calling a sql 7.0 stored procedure (sp) from an active server page(asp).

The sp is a simple insert. I need to read the return the value of the sp in my asp. If the insert is
successful, my return value is coming back correctly (to whatever i set it)....but if there is an error
such as a Uniqueness Constraint, I can't get the return code(set in the SP) to come back to the ASP.
It comes back blank. (The literature I've read says that processing should continue in the SP, so you
can perform error processing...is that right?)

I set the return var in my ASP as:
objCommand.Parameters.Append objCommand.CreateParameter("return",_
adInteger,adParamReturnValue,4)
and read it back as:
strReturn = objCommand.Parameters("return").Value


In my SP I simply do;

INSERT blah blah
if @@error = 0
return(100)
else
return(200)

(Idon't ever get back "200")

Any ideas???

Thanks for your help.

View 1 Replies View Related

Confused About Replication

Dec 18, 2006

Hi

I have study Microsoft online books for few days no, about repliction but I'am even more confused about replication. please help somebody

My goal:

I have been written a GPS program that has an database.
The database will be replicated to an central web server.
That will say one web server and x numbers of laptops that has same GPS program. :)
All laptops uses internet to replicate.

Now... I have no problem to create publications and subscriptions on server BUT HOW do I do it on client????? :confused:

Microsoft do not write nothing about client side of replication. everyting is SERVER, SERVER,SERVER and SERVER.The Microsoft HOW TO is only How to click forward, its dosen't really explain anything.

Problaby I need some kind of an database on client and subscription to make the replication. :confused:

please help me, I'am almost finished with my project only replication part is over my head :(

if someone can point me to right direction in this issue. I would be greateful. :cool:

Thanks

KK

View 13 Replies View Related

Xp_sendMail (Confused)????

Jul 2, 2002

I want to use xp_sendmail against a database other than the master. When I run a test using the master database, it sends a test message w/no problems. However when I try to use xp_sendmail against a database I've created, it gives me an error stating:

Server: Msg 2812, Level 16, State 62, Line 1
Could not find stored procedure 'xp_sendmail'.

How can I use xp_sendmail using a dabase other than Master?? Please Help.

View 1 Replies View Related

Confused Joins

Mar 21, 2007

I am using this query to create a single transactions from data that is distributed over several databases. So essentially i have created several variable tables and now I have to join them together.
So what I wanted to have happen was display all rows from temptalbel and then join the other tables to create one transaction row. The problem that occurs is within the where statement and I dont understand why. In some cases, you can have two instances of x but y will be different. In that case the joins work perfectly. In the event that there are only a single instance of x associated with a single instance of y this join does not work. Can anyone help me understand why this is happening?

select somedata, somedata, somedata, somedata
From kpi..temptablel l
left outer join @temps s on l.x = s.x
left outer join @tempf f on l.x = f.x
left outer join kpi..temptablee e on l.x = e.x
left outer join @tempn n on l.x = n.x

where l.y = s.y and l.y = f.y and l.y = e.y and l.y = n.y


The Yak Village Idiot

View 4 Replies View Related

Confused. Need Some Help About SQL Coding

Jun 14, 2007

hi im a little bit confused. are the two pieces of code similar? what are the differences. i really need to know that coz i wont get access to a SQL machine until monday.


selectlastname
fromemp
wheresex = 'F' and
salary>(selectavg(salary)
fromemp
group by sex
havingsex='M')



selectlastname
fromemp
wheresex = 'F' and
salary>(selectavg(salary)
fromemp
wheresex='M')


also is it wise to use Group by and having in sub-queries?

View 2 Replies View Related

Confused About Creating A Dup Mdf

Mar 13, 2008

Hi
I have an slq Express mdf at path X and I copy it to path Y. When I open it up (from the Y path) using sql mgmt studio, it shows that it's from path X.
Why? How can I get sql mgmt studio to recognize it as a separate mdf, distinct from the one at path X?

TIA

rank beginner

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved