Click here to Skip to main content
15,900,258 members
Home / Discussions / Database
   

Database

 
AnswerRe: Why is a null value still being passed to the next insert statement in this stored procedure? Pin
Eddy Vluggen6-Feb-10 11:37
professionalEddy Vluggen6-Feb-10 11:37 
GeneralRe: Why is a null value still being passed to the next insert statement in this stored procedure? Pin
tonyonlinux6-Feb-10 12:13
tonyonlinux6-Feb-10 12:13 
QuestionSQLServer 2005 User Permission Pin
Tim Carmichael5-Feb-10 10:25
Tim Carmichael5-Feb-10 10:25 
AnswerRe: SQLServer 2005 User Permission Pin
Mycroft Holmes6-Feb-10 0:01
professionalMycroft Holmes6-Feb-10 0:01 
QuestionSQL express Pin
GauravKP5-Feb-10 8:11
professionalGauravKP5-Feb-10 8:11 
QuestionSQL SERVER 2008 Pin
jonhbt5-Feb-10 3:52
jonhbt5-Feb-10 3:52 
GeneralRe: SQL SERVER 2008 Pin
Tim Carmichael5-Feb-10 4:45
Tim Carmichael5-Feb-10 4:45 
GeneralRe: SQL SERVER 2008 Pin
jonhbt7-Feb-10 23:18
jonhbt7-Feb-10 23:18 
Hi, I have a list of table that I need to make them available for auditing by using that particular procedure. I had in mind to call that procedure in a cursor which identifies the table names, builds the script for that procedure by passing the table name and the source to the procedure and executes it. This procedure will be repeated for all the tables. This will avoid hard coding the procedure for all the tables (which I have over 150).

Yes yu're right they should be as listed below;

 DECLARE Alter_tables_cursor CURSOR FAST_FORWARD
   FOR
   select table_name from information_schema.tables where table_name<>'dtProperties' and table_type<>'VIEW'
		OPEN Alter_tables_cursor
		DECLARE @tablename sysname
		FETCH NEXT FROM Alter_tables_cursor INTO @tablename
			WHILE ( @@FETCH_STATUS = 0 )
				BEGIN
				
					EXECUTE 'sys.sp_cdc_enable_table
					@source_schema = N''dbo'',
					@source_name = N''TBL_ACTIVITY_ACT'',
					@role_name = NULL'	
				FETCH NEXT FROM Alter_tables_cursor INTO @tablename
				END

DEALLOCATE Alter_tables_cursor


Thanks for your reply.
Questiondynamic sql search condition in store procedure Pin
Mogamboo_Khush_Hua4-Feb-10 20:21
Mogamboo_Khush_Hua4-Feb-10 20:21 
AnswerRe: dynamic sql search condition in store procedure Pin
Mycroft Holmes4-Feb-10 20:47
professionalMycroft Holmes4-Feb-10 20:47 
GeneralRe: dynamic sql search condition in store procedure Pin
Mogamboo_Khush_Hua5-Feb-10 0:58
Mogamboo_Khush_Hua5-Feb-10 0:58 
GeneralRe: dynamic sql search condition in store procedure Pin
Mycroft Holmes5-Feb-10 10:08
professionalMycroft Holmes5-Feb-10 10:08 
AnswerRe: dynamic sql search condition in store procedure Pin
Giorgi Dalakishvili5-Feb-10 9:02
mentorGiorgi Dalakishvili5-Feb-10 9:02 
QuestionTwo Instances Of SQL Server??? Pin
AmbiguousName4-Feb-10 4:23
AmbiguousName4-Feb-10 4:23 
AnswerRe: Two Instances Of SQL Server??? Pin
David Mujica4-Feb-10 5:08
David Mujica4-Feb-10 5:08 
GeneralRe: Two Instances Of SQL Server??? Pin
AmbiguousName4-Feb-10 6:36
AmbiguousName4-Feb-10 6:36 
AnswerRe: Two Instances Of SQL Server??? Pin
debrah.h484-Feb-10 19:43
debrah.h484-Feb-10 19:43 
GeneralRe: Two Instances Of SQL Server??? Pin
Mycroft Holmes4-Feb-10 20:41
professionalMycroft Holmes4-Feb-10 20:41 
QuestionQuery Analyser 'responce time' Pin
cjb1104-Feb-10 0:18
cjb1104-Feb-10 0:18 
AnswerRe: Query Analyser 'responce time' Pin
Corporal Agarn4-Feb-10 0:49
professionalCorporal Agarn4-Feb-10 0:49 
QuestionSQL Join Problem Pin
Nishad3-Feb-10 23:05
Nishad3-Feb-10 23:05 
AnswerRe: SQL Join Problem Pin
Mycroft Holmes3-Feb-10 23:13
professionalMycroft Holmes3-Feb-10 23:13 
AnswerRe: SQL Join Problem Pin
Pranay Rana3-Feb-10 23:52
professionalPranay Rana3-Feb-10 23:52 
AnswerRe: SQL Join Problem Pin
masoumeh201010-Feb-10 18:29
masoumeh201010-Feb-10 18:29 
QuestionPL-SQL question, how to re-assign a value according to existing values Pin
alexyxj3-Feb-10 11:31
alexyxj3-Feb-10 11:31 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.