Viewing 15 posts - 49,471 through 49,485 (of 49,566 total)
Don't think that's going to work, since @vtbl is a table type variable. If it was a string would be fine.
May 6, 2005 at 5:49 am
It's a scope issue. The variable only exists at the outer level (where it was declared) so when the dynamic SQL executes, the table variable is not visible.
See BoL under...
May 6, 2005 at 5:45 am
Almost right
UPDATE BalanceTable
Set Vendor = VendorCodeTable.Vendor
FROM VendorCodeTable
You can optionally add a where clause after to do joins e.g.
UPDATE BalanceTable
Set Vendor = VendorCodeTable.Vendor
FROM VendorCodeTable
WHERE BalanceTable.Region=VenderCodeTable.Region
HTH
April 28, 2005 at 1:00 am
Actually, come to think of it, it can.
SELECT MAX(Element) FROM Table WHERE Element NOT IN (SELECT TOP 1 Element FROM table ORDER BY Element DESC)
Replace TOP 1 with whatever you...
April 19, 2005 at 1:17 am
Select max(element) AS SecondLargest FROM
Table WHERE Element!=(SELECT max(element) FROM Table)
Unfortunatly not adaptable to give the third largest, etc. I'm sure someone around here has a more adaptable solution.
April 19, 2005 at 12:07 am
Eeep, sorry.
Remove all references to id and remove the group by in the inner query. I was thinking of somethng else.
SELECT actionstatus, actiondatetime FROM tbl INNER JOIN
(SELECT MAX(actiondatetime) AS...
March 16, 2005 at 1:58 am
I assume you have some column that is unique. For the purposes of the eg, I will call that column ID. Also calling the table tbl
SELECT actionstatus, actiondatetime FROM...
March 16, 2005 at 12:08 am
SET ANSI_NULLS ON
GO
SET ANSI_WARNINGS ON
GO
CREATE PROCEDURE [procTest]
AS
SELECT Shift_num
FROM [bell-sql].CabTS.dbo.Shift
GO
March 10, 2005 at 12:40 am
Ownership confusion, most likely
First it should be
CREATE FUNCTION dbo.nvl(....
then call it
select dbo.nvl('123', '321') from my_table
March 7, 2005 at 2:21 am
You could try and make the input and output datatypes sql_variant. It's not overly efficient, and may cause problems with implicit conversion, but should work.
March 7, 2005 at 1:13 am
What you've created there is a computed column in the table, not a column with a default. The function is recursive as written, and will call itself without end, which...
March 2, 2005 at 12:53 am
Not sure how you want this displayed
This is the easiest:
| Column 1 | Column 2 |
|---|---|
| Total Trades | Total Value |
| Trades for Symbol1 | Value |
That can be achieved by unioning the selects together
select '-Total-' AS Title, count(*) AS...
February 24, 2005 at 11:55 pm
Are either of the boxes Server 2003? If so, you might want to check this out.
http://support.microsoft.com/default.aspx?scid=kb;en-us;329332
February 23, 2005 at 12:17 am
One thing to note is that bit fields are only really useful if there are multiple of them in a row.
From BoL
"If there are 8 or fewer bit columns...
February 14, 2005 at 12:03 am
An update statement may only target one table.
I don't know what the update statement looks like, but it sounds as if you're trying to update RaceLog and RaceLogRslts in...
February 8, 2005 at 11:22 pm
Viewing 15 posts - 49,471 through 49,485 (of 49,566 total)