PostSnapshotScript Property
Dieses Feature wird in einer zukünftigen Version von Microsoft SQL Server entfernt. Verwenden Sie dieses Feature beim Entwickeln neuer Anwendungen nicht, und planen Sie das Ändern von Anwendungen, in denen es zurzeit verwendet wird.
The PostSnapshotScript property specifies the complete path and file name of a Transact-SQL script that runs after an initial snapshot is applied to a Subscriber.
Syntax
object
.PostSnapshotScript [= value]
Parts
- object
An expression that evaluates to an object in the Applies To list
- value
A string that specifies the complete path and file name of the Transact-SQL script
Data Type
String
Modifiable
Read/write
Prototype (C/C++)
HRESULT GetPostSnapshotScript(SQLDMO_LPBSTR pRetVal);
HRESULT SetPostSnapshotScript(SQLDMO_LPCSTR NewValue);
Hinweise
Running Transact-SQL scripts after an initial snapshot is applied can be used to:
- Set up reporting environments that depend on stored procedures.
- Create custom views.
- Create user-defined functions.
Hinweis: If PostSnapshotScript is set, the script automatically runs when a subscription is reinitialized. Therefore, the script must be written so that its statements are repeatable.
You can also run Transact-SQL scripts during a replication operation using the ReplicateUserDefinedScript method.
Hinweis: |
---|
If an application calls PostSnapshotScript on an instance of SQL Server version 7.0, the constant, SQLDMO_E_SQL80ONLY, and the message "This property or method requires Microsoft SQL Server 2000 or later" are returned. |
Applies To:
Siehe auch
Verweis
PreSnapshotScript Property
ReplicateUserDefinedScript Method
Andere Ressourcen
Ausführen von Skripts vor und nach dem Anwenden des Snapshots