Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Trigger at database level
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Client/serveur
Divers
Thread ID:
00114127
Message ID:
00115446
Vues:
14
Hi Jayesh,

SQL Server does not supports parameters in views the way Oracle supports it. Though you could achieve the same using a stored procedure.

Lets say we want to call a stored proc, ParaCityName, in Pubs that returns Authors by their cities;
CREATE PROCEDURE ParaCityName @vp_CityName varchar(32) 
AS
SELECT * from authors WHERE city like @vp_CityName
GO
The first line in the stored procedure has the as-yet undeclared @vp_CityName varchar(32). By phrasing the create statement this way you have built in the place holder for the incoming parameter.

The rest you leave it on VFP.
lnConn = SQLCONNECT('pubs','sa','')
=SQLEXEC(lnConn, 'ParaCityName "C%" ', 'MyCursor')
This will return all the city names that begin with letter "C".


>Hi Kamal,
>
> Jayesh here. I need to know one thing about SQL Server Views.
>I want to make a parameterized view in SQL Server 6.5 just like VFP's
>local/remote views. Oracle supports this.
>
>For example
>
>CREATE VIEW myview AS SELECT * FROM CUSTOMER
>WHERE cid = &vp_cid
>
>Bye
>Jayesh
>
>
>>Hi Michel,
>>
>>This is the information I got from one of our SQL Server experts:
>>
>>In a particular database you can run sp_tables which will produce a list of tables and the owner (which I assume is what is meant by who created them). To find the creation date you have to query the sysobjects table. It has a column crdate. So a select name,crdate from sysobjects where type = 'U' will list all user defined tables (as opposed to system tables) in a particular database. If you need anything further let me know. (JosephL@flashcreative.com)
>>
>>
>>>Is there a possibility to have a trigger at the database level on SQL Server 6.5? We would like to have a trigger to store a value whenever we add a new table to the database. Or, is there another mecanism to know that we have added a new table. Like to scan the systable.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform