Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. Fhwqhgads

    Problem with UPDATE on table variable using subquery

    I got the output I was looking for by using the following: Update @TidTable Set Connection =1 Where Connection !=2 and Exists (Select * From (Select Trank1 as home,Trank2 as away From @tidtable a Where Trank2 in (Select Top 3 Trank2 From @tidtable where Trank1=a.Trank1)) c Where c.home=Trank1...
  2. Fhwqhgads

    Problem with UPDATE on table variable using subquery

    In Buck Woody's extensive tutorial on SQL, he gives the following code for an update to a table, showing how to use subqueries in an Update statement: UPDATE authors SET state = 'ZZ' FROM (SELECT TOP 10 * FROM authors ORDER BY au_lname) AS t1 WHERE authors.au_id = t1.au_id I don't see how...
  3. Fhwqhgads

    Problem with UPDATE on table variable using subquery

    It appears that others have had this same problem, but I have not managed to find the solution. Server 2005 gives a "must declare scalar variable @TIDTable" error on the following Update command: Update @TidTable Set Connection =1 From (Select * From @tidtable a Where Connection !=2 and...
  4. Fhwqhgads

    Problem with UPDATE on table variable using subquery

    It appears that others have had this same problem, but I have not managed to find the solution. Server 2005 gives a "must declare scalar variable @TIDTable" error on the following Update command: Update @TidTable Set Connection =1 From (Select * From @tidtable a Where Connection !=2 and...
  5. Fhwqhgads

    No management studio installed?

    I recently bought 2005 developer edition after having used 2005 Express. I installed 2005 Developer, and it seems to think that I already have the 2005 server tools installed...which means it refuses to install them. The most frustrating consequence of this is that it appears Management Studio...
  6. Fhwqhgads

    Passing Table Variable to UDF

    Is it possible to pass a table to a UDF? I assumed you could do it, but when I try I get an error. For example Create Function dbo.Tdistance(@Trank smallint, @TIDs Table(Trank smallint)) Returns Real as Begin declare @value real select @value = Sum(1/(radius*radius)) From HIxD Where frum in...
  7. Fhwqhgads

    Silly Question about Studio Express

    I have Microsoft SQL Server Management Studio Express Is there a way to see output/messages while a process is running? For example, if I type declare @count smallint set @count = 1 While @count < 1000 Begin Select @count Set @count = @count + 1 END The "1,2,3..." do not show up until the...
  8. Fhwqhgads

    Binary Relationship Tables?

    Thanks! That is the sort of information I needed. The solution you suggest takes 3 times as much physical room, but seems much more inline with how SQL should be used.
  9. Fhwqhgads

    Binary Relationship Tables?

    I think there is a misunderstanding. I am not actually trying to find the distance between two citices, I was using that as an example. The actual thing I am trying to find is far more complicated and takes a good chunk of computation time to do...so I was hoping to just compute these values...
  10. Fhwqhgads

    Binary Relationship Tables?

    I am trying to "hard-code" a binary relationship into a table form. For example, imagine a table showing distances among pairs of American cities. Each city would get a row and a column. Then the number in row X column Y would be the distance between city X and city Y. This table would only be...
  11. Fhwqhgads

    User-Defined Table Function Error: MSG 4121

    Ah, That explains what is going wrong. I was just blithely assuming that I could say "select table_function (parameter)" to get the table. I was typing: select TfA(100) Using the logic "select can be used to return the value of a function, so why not just return the value of my table." Thanks!
  12. Fhwqhgads

    User-Defined Table Function Error: MSG 4121

    Denis, Thank you for your reply...but I do not understand. Do you mean you do not prefix with dbo in the create command or when executing or at all? The references I have seen show prefixing with the owner, which in this case is dbo [I assume]. I am looking at...
  13. Fhwqhgads

    User-Defined Table Function Error: MSG 4121

    I noticed a couple other people getting this same error, but none of the solutions offered appear to be relevant to my case. When I make a new table-valued UDF, whether in-line or multi-statement, I always get the following error when trying to use it: Msg 4121, Level 16, State 1, Line 2...

Part and Inventory Search

Back
Top