Ask a Question related to Microsoft SQL / MS SQL Server, Design and Development.
-
hngo01 #1
Update and Select Statement
Hi to all, I have VB application calling a SP.
It works when:
--return this to application
SELECT *
FROM tblVariance
WHERE VarianceID = @VarID
--update table
UPDATE tblVariance
SET NetworkID=@NetworkID
WHERE VarianceID = @VarID
return 0
I would like to see update values: I placed the update
statement first. It doesnt work:
--update table
UPDATE tblVariance
SET NetworkID=@NetworkID
WHERE VarianceID = @VarID
--return this to application
SELECT *
FROM tblVariance
WHERE VarianceID = @VarID
return 0
any ideas. thanks
hngo01 Guest
-
Select-And-Update in one statement?
On my site I often do SELECT counter from counters where id = 10 UPDATE counter set counter = counter + 1 Can I somehow merge them into one... -
sql select case statement
Hi, Im trying to put together a sql select case statement for coldfusion - can anyone please check over my code and see if i am going along the... -
SP with Select statement
Hi, I'm trying to select fileds that are in the results of a SP. So I have the table "tblItem" itemID int Identity Key, itemName varchar... -
help with SELECT statement
"Aaron" <abroadway@ameritrust.com> wrote in message news:05a601c365df$b31a8d40$a401280a@phx.gbl... "SUM(ABS(action_date>= {" & start_date2 & "}... -
SELECT statement
I have 3 tables: table countryPrice: productID countryId price 1 Italy 90 1 England ... -
Dan Guzman #2
Re: Update and Select Statement
Try adding SET NOCOUNT ON to the beginning of your proc. If this
doesn't solve the problem, please specify details of your symptoms
rather than say 'it doesnt work'
--
Hope this helps.
Dan Guzman
SQL Server MVP
-----------------------
SQL FAQ links (courtesy Neil Pike):
[url]http://www.ntfaq.com/Articles/Index.cfm?DepartmentID=800[/url]
[url]http://www.sqlserverfaq.com[/url]
[url]http://www.mssqlserver.com/faq[/url]
-----------------------
"hngo01" <hngo01@hotmail.com> wrote in message
news:0b9501c3417d$6f1d6260$a501280a@phx.gbl...> Hi to all, I have VB application calling a SP.
>
> It works when:
>
> --return this to application
> SELECT *
> FROM tblVariance
> WHERE VarianceID = @VarID
>
> --update table
> UPDATE tblVariance
> SET NetworkID=@NetworkID
> WHERE VarianceID = @VarID
>
> return 0
>
> I would like to see update values: I placed the update
> statement first. It doesnt work:
>
> --update table
> UPDATE tblVariance
> SET NetworkID=@NetworkID
> WHERE VarianceID = @VarID
>
> --return this to application
> SELECT *
> FROM tblVariance
> WHERE VarianceID = @VarID
>
> return 0
>
> any ideas. thanks
Dan Guzman Guest



Reply With Quote

