A tutorial would be great (everything i found was for Access or MYSQL which caused errors). I have no clue what i am doing. First off, tell me if this will work, or if i'm going at this the wrong way...
I have an SQL database with a customers table. Attributes include: username and password.
I...
Thanks that makes sense. You answer very fast, your good :)
Instead of a random number, what if EmployeeID was supposed to be an "autonumber". How does one insert rows into a table when one of the columns is supposted to be an autonumber?
I've been spending the entire day writing sql code, stored procedures, and a pretty big visual basic program so that i could insert typed in user values from vb into rows of a sql table. I could insert rows into other tables, but the table i needed to use would never work. I thought there was a...
Basically I'm just trying to learn how to use Visual Basic and parameters with SQL. I want to learn how to take user inputted text from visual basic and insert those values into a sql database table's row. So I created a very simple scenerio and hopefully someone can help me.
I'm using the...
Basically I'm just trying to learn how to use Visual Basic and parameters with SQL. I want to learn how to take user inputted text from visual basic and insert those values into a sql database table's row. So I created a very simple scenerio and hopefully someone can help me.
I'm using the...
Server: Msg 170, Level 15, State 1, Line 6
Line 6: Incorrect syntax near '6'.
I then tried:
WHERE DateDiff(Month, OrderDate, GetDate() > 6)
Which gives:
Server: Msg 170, Level 15, State 1, Line 6
Line 6: Incorrect syntax near '>'.
I'll try a few other ways.
Thanks George, i appreciate your help! As a beginner, i'm starting to really enjoy SQL. Its not easy, but i can almost understand most of the basics now - especially with help like your and others here! :)
I need to search for ProductIDs and UnitPrices for products that have not been sold within the past six months. The six months is determined by the date the Stored Procedure is executed.
So i guess i would just need to find the current server time, do some type of interval of 6 months, and use...
Thanks, that helps!... It was a bad example. I'm trying to solve more difficult problems, but I'm trying to give very simple examples when i ask for help.
Where does @RegionId and @RegionDescription come from?
User Inputs from VB
Are they parameters to the stored procedure?
I dont know what this means.
Are there identity columns?
Are there primary keys?
This is just a basic table with two attributes (RegionID & RegionDescription). RegionID =...
Lets say you have a stored procedure INSERT a new row into a table. In this very same stored procedure what type of SELECT statement could you use just to display the values in the newly created row and not all the rows in that table?
For Example:
CREATE PROCEDURE up_Insert_Region
AS
INSERT...
Im basically designing a VB program that takes user inputs to add a new row to an "Employees" table. My procedure in SQL is giving me trouble though, and i don't know why.
CREATE PROCEDURE up_New_Employee
@LastName nvarchar(20),
@FirstName nvarchar(10),
@Title nvarchar(30),
@TitleOfCourtesy...
Works like a charm!!! :) Thank you very much!
I was getting close, i put EmployeeID at the end (which wasnt very smart since it destroyed the purpose of the AS EmployeeName) instead of the beginning.
All i did was change this in VB:
cboEmployees.DisplayMember = "EmployeeName"
cboEmployees.ValueMember = "EmployeeID"
I guess im starting to understand what you said. "SELECT LastName + ', ' + FirstName + ' - ' + CAST (EmployeeID AS nvarchar(10))" Is basically only one statement, when before i...
I'm still getting errors on the ValueMember line: An unhandled exception of type 'System.ArgumentException' occurred in system.windows.forms.dll
I beleive i tried that earlier. I've tried several different variations, and all have failed :(
In VB i have ONE drop down combobox that will display employee FirstName's, LastName's, & EmployeeID's from an Employee table.
To get all three attributes to fit into one combo box i used "AS EmployeeName" and i had to convert EmployeeID from an INT to NVarchar for it to run. The following...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.