What the correct syntax for this, im doing this in a stored procedure.
select @useridHigh, @userBalHigh = UserID,MAX(Balance)
where LastName = 'Tom'
group by UserID
View Complete Post
I'm using VS 2008 and SQL 2008.
I have created the tables and the stored procedures in SQL 2008.
In VS 2008, I created DataSet1.xsd in App_Code and created the connectionString in web.config file.
Then when I go into the DataSet1.xsd and try to add a TableAdapter, strange things happened.
First I chose the data connection, then selected "Use existing stored procedure", then there was nothing listed in the dropdownlists (in Select, Insert, Update, or Delete).
I'm sure the connectionString is correct because if I choose "Use SQL statement" and type in a "select * from mytable1", the TableAdapter can be created without any problem.
I need your help. Imagine that I have two tables:
Supose that my tables could be differnced by a number 1 is for ALUMN and 2 is for SPORT.
And the columns of each table too. So 1 is for IdAlumn, 2 is for Name and 3 is for Address. 1 is for IdSport, 2 is for Name 3 is for Players and 4 is for Description.
For example the combination of table 2 and column 3 is SPORT-Players.
Then I want to do an stored procedure that receives two parameters (the table, the column) @tab and&
Any one pls tell me how to call the stored procedure in SQL server
I am creating a buddy list and I need to select my entire buddy list and then the ones that are online
I have two querries one is your standard
the other is a bit more complicated
SELECT Buddy as Online
WHERE EXISTS (SELECT Buddy
WHERE online.Buddy = Buddies.Buddy)
I can't use the union command since I create another column
What I would like is to append the column to my original result so I can access it from some vb script using the sqlclient.datareader
I have a procedure that involves creation of temp table, inserting data into it and use this data to populate another table variable whose output forms the dataset for the OLE DB Source.
Here is the general outlay of the procedure (just a sample data) -
CREATE PROCEDURE GetSettlementData
SET NOCOUNT ON
SET FMTONLY OFF
CAST(NULL AS INT) AS ID
,CAST(NULL AS INT) AS Marks
CREATE TABLE #Tmp_GetData
we have a stored procedure with multiple select in it.
Select a,b,c from table1
Select f,g,h from table2
Select j,k,l from table3
Sometimes select no 2 will not return any values.
when this happens we get only 2 result sets using CallableStatement getMoreResults method.
it seems that if a select doesn't return something it will not have a corresponding resultset.
On 2000 (driver + server) version we got an empty resultset for this situation.
Is there any way to have the same behaivor with 2005 ? We tryed with 1.2 and 2.0 jdbc driver.
I'm using Dynamic Data with Entity Framework in VS2010.
Let's say my table has these fields:
MyTableID (PK)PersonID (FK)LocationID (FK)TotalItemsSold
Hypothetical scenario (it's easier for me to explain this way, so just bear with me for now)... But let's say each row in the table represents "how many items were sold by such-and-such employee at such-and-such location," where location and person are foreign keys which are referencing other tables. Basically, there should be no more than a ONE row which has a particular combination of Person and Location. Makes sense?
So, when inserting new rows using my Dynamic Data app, the insert form displays editable fields for Person (dropdown), Location (dropdown), and Items Sold (textbox). How do I prevent users from inserting another row into the table containing an already-existing combination of Person and Location? How do I displaying useful feedback to them in the event that they DO attempt to do this?
I have several thoughts about this, but since I'm new to Dynamic Data, I'm not sure which way to go. For example:
Option 1: Use "cascading dropdowns" approach in the insert form and only pull in the "allowed" combinations of the two dropd
I'm have on my web page a text search box which I want users to type in there favourite football team and this will display a gridview of the teams with the replica shirts I offer.
This is where I thought about creating a stored procedure to carry out this task.
I looked online for ideas but I not found anything as yet.
If anyone done anything similar to my request please let me know.
I have a gridview that calls data via a stored procedure. I am unable to enable the gridview columns to be sortable. I need to set the parameter in the Stored Procedure, can someone help me with this?
Here is my gridview:
<asp:GridView ID="AllUsersGrid" runat="server" AutoGenerateColumns="False" DataKeyNames="UserName"
GridLines="Vertical" Width="900px" DataSourceID="SqlDataSource1" AllowSorting="True"
SelectedRowStyle-Height="30px" CellPadding="4" BackColor="White">
<asp:TemplateField HeaderText="Full Name" SortExpression="lastname">
<asp:Label ID="DisplayName" runat="server" Text='<%# Eval("firstname").ToString() & " " & Eval("lastname").ToString() %>' />
<asp:BoundField HeaderText="User Name" DataField="UserName" />
I am looking for a stored procedure generator with full source code(C#) compatible with Visual studio 2010. I want to create my custom stored procedure code. Please send some link.
we are creating a custom report tool, which could be used for generate the report as per end user's needs. In that we are providing an option as user could create a query and procedure as well.
In sql server we can use "EXEC" function for execute dynamic query.
Could anyone help me for create the dynamic query in Oracle?
I just tried with "execute immediate", which would throws error as
Please help me.
Please help me.
MSDN Magazine January 2001
I have a C# web page that calls a stored procedure. The page passes few parameters to the stored procedure and call it. The stored procedure does so many time consuming tasks on a huge number of database records but does not return any value.
Since the page is not expecting any return from the stored procedure, I want to execute the stored procedure asyncronously so that the user can continue working on the web page and other web pages while the stored procedure is running in the background. Also, I do not want the web server processes to be busy with the running stored procedure.
Any help, please.