Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 

Content with tag Dynamic SQL Rss

   Items 1 to 19 of 19   
 

Best practice recommendations for writing Dynamic SQL

Note this is not “Best Practices when USING Dynamic SQL”. These are just good habits I’ve come up with over...  Read more...
By Kenneth Fisher 2013/06/13 | Source: SQLServerCentral.com | Category: blogs
Rating: (not yet rated) |  Discuss |   Briefcase | 2,813 reads

Check Candidate Columns for NOT NULL Constraints

This script reports table columns that allow NULL values but that currently have no NULL values, making them candidates for adding a NOT NULL constraint.  Read more...
By Charles Jacobus 2013/01/23 | Source: SQLServerCentral.com | Category: data integrity
Rating: |  Discuss |   Briefcase | 562 reads

Finding Dynamic SQL's Dependencies

The script finds dependencies of Dynamic SQL based on a table containing T-SQL Queries, DB's and Linked Servers in which it can be executed.  Read more...
By Arthur Gimpel 2012/10/15 | Source: SQLServerCentral.com | Category: dynamic sql
Rating: |  Discuss |   Briefcase | 777 reads

Basics of XML and SQL Server, Part 3: Transform and Shred XML in SSIS

This SSIS package performs multiple XSL transformations on an XML document, then shreds the transformed document and inserts its data into a SQL Server table.  Read more...
By Stan Kulp 2012/03/21 | Source: SQLServerCentral.com | Category: xml
Rating: |  Discuss |   Briefcase | 2,594 reads

Use Dynamic SQL to Improve Query Performance

This article by Jonathan Roberts demonstrates how to use dynamic SQL and overcome its downsides.  Read more...
By Jonathan Roberts 2012/02/17 (first published: 2010/05/20) | Source: SQLServerCentral.com | Category: dynamic sql
Rating: |  Discuss |   Briefcase | 26,042 reads

Methods For Converting a Stored Procedure

An interesting use of T-SQL to run a stored procedure as part of a SELECT statement to get a result set to be used and combined with other tables. From Eli Leiba, learn how you can build a stored procedure into your queries.  Read more...
By Eli Leiba 2011/04/08 (first published: 2009/10/29) | Source: SQLServerCentral.com | Category: t-sql
Rating: |  Discuss |   Briefcase | 29,662 reads

Using Dynamic SQL in Stored Procedures

Dynamic SQL allows stored procedures to “write” or dynamically generate their SQL statements. The most common use case for dynamic SQL is stored procedures with optional parameters in the WHERE clause. These are typically called from reports or screens that have multiple, optional search criteria. This article describes how to write these types of stored procedures so they execute well and resist SQL injection attacks.   Read more...
By Additional Articles 2011/03/22 | Source: SQLTeam.com | Category: t-sql
Rating: (not yet rated)  Rate this |   Briefcase | 6,392 reads

Using Certificates to Sign Stored Procedures

How to sign stored procedures with certificates, this is useful if the procedures use dynamic SQL.  Read more...
By Jonathan Roberts 2010/06/21 | Source: SQLServerCentral.com | Category: certificates
Rating: |  Discuss |   Briefcase | 7,513 reads

Use Dynamic SQL to Improve Query Performance

This article by Jonathan Roberts demonstrates how to use dynamic SQL and overcome its downsides.  Read more...
By Jonathan Roberts 2012/02/17 (first published: 2010/05/20) | Source: SQLServerCentral.com | Category: dynamic sql
Rating: |  Discuss |   Briefcase | 26,042 reads

Script Table or View structure

This code will let you script a Table or Views structure for source control.   Read more...
By Pratap Prabhu 2010/02/02 | Source: SQLServerCentral.com | Category: scripting
Rating: |  Discuss |   Briefcase | 2,016 reads

Methods For Converting a Stored Procedure

An interesting use of T-SQL to run a stored procedure as part of a SELECT statement to get a result set to be used and combined with other tables. From Eli Leiba, learn how you can build a stored procedure into your queries.  Read more...
By Eli Leiba 2011/04/08 (first published: 2009/10/29) | Source: SQLServerCentral.com | Category: t-sql
Rating: |  Discuss |   Briefcase | 29,662 reads

Loop Through every table in a DB

This Script has been build to list all the tables in a database without using a cursor.   Read more...
By Chris Morton 2009/01/20 | Source: SQLServerCentral.com | Category: metadata
Rating: |  Discuss |   Briefcase | 1,963 reads

search every database on server from a single sp

i have recently had the need to search the every database on the server for a particular string. i came up with this... it has lots of room for improvement but it works  Read more...
By Chris Morton 2008/12/19 | Source: SQLServerCentral.com | Category: search
Rating: |  Discuss |   Briefcase | 944 reads

How To Avoid Msg 106

When you have too many tables in a view, what can you do? New author Henrik Staun Poulsen brings us a solution that we   Read more...
By Henrik Staun Poulsen 2008/12/09 | Source: SQLServerCentral.com | Category: dynamic sql
Rating: |  Discuss |   Briefcase | 5,900 reads

Finding Values With Numerous Columns

Techniques for finding values in a denormalized table.  Read more...
By Timothy A Wiseman 2008/12/02 | Source: SQLServerCentral.com | Category: search
Rating: |  Discuss |   Briefcase | 8,009 reads

AUTOGENERATE Stored procedures example

This is related to my other autogenerate code. this is just an example of how to use it.   Read more...
By Chris Morton 2013/06/18 | Source: SQLServerCentral.com | Category: autogenerate
Rating: |  Discuss |   Briefcase | 624 reads

Demonstration on how to pivot data using temp tables

This script was designed to 'pivot' data that couldnt easily be pivoted in any other way. i used temporary tables to eventually achieve the result i was looking for :)  Read more...
By Chris Morton 2013/06/18 | Source: SQLServerCentral.com | Category: dynamic sql
Rating: |  Discuss |   Briefcase | 804 reads

Using the CASE expression instead of dynamic SQL

I have a lot of SQL update queries where I need to make IF/ELSE types of decisions. I am using a cursor in some cases but looping through thousands of rows for update takes a long time. I also use some dynamic SQL to handle some query parameter decision making. Is there a better alternative?  Read more...
By Additional Articles 2008/03/20 | Source: MSSQLTips.com | Category: t-sql
Rating:  Rate this |   Briefcase | 5,811 reads

The curse and blessings of dynamic SQL

How you use dynamic SQL, when you should - and when you should not.   Read more...
Rating:  Rate this |   Briefcase | 5,827 reads
   Items 1 to 19 of 19   
 
Tags
t-sql (6)    
stored procedures (3)    
metadata (2)    
search (2)    
temporary tables (2)    
autogenerate (1)    
blogs (1)    
c# (1)    
certificates (1)    
create database (1)    
cursor (1)    
data integrity (1)    
database design (1)    
debugging t-sql (1)    
dependencies (1)    
execute (1)    
execute  statement (1)    
insert update select (1)    
integration services (ssis) (1)    
loop (1)    
maintenance (1)    
master database (1)    
nested loop (1)    
normalization (1)    
objects (1)    
openrowset (1)    
parameters (1)    
pivot (1)    
report (1)    
scripting (1)    
splog (1)    
sql injection (1)    
structure (1)    
sys.dm_sql_referenced_entities (1)    
system view (1)    
table (1)    
table variables (1)    
vb.net (1)    
while loop (1)    
xml (1)    
xslt (1)