Go Back   Webmaster Malaysia Forum » Website Design & Development » Website Programming

Reply
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 13-08-2003, 09:49 AM
New kid on the block
 
Join Date: May 2003
Location: johor bahru
Posts: 3
Rep Power: 0
aarkus is on a distinguished road
stored procedures n' trace flags <sql sever>

SQL SERVER 7.0

how can i EXEC stored procedure automatically?
i hav use trace flags 4022, which can do the task...
and create the stored procedure in the master dB,
but it still cant work, did i put the trace flags at the right place?
and how could the master dB trace which dB i use?
could anybody help me....

CREATE PROCEDURE [P11] AS
DBCC TRACEON (4022)
INSERT INTO TABLE1
{CODING...}
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 13-08-2003, 03:39 PM
Senior Webmaster
 
Join Date: Oct 2001
Location: Melbourne, AU
Posts: 456
Rep Power: 97
sufyan is on a distinguished road
Hi, try:

CREATE PROCEDURE proc_name
@Field1 varchar(50),
@Field2 varchar(50)
As
INSERT INTO Table(Field1, Field2)
values(@Field1, @Field2)
Go

You can name 'proc_name' whatever you want the procedure to be called.

What do you mean by master DB? If you talking about the procedures, the system doesn't read from a mater database. When you make your SQL statement, you would use the database that you want to use (when you establish the connection).

To call the procedure you would execute:
proc_name Field1 Field2
(change as required)

Last edited by sufyan; 13-08-2003 at 04:14 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 13-08-2003, 04:17 PM
Senior Webmaster
 
Join Date: Oct 2001
Location: Melbourne, AU
Posts: 456
Rep Power: 97
sufyan is on a distinguished road
As for DBCC TRACEON (4022), try executing it seperatly.

DBCC TRACEON (4022)
Go

DBCC TRACEON (4022) is basically used to ignore automatically started procedures.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Dedicated Sever promotion - Limited Stock AntonWong Web Hosting Offers 2 30-11-2006 10:04 PM


All times are GMT +8. The time now is 04:05 AM. Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO 3.1.0 vBulletin skin by ForumMonkeys.com.


WebmasterMalaysia.com is Proudly Hosted by Exabytes Semi Dedicated Server.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61