Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 global function or parameter

Author  Topic 

rizo
Starting Member

16 Posts

Posted - 2012-11-21 : 06:45:51
Hi guys,

is there a way of using global functions or paramenters in TSQL?
Simply I want it to do this like in Access.

SELECT *
FROM table1
WHERE (((table1.id)=current_productID1()));
this is achieved by creating a funtion in Access.

Is there a way to do this in TSQL?
This criteria filter will be used in different queries/views etc.
What is the feature I want that will do this?
thanks


rizo

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2012-11-21 : 07:14:55
See here: http://www.simple-talk.com/sql/t-sql-programming/sql-server-functions-the-basics/


Too old to Rock'n'Roll too young to die.
Go to Top of Page

rizo
Starting Member

16 Posts

Posted - 2012-11-21 : 09:50:31
thanks for that but I dont think that is what I'm looking for.
This simply runs the same query every time yo call it doesnt it?.
I want to set up a function/variable and apply this as a filter/criteria.


rizo
Go to Top of Page

rizo
Starting Member

16 Posts

Posted - 2012-11-22 : 05:42:51
anyhting?

rizo
Go to Top of Page
   

- Advertisement -