﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>SQLServerCentral / SQL Server 2008 / SQL Server 2008 - General  / SQL Server query Automation / Latest Posts</title><generator>InstantForum.NET v2.9.0</generator><description>SQLServerCentral</description><link>http://www.sqlservercentral.com/Forums/</link><webMaster>notifications@sqlservercentral.com</webMaster><lastBuildDate>Wed, 22 May 2013 07:52:34 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: SQL Server query Automation</title><link>http://www.sqlservercentral.com/Forums/Topic1379063-391-1.aspx</link><description>[quote][b]krishna30 (10/30/2012)[/b][hr]I am kind of new in writing Procedure's or dynamic SQL's. Any suggestion that you could help me out with.[/quote]A procedure should do a single thing. The academic term is 'single responsibility'If writing in C# or java or the like, you wouldn't write a class that can do one of 20 things depending on the parameters, that would be against so many coding practices. Same thing with SQL, don't write a procedure that depending on the parameters passed selects an employee, updates an order, deletes a product or drops the database.</description><pubDate>Wed, 31 Oct 2012 01:15:14 GMT</pubDate><dc:creator>GilaMonster</dc:creator></item><item><title>RE: SQL Server query Automation</title><link>http://www.sqlservercentral.com/Forums/Topic1379063-391-1.aspx</link><description>I concur with Gail on this one. If you are trying to come up with a one time process to generate the delete statements to incorporate into some other type of code, then it might be worth considering. But if you are trying to repeat the delete statement generation process, you might want to rethink your design.</description><pubDate>Tue, 30 Oct 2012 18:02:29 GMT</pubDate><dc:creator>George M Parker</dc:creator></item><item><title>RE: SQL Server query Automation</title><link>http://www.sqlservercentral.com/Forums/Topic1379063-391-1.aspx</link><description>I am kind of new in writing Procedure's or dynamic SQL's. Any suggestion that you could help me out with.This manual work is just making me go crazy :(</description><pubDate>Tue, 30 Oct 2012 17:47:14 GMT</pubDate><dc:creator>krishna30</dc:creator></item><item><title>RE: SQL Server query Automation</title><link>http://www.sqlservercentral.com/Forums/Topic1379063-391-1.aspx</link><description>I strongly recommend you do not go that design path. It's possible, it's not going to be fun and honestly it's not that good of an idea.</description><pubDate>Tue, 30 Oct 2012 16:58:16 GMT</pubDate><dc:creator>GilaMonster</dc:creator></item><item><title>RE: SQL Server query Automation</title><link>http://www.sqlservercentral.com/Forums/Topic1379063-391-1.aspx</link><description>What you are asking is possible through the blessing and curse of dynamic sql.  before you start in on dynamic sql have a read through this as it has a detailed section on SQL Injection risks when using dynamic sql along with a good primer on dynamic sql.[url]http://www.sommarskog.se/dynamic_sql.html[/url]</description><pubDate>Tue, 30 Oct 2012 16:06:59 GMT</pubDate><dc:creator>CapnHector</dc:creator></item><item><title>SQL Server query Automation</title><link>http://www.sqlservercentral.com/Forums/Topic1379063-391-1.aspx</link><description>Hi, I am testing one application I am preparing some queries as given belowStep1:SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.CONSTRAINT_COLUMN_USAGE WHERE TABLE_NAME = 'CMC_PDRA_RATE_AGES'Step 1 OutputCOLUMN_NAME ___________HIST_ROW_ID	PDRA_AGE_FROM	PDRA_REF_DTM	Step 2:Use the Columns name from step 1 and create a delte statement as given below.DELETE FROM [FACETS_TEST].CMC_PDRA_RATE_AGES WHERE HIST_ROW_ID	= '' AND PDRA_AGE_FROM	= '' AND PDRA_REF_DTM	= '';I have about 300 tables like to do. Is there any automated SQL statement that someone can recommend.THanks,Krishna</description><pubDate>Tue, 30 Oct 2012 15:59:24 GMT</pubDate><dc:creator>krishna30</dc:creator></item></channel></rss>