I'm having trouble with stored procedure here and I'm not sure what to do or how to approach this. I'm sure there's a genius out here that can help me out! :D
I want my stored procedure to return Anuncio's idAnuncio, titulo, precio, descripcion, and by using it's foreign keys return Categoria's descripcion and Imagenes's imagen.
But ...
I can't pull up my tables so I can use them in my stored procedure. Any reason why they aren't showing?
...
I need to write a query that increments a value in a table by 3 when run.
I would like to do something like this but this doesn't work.
UPDATE table
SET value = (SELECT value
FROM table
WHERE condition = true) + 3
WHERE condition = true
As in the title this is a DB2 database, any ideas?
EDIT: Actually this d...
I'm having an issue where this query statement is giving me repeating GoalText in the results. Any ideas?
The complete query statement:
Select g.GoalText, convert(nvarchar, g.GoalID) + '|' + convert(nvarchar, r.GoalReqID) as GoalID, GoalReqID
from Goal g inner join GoalRequirement r
on g.GoalID = r.GoalID
where GoalReqID in
(Select...
What is the Big-O for SQL select, for a table with n rows and for which I want to return m result?
And What is the Big-O for an Update, or delete, or Create operation?
I am talking about mysql and sqlite in general.
...
Create Proc CargarAnuncioPorBusqueda
@searchString varchar(max)
AS
select * from Anuncio where titulo Like '%'+ @searchString + '%'
Say the user writes: "pools", would this Stored Procedure return everything that has "pools" in the "titulo"?
Thank you. :)
...
Create Proc CrearNuevoAnuncio
@Titulo varchar(250),
@Precio int,
@Descripcion varchar(250),
@IDCategoria int,
@IDImagen int,
@Login varchar(200)
AS
INSERT INTO Anuncio VALUES(
@Titulo,
@Precio,
@Descripcion,
@IDCategoria,
@IDImagen,
@Login
)
The error is because the table anuncio ...
I have the following table variable in SQL Server 2005:
DECLARE @results TABLE (id int IDENTITY(1,1),
customerId int,
salesId int,
score int,
lastServiceDate datetime,
PRIMARY KEY(id));
I need an efficient way to c...
This is my sql query: subsonic version 2.1.0.0 No Linq (.net 2.0)
select
(
select Title from MenuTranslation mnu2 where
mnu2.languageid = 1 and mnu2.menuelementid = menutranslation.menuelementid
)as BaseTitle, *
from menutranslation
inner join menuelement on menuelement.id = menutranslation.menuelementid
where menuelementid
in (sel...
I have table with 3 columns A B C.
I want to select * from this table, but ordered by a specific ordering of column A.
In other words, lets' say column A contains "stack", "over", "flow".
I want to select * from this table, and order by column A in this specific ordering: "stack", "flow", "over" - which is neither ascending nor descen...
I have a byte array of a file and I need to save it into my database in a field that has been set aside of type image.
However I have a problem my data access class takes a sql string and commits it to the database for example.
"EXECUTE stored proc @parm1, @parm2, @parm3"
However the problem is I cannot figure out how to transfer the ...
SELECT * FROM ExternalQuestionKeyword INNER JOIN ExternalKeywords
ON ExternalKeywords.ID=ExternalQuestionKeyword.KeywordID
WHERE QuestionID = 17
...
I have this:
Create Proc CrearNuevoImagen
@imagen image
AS
INSERT INTO
Imagenes(imagen)
VALUES(
@imagen
)
I see that @imagen is of type 'image'.
My question is save that I have an .jpg image, on my front-end (my asp.net website code), how could I convert the .jpg image to fit into the 'image'-type column? Or does...
I am working on .aspx page that uses a t-sql query that uses a multivalued input parameter (a set of labnames) using an array that would store all the labnames prior to running the query.
I have the following parameters for the query.
With c.Parameters
.Add(New SqlParameter("@sdate", sdate.text))
.Add(New SqlPar...
I accidentaly created a table in PostgreSQL which contains, in its name, some double quotes. I used SQL Server 2000 DTS to import data from it to my PostgreSQL server, but while importing, it created the table but with double quotes in it.
Actually the table name when I do SELECT * FROM pg_tables is : public","t_freemailer
So, when I t...
i need run code that will create a database and populate tables. i am using windows. how can i run this code?
localhost/phpmyadmin shows nothing, it's a blank page
could it be because i installed the lite version?
...
i have about 8mb of sql code i need to run. it looks like this:
/*
MySQL Data Transfer
Source Host: 10.0.0.5
Source Database: jnetdata
Target Host: 10.0.0.5
Target Database: jnetdata
Date: 5/26/2009 12:27:33 PM
*/
SET FOREIGN_KEY_CHECKS=0;
-- ----------------------------
-- Table structure for chavrusas
-- ----------------------------
...
I just tried to move one of WCF service to windows authentication. using this connection string
<add name="MembershipConnection" connectionString="Data Source=DBADDRESS ;Initial Catalog=aspNetMembership;Persist Security Info=True;Integrated Security=SSPI;"/>
WCF service is hosted in IIS (2003) and the user I have setup under 'Directory...
i have about 8mb of sql code i need to run. it looks like this:
/*
MySQL Data Transfer
Source Host: 10.0.0.5
Source Database: jnetdata
Target Host: 10.0.0.5
Target Database: jnetdata
Date: 5/26/2009 12:27:33 PM
*/
SET FOREIGN_KEY_CHECKS=0;
-- ----------------------------
-- Table structure for chavrusas
-- ----------------------------
...
What I'd like to be able to do via SQL somehow is with a table name as input determine all the fields that make up the primary key. sp_columns doesn't seem to have this field. Any ideas as to where to look?
EDIT: This is SQL Server 2005
Statement on Answer: While others may have been right his was the cleanest and easiest to implemen...