Monday, August 12, 2013

[SQL Server] Testing with Profiler Custom Events and Database Snapshots

  1. Testing with Profiler Custom Events and Database Snapshots ...

    www.sqlteam.com/.../testing-with-profiler-custom-events-and-database- snapshots
    22 Jun 2009 ... We've all had them. One of those stored procedures that is huge and contains
    complex business logic which may or may not be executed.

  2. Testing with Profiler Custom Events and Database Snapshots ...

    www.sswug.org/articles/viewarticle.aspx?id=45179
    (Mike Femenella) We've all had them. One of those stored procedures that is
    huge and contains complex business logic which may or may not be executed.

  3. Performance and Memory Java Profiler - YourKit Java Profiler

    www.yourkit.com/features/ - Cached
    Java profiler. ... "Quick Info" view: Ability to automatically capture snapshots on
    event: Ability to compare memory snapshots: Automated comprehensive memory
     ...

  4. Testing with Profiler Custom Events and Database Snapshots

    sqlsample.blogspot.com/.../ Testing%20with%20Profiler%20Custom%20Events%20and%20Dat... - Cached
    23 May 2013 ... Testing with Profiler Custom Events and Database Snapshots. Weekly SQL
    Server newsletter with articles, forum posts, and blog posts via ...

  5. Basit A. Farooq - United Kingdom | LinkedIn

    uk.linkedin.com/in/basitfarooq - Cached
    Leeds, United Kingdom - Lead/Senior Database Administrator at Parabis Group
    View Basit A. Farooq's (United Kingdom) professional profile on LinkedIn. ...
    Service Broker, SSIS, Visio, Database Mirroring, LogShipping, Database
    Snapshots.

  6. Free SQL Server Tools Software and Utilities - SQL Server Utilities

    www.sqlserverutilities.com/SQL-Server-Utilities-Free-SQL-Server-Tools- Software-and-Utilities-for-the-DBA-and-Developer.htm - Cached - Similar
    RML Utilities for SQL Server (x86) and (x64) - tools to help database
    administrators manage the performance of ... SQLTrace, Profiler & Extended
    Events.

  7. Database Project Settings - MSDN - Microsoft

    msdn.microsoft.com/en-us/library/hh272681(v=vs.103).aspx - Cached
    You use database project settings to control aspects of your database,
    debugging ... If this check box is cleared, file names for objects take the form
    ObjectName.

  8. How to maintain and troubleshoot BizTalk Server databases

    support.microsoft.com/kb/952555 - Cached - Similar
    Microsoft BizTalk Server databases and the health of the databases are very ..... If
    these tracking events are not needed, clear the check box for this option in the ...

  9. SqlPackage.exe - MSDN - Microsoft

    msdn.microsoft.com/en-us/library/hh550080(v=vs.103).aspx - Cached
    Extract: Creates a database snapshot (.dacpac) file from a live SQL Server or ....
    The profile defines a collection of properties and variables to use when ...

  10. Working with Models ? Phalcon 1.2.1 documentation

    docs.phalconphp.com/en/latest/reference/models.html - Cached
    If you need to work with databases at a lower level check out the Phalcon\Db ...
    This method aids in setting up the model with a custom behavior i.e. a different ...

  11. [DOC] 

    Providing High Availability using Database Mirroring - Microsoft

    download.microsoft.com/download/d/9/4/.../ReplicationAndDBM.docx - Cached
    This agent applies the (optional) initial snapshot to the Subscribers and .... Create
    a custom profile by using a system-defined profile as a template, and then add ...

  12. New Features In Oracle Enterprise Manager Cloud Control 12c

    docs.oracle.com/cd/E24628_01/doc.121/e25353/whats_new.htm - Cached
    For example, when a new version of Oracle Database is released, you can
    simply .... These entities can be consumed in custom job types defined for the
    plug-in.

  13. Monitoring and Tuning the Database - 11g Release 2 (11.2)

    docs.oracle.com/cd/E25054_01/server.1111/.../montune.htm - Cached
    Other alerts correspond to database events such as Snapshot Too Old or ...... A
    green check mark in the SQL Profile column indicates a recommendation that ...

  14. Appendix: Common DBA Tasks for Microsoft SQL Server - Amazon ...

    docs.aws.amazon.com/.../latest/.../Appendix.SQLServer.CommonDBATasks. html - Cached
    This section describes the Amazon RDS-specific implementations of some
    common DBA tasks for DB Instances that are running the Microsoft SQL Server ...

  15. Techniques for improving online data cleanup in a WebSphere ... - IBM

    www.ibm.com/developerworks/websphere/.../0808_voldman.html - Cached - Similar
    As the database grows, the performance and maintainability of the site are ... You
    will learn techniques to implement, test, and tune cleanup scripts, and to ...

  16. Activiti 5.13 User Guide

    www.activiti.org/userguide/
    Custom extensions; Events. Event Definitions; Timer Event ...... autoReconnect=
    true, Tested using mysql-connector-java database driver. oracle, 11.2.0.1.0 ...

  17. [PDF] 

    DBA Guide to Databases on VMware - White Paper

    www.vmware.com/files/.../DBA_Guide_to_Databases_on_VMware-WP.pdf - Cached
    Developing and Testing Databases on VMware . ..... provided by leading storage
    vendors to automate the process of recovering from a disaster event.

  18. RegOnline Features ? Badges, Custom Events Websites, Email ...

    www.regonline.ca/__features/ - Cached
    1) Charts 2) Event Statistics 3) The custom event URL 4) EASY navigation ...
    Build directories in tabbed, contact card, and full profile formats. Better organize ...

  19. The Grails Framework 2.2.4

    grails.org/doc/latest/guide/single.html - Similar
    4.7.6Snapshots and Other Changing Dependencies ..... For example when
    running with a custom Grails environment called "production", a Spring profile of
     ...

  20. DB Tools for Oracle - SoftTree Technologies, Inc.

    www.softtreetech.com/dbtools/ - Cached
    DB Difference Expert can create historical "point-in-time" object, schema or
    database snapshots; anticipate schema change impact and dependencies. No
    DBA ...

[SQL Server] Efficiently Reuse Gaps in an Identity Column

  1. Efficiently Reuse Gaps in an Identity Column - SQLTeam.com

    www.sqlteam.com/article/efficiently-reuse-gaps-in-an-identity-column - Similar
    9 Feb 2010 ... This article will demonstrate an efficient way to reuse gaps in an identity column.
    Please note that this is something you normally shouldn't be ...

  2. SQL Server Forums - Article: Efficiently Reuse Gaps in an Identity ...

    www.sqlteam.com/forums/topic.asp?TOPIC_ID=139584 - Cached
    This article will demonstrate an efficient way to reuse gaps in an identity column.
    Please note that this is something you normally shouldn't be ...

  3. Efficiently Reuse Gaps in an Identity Column from sqlteam.com

    browse.feedreader.com/c/SQLTeam_com_Articles/14422587 - Cached
    9 Feb 2010 ... Efficiently Reuse Gaps in an Identity Column. This article will demonstrate an
    efficient way to reuse gaps in an identity column. Please note that ...

  4. Less Than Dot - Blog - What To Do When Your Identity Column ...

    blogs.lessthandot.com/.../what-to-do-when-your-identity-column-max - Cached
    6 Mar 2009 ... http://weblogs.sqlteam.com/peterl/archive/2009/03/10/How-to-efficiently-reuse-
    gaps-in-identity-column.aspx. 03/10/09 @ 12:39. Comment from: ...

  5. Efficiently Reuse Gaps in an Identity Column - SQLTeam ... - Google+

    https://plus.google.com/117791377540125472005/.../ShxUNrVsjwv - Cached
    23 Jan 2013 ... Efficiently Reuse Gaps in an Identity Column - SQLTeam.com #sqlserver #sql
    http://ow.ly/h3D6f.

  6. How do I fill in identity gaps? - Ask SqlServerCentral

    ask.sqlservercentral.com/.../2844/how-do-i-fill-in-identity-gaps.html - Cached
    You can also read this blog post http://weblogs.sqlteam.com/peterl/archive/2009/
    03/10/How-to-efficiently-reuse-gaps-in-identity-column.aspx.

  7. id column gets biger then integer ?! : The Official Microsoft ASP ...

    forums.asp.net/t/prev/1629478 - Cached
    for the gaps : http://weblogs.sqlteam.com/peterl/archive/2009/03/10/How-to-
    efficiently-reuse-gaps-in-identity-column.aspx. (but be aware of ...

  8. Auto Identity Column in SQL Server : The Official Microsoft ASP ...

    forums.asp.net/t/prev/1793104 - Cached
    http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=98389. http://www.sqlteam.
    com/article/efficiently-reuse-gaps-in-an-identity-column. Reply ...

  9. Twitter / JRFire: RT: @sqlteam Efficiently Reuse ...

    https://twitter.com/JRFire/status/8855370476
    RT: @sqlteam Efficiently Reuse Gaps in an Identity Column: This article will
    demonstrate an efficient way to reuse ... http://bit.ly/bk1cTJ. Reply; Retweet ...

  10. IDENTITY (Property) - TechNet - Microsoft

    social.technet.microsoft.com/.../240452d5-8ea9-45f8-9506-a3a0879b0330 - Cached
    17 Nov 2010 ... Efficiently Reuse Gaps in an Identity Column. http://www.sqlteam.com/article/
    efficiently-reuse-gaps-in-an-identity-column. bug again what you ...

  11. Sql samples, sql tips: Efficiently Reuse Gaps in an Identity Column

    sqlsample.blogspot.com/2013/.../efficiently-reuse-gaps-in-identity.html - Cached
    4 Apr 2013 ... Efficiently Reuse Gaps in an Identity Column. Weekly SQL Server newsletter with
    articles, forum posts, and blog posts via email. Subscribers ...

  12. The HOBT: The IDENTITY Property: A Much-Maligned Construct in ...

    thehobt.blogspot.com/2009/.../identity-property-much-maligned.html - Cached
    28 Jan 2009 ... Identity columns do not serialize inserts ? custom written ... Again, I understand
    that there are some applications for which gaps simply aren't ...

  13. Filling The Gap Identity Columns - Forum Array

    forumarray.com/filling-the-gap-identity-columns-821132 - Cached
    Filling The Gap Identity Columns. Hello, In my application I am using Identity
    columns. When some rows are deleted from table, This identity values are not
    filling ...

  14. MS SQL Server :: Filling The Gap Identity Columns - BigResource

    www.bigresource.com/MS_SQL-Filling-the-gap-Identity-columns-JtvHr8Jg. html - Cached
    I do not want to re-use the already used Identity value. I just want to ... gaps in the
    sequence etc. so would it be less efficient for me to calculate the field than ...

  15. SQL Server find first gap between ID key fields - Stack Overflow

    stackoverflow.com/.../sql-server-find-first-gap-between-id-key-fields - Cached
    It gets the first free ID (if there are gaps) or the last one + 1 given a @tableName
    and @column. If there are no rows, it returns as the first ID = 1.

  16. Creating a table to store sequence numbers - Beyond Relational

    beyondrelational.com/.../sqlserver-quiz-general-2010-dinesh-asanka- populating-a-table-with-default-values.aspx - Cached
    20 Oct 2010 ... Peter explained this in http://www.sqlteam.com/article/efficiently-reuse-gaps-in-an
    -identity-column. Method 2: Maintaining an another table with ...

  17. How can I dump & load MS-SQL preserving identity columns? - sql ...

    www.pressingquestion.com/.../How-Can-I-Dump--Load-Ms-sql-Preserving- Identity-Columns%3F - Cached
    21 Oct 2009 ... I reseed identity columns like this: EXEC sp_MSforeachtable "DBCC ... SQL
    server; SQL server does not "go back" and re-use gaps in iden.

  18. The MUMmer 3 manual - MUMmer - SourceForge

    mummer.sourceforge.net/manual/ - Cached - Similar
    This modular design has an important side effect, it allows for the easy reuse of ...
    annotation tools based on the efficient matching algorithm MUMmer provides.

  19. [PDF] 

    ALAE: Accelerating Local Alignment with Affine Gap Exactly - VLDB ...

    vldb.org/pvldb/vol5/p1507_xiaochunyang_vldb2012.pdf - Cached
    an accurate and efficient algorithm for evaluating local-alignment searches,
    especially for long ... to prune meaningless calculations and an algorithm for
    reusing.

  20. Mapper Configuration ? SQLAlchemy 0.9 Documentation

    docs.sqlalchemy.org/en/latest/orm/mapper_config.html - Cached
    from sqlalchemy import Table, MetaData, Column, ForeignKey, Integer, String ......
    The identity of an AddressUser object will be in terms of these two values, and ...

[SQL Server] Using REPLACE in an UPDATE statement

  1. Using REPLACE in an UPDATE statement - SQLTeam.com

    www.sqlteam.com/article/using-replace-in-an-update-statement - Similar
    31 Mar 2010 ... This article covers using the REPLACE function to selectively replace text inside
    a string in SQL Server. The REPLACE function is easy to use ...

  2. Using REPLACE in a UPDATE statement - Dev Shed

    forums.devshed.com/...sql.../using-replace-in-a-update-statement-479993. html - Cached - Similar
    Using REPLACE in a UPDATE statement- Firebird SQL Development. Visit Dev
    Shed to discuss Using REPLACE in a UPDATE statement.

  3. SQL Update Replace statement - Stack Overflow

    stackoverflow.com/questions/9525184/sql-update-replace-statement - Cached
    I need to write a sql update statement using REPLACE. The string looks like 'SE*
    88*000000001'. I need to replace the number between the two ...

  4. error while using replace in an update statement in sql server 2008 ...

    stackoverflow.com/.../error-while-using-replace-in-an-update-statement-in- sql-server-2008 - Cached
    What error are you getting ... Major Error 0x80040E14, Minor Error 25501 >
    update table US14-HSS-SQUARE_AISC14-HSS-SQUARE set ...

  5. sql server 2005 - How to update a part of the string using replace ...

    stackoverflow.com/.../how-to-update-a-part-of-the-string-using-replace- function-in-tsql - Cached
    Hi I have a column of nvarchar(1000) type. I need to get rid of encode ... This will
    replace in the entire column. REPLACE(MyColumn, '&', '&').

  6. sql - Oracle UPDATE statement using the `REPLACE` function ...

    stackoverflow.com/.../oracle-update-statement-using-the-replace-function - Cached
    I am trying to remember how form a proper REPLACE statement in ... UPDATE
    TABLENAME SET COLUMN1 = ' ', SET COLUMN2 = ' ' WHERE ...

  7. tsql - T-SQL String replace in Update - Stack Overflow

    stackoverflow.com/questions/4350482/t-sql-string-replace-in-update - Cached
    I need to update the values so that @domain2 should be replaced to @ ...
    Replacing a string using SQL Server Replace function - string has ...

  8. How to replace a string in a SQL Server Table Column - Stack ...

    stackoverflow.com/.../how-to-replace-a-string-in-a-sql-server-table-column - Cached - Similar
    i have a table (SQL Sever, in this case) which references paths (UNC or .... How
    can I update multiple columns with a Replace in SQL server?

  9. mysql - Why would an UPDATE SET REPLACE() statement match ...

    dba.stackexchange.com/.../why-would-an-update-set-replace-statement-match -rows-but-change-none-and-give - Cached
    Why would an UPDATE SET REPLACE() statement match rows, but change ... I'
    m seeking a certain string in a field and want to replace it with...

  10. SQL UPDATE Statement - W3Schools

    www.w3schools.com/sql/sql_update.asp - Cached - Similar
    SQL UPDATE Example. Assume we wish to update the customer "Alfreds
    Futterkiste" with a new contact person and city. We use the following SQL
    statement:.

  11. How to use REPLACE() within NTEXT columns in SQL Server ...

    www.sidesofmarch.com/.../how-to-use-replace-within-ntext-columns-in-sql- server/ - Cached - Similar
    27 Feb 2008 ... If you're using SQL 2000, you're out of luck, as NVARCHAR(max) first .... SQL
    UPDATE syntax with a replace on a column of type ntext, ...

  12. Query to use update statement with Replace function in SQL Server ...

    www.aspdotnet-suresh.com/.../query-to-use-update-statement-with.html - Cached
    12 Jun 2012 ... In previous posts I explained Replace function example and Substring function
    example in SQL Server and many more articles relating to SQL ...

  13. Using REPLACE in an UPDATE statement - Ashish's Blog

    www.ashishblog.com/blog/using-replace-in-an-update-statement/
    30 Nov 2011 ... doing a search and replace in SQL is not radically difficult. You basically do an
    update using the replace() function.

  14. SQL statement for replace/update a stringvalue in an Oracle table ...

    ask.sqlservercentral.com/.../sql-statement-for-replaceupdate-a-stringvalue-in-a .html - Cached
    Please use replace in Oracle, can be done in one update statement. http://www.
    techonthenet.com/oracle/functions/replace.php. Probably you ...

  15. replace considerations for SQL

    pic.dhe.ibm.com/infocenter/rbdhelp/.../regl_data_sql_replace.html - Cached
    The statement produces an SQL UPDATE statement in the generated code. ...
    Before you use the replace statement, you must retrieve a row for subsequent ...

  16. Changing data in a table using the UPDATE statement

    publib.boulder.ibm.com/infocenter/iseries/.../sqlp/rbafyupdate.htm - Cached - Similar
    With the UPDATE statement, you can change the value of one or more ...
    Replace the column's current value with the null value, using the keyword NULL.

  17. update using replace function - Dbasupport.com

    www.dbasupport.com/.../showthread.php?26372-update-using-replace... - Cached
    I can use select replace (col_nm '-') from table to get the data without dashes but
    how can I use this function in an update statement. Thanks.

  18. Replacing part of field data of table with another string using SQL

    www.plus2net.com/sql_tutorial/replace.php - Cached - Similar
    We know how to change data inside a field by using update command inside a
    query. Here we will try to learn how to replace part of the data without changing ...

  19. Inserting or updating records using MySQL REPLACE INTO ...

    blogs.coldbuffer.com/inserting-or-updating-records-using-mysql-replace - Cached
    Inserting or updating records using MySQL REPLACE INTO. Inserting records
    into a specific table can be achieved simply by using the INSERT statement while
     ...

  20. OraFAQ Forum: SQL & PL/SQL ? update using replace function

    www.orafaq.com/forum/t/170809/0/ - Cached
    I have a table called email that contains a field called email. I have a few records
    in the table that contain example@hotmial.com and want to ...

[SQL Server] Handling SQL Server Errors

  1. TRY...CATCH (Transact-SQL) - TechNet - Microsoft

    technet.microsoft.com/en-us/library/ms175976.aspx - Cached
    Implements error handling for Transact-SQL that is similar to the exception ...
    Errors that have a severity of 20 or higher that stop the SQL Server Database ...

  2. Error Handling in SQL Server ? a Background

    www.sommarskog.se/error-handling-I.html - Cached
    29 Nov 2009 ... However, when it comes to error handling... To be blunt: error handling in SQL
    Server is poor. It is a patchwork of not-always-so-consistent ...

  3. What is the best practice use of SQL Server T-SQL error handling ...

    stackoverflow.com/.../what-is-the-best-practice-use-of-sql-server-t-sql-error- handling - Cached - Similar
    We have a large application mainly written in SQL Server 7.0, where ... You
    should read this: http://www.sommarskog.se/error-handling-I.html.

  4. CODE Magazine - Article: Handling SQL Server Errors in Nested ...

    www.code-magazine.com/Article.aspx?quickid=0305111 - Cached - Similar
    Basic error handling in SQL Server's programming language, Transact-SQL, is
    straightforward.But when you nest calls to stored procedures, and the procedures
     ...

  5. Using TRY?CATCH to Handle SQL Server Errors - About Databases

    databases.about.com/od/sqlserver/a/try_catch.htm - Cached - Similar
    The TRY?CATCH statement in Transact-SQL allows you to detect and handle
    error conditions gracefully within your database applications. This statement is ...

  6. SQL SERVER ? 2005 ? Explanation of TRY?CATCH and ERROR ...

    blog.sqlauthority.com/.../sql-server-2005-explanation-of-trycatch-and-error- handling/ - Cached - Similar
    11 Apr 2007 ... CATCH and ERROR Handling. SQL Server 2005 offers a more robust set of tools
    for handling errors than in previous versions of SQL Server.

  7. SQL Server 2008 error handling best practice - Anthony Bloesch's ...

    blogs.msdn.com/b/.../sql-server-error-handling-best-practice.aspx - Cached - Similar
    10 Mar 2009 ... Error handling in SQL Server 2008 needs careful implementation. The Microsoft ?
    Oslo? Repository's API has the further problem that we cannot ...

  8. Handling SQL Server Errors - SQLTeam.com

    www.sqlteam.com/article/handling-sql-server-errors - Similar
    5 Apr 2010 ... This article covers the basics of TRY CATCH error handling in T-SQL introduced
    in SQL Server 2005. It includes the usage of common ...

  9. SQL Server Error Handling Tips

    www.mssqltips.com/sql-server-tip-category/79/error-handling/ - Cached
    Error Handling Tips. Raiserror. Using the NOWAIT option with the SQL Server
    RAISERROR statement. Throw. SQL Server 2012 Throw Statement Introduction.

  10. Handling Errors in SQL Server 2012 - Simple Talk

    https://www.simple-talk.com/sql/.../handling-errors-in-sql-server-2012/ - Cached
    3 Jan 2013 ... The error handling of SQL Server has always been somewhat mysterious. Now at
    last, the THROW statement has been included in SQL Server ...

  11. Overview of Error Handling in SQL Server 2005 - CodeProject

    www.codeproject.com/.../Overview-of-Error-Handling-in-SQL-Server-2005 - Cached
    1 Aug 2009 ... Overview of Error and Exception Handling in SQL Server 2005 using @@Error
    and Try-Catch; Author: Abhijit Jana; Updated: 1 Aug 2009; ...

  12. Exception Handling in SQL Server - CodeProject

    www.codeproject.com/Articles/.../Exception-Handling-in-SQL-Server - Cached
    17 Jul 2009 ... How to handle the errors effectively in SQL Server?; Author: Erode Senthilkumar;
    Updated: 17 Jul 2009; Section: Database; Chapter: Database; ...

  13. SQL Server Transactions and Error Handling - CodeProject

    www.codeproject.com/.../SQL-Server-Transactions-and-Error-Handling - Cached
    1 Jul 2003 ... SQL Server Transactions and Error Handling; Author: Saumendra Poddar;
    Updated: 2 Jul 2003; Section: Database; Chapter: Database; ...

  14. Tip (SQL Server): Error Handling in a Stored Procedure

    www.novicksoftware.com/.../tips-erorr-handling-in-a-stored-procedure.htm - Cached
    Tip (SQL Server): how to handle errors in a stored procedure.
  15. SQL Server Error Handling (Page 1 of 2) :: BlackWasp Software ...

    www.blackwasp.co.uk/SQLErrorHandling.aspx - Cached
    3 Oct 2010 ... Microsoft SQL Server 2005 introduced new error handling capabilities for scripts
    and stored procedures. This article describes the use of the try ...

  16. Error handling in sql server Part 56 - YouTube

    www.youtube.com/watch?v=VLDirfx_OQg6 Oct 2012 - 18 min - Uploaded by kudvenkat
    In this video we will lean about handling errors in sql server 2005, 2008 and 20012. Error ...
  17. Get a handle on errors in SQL Server stored procedures ...

    www.techrepublic.com/.../get-a-handle-on-errors-in-sql-server-stored- procedures/ - Cached
    19 Jul 2002 ... Error handling in SQL Server stored procedures is not difficult, but it may be
    different from what you're used to. Pick up the basics and a general ...

  18. Exception Handling in T-SQL Using @@ERROR: Why Bother?

    dataeducation.com/.../exception-handling-in-t-sql-using-error-why-bother - Cached
    22 Apr 2012 ... ERROR - Handle SQL Server exceptions at the lowest possible scope, in order to
    keep them from interacting with higher levels of the ...

  19. Error Handling

    users.atw.hu/progsql/prog_guide2sql0054.html - Cached
    SQL Server, Oracle, and DB2 all provide mechanisms for handling errors that
    occur in stored procedure code. Unfortunately, as you've probably guessed,
    these ...

  20. SQL Server Error Handling - SQLServerCentral.com

    www.sqlservercentral.com/Forums/FindPost1437210.aspx
    30 Mar 2013 ... Comments posted to this topic are about the item SQL Server Error Handling
    Follow me on Twitter: @way0utwest · Forum Etiquette: How to post ...

[SQL 2012] #Temptables, scope and SP_Execute

[SQL 2012] #Temptables, scope and SP_Execute


#Temptables, scope and SP_Execute

Posted: 12 Aug 2013 01:16 AM PDT

Hi there,I want to modify an SP to use #temp tables, as its very slow at the moment, but I have an issue. The queries I use to generate the contents of these temptables are dynamic, so I have to use sp_executeSQL to run them, and this means the temp tables are generated out of scope. Most people recommend creating your #temptable in the parent script and populating it inside the sp_executeSQL, but the issue I have is I don't know how many #temptables I'm going to need, so I need to be able to create them dynamically, and the only way I know how to do this is with sp_executeSQLI can't use ##temptables, as this SP might be run by more than one user at once.Is there any way I can make sp_executeSQL share scope with its parent script?Any help is very welcome

Excel 2013 for BI

Posted: 12 Aug 2013 12:14 AM PDT

Just wondering, it looks like Excel 2013 is going to be really cool for BI... especially stuff like GeoFlow etc for doing sort of "time lapse" sales analysis. Is it just me, or is it a significant upgrade from 2010?If it is, what are your favorite new features? I saw Kate & Emil's video on Geoflow, and it was seriously awesome. Any other really cool goodies in there that I'm missing?thanks!Pieter

[SQL Server] Using Dynamic SQL in Stored Procedures

  1. Building Dynamic SQL In a Stored Procedure - CodeProject

    www.codeproject.com/.../Building-Dynamic-SQL-In-a-Stored-Procedure - Cached
    9 Oct 2007 ... A dynamic SQL in a stored procedure is a single Transact-SQL statement or a set
    of statements stored in a variable and executed using a SQL ...

  2. Using Dynamic SQL in Stored Procedures - SQLTeam.com

    www.sqlteam.com/article/using-dynamic-sql-in-stored-procedures
    7 Mar 2011 ... Dynamic SQL allows stored procedures to ?write? or dynamically generate their
    SQL statements. The most common use case for dynamic SQL ...

  3. Using Dynamic SQL Statements in Stored Procedures ...

    www.4guysfromrolla.com/webtech/102300-1.shtml - Cached - Similar
    23 Oct 2000 ... We've all likely created ASP pages that contain dynamic SQL statements within
    the ASP pages... SQL statements that are constructed on the fly, ...

  4. Coding Dynamic SQL Statements - Oracle Documentation

    docs.oracle.com/cd/B10500_01/appdev.920/.../adg09dyn.htm - Cached
    For example, dynamic SQL lets you create a procedure that operates on a table
    ... "A Dynamic SQL Scenario Using Native Dynamic SQL"; "Choosing Between ...

  5. Dynamic SQL and stored procedure optimization - Stack Overflow

    stackoverflow.com/.../dynamic-sql-and-stored-procedure-optimization - Cached
    I've read that using Dynamic SQL in a stored procedure can hurt performance of
    your stored procedures. I guess the theory is that the store ...

  6. Get result from dynamic SQL in stored procedure - Stack Overflow

    stackoverflow.com/.../get-result-from-dynamic-sql-in-stored-procedure - Cached
    I'm writing a stored procedure where I need to dynamically construct a SQL
    statement within the procedure to reference a passed in table name ...

  7. Using OUTPUT Parameters within Dynamic SQL within Stored ...

    stackoverflow.com/.../using-output-parameters-within-dynamic-sql-within- stored-procedures-possible - Cached
    I have a SP that I have created to check for validations and return an ... Sorry for
    the delay :D, the following code works perfectly (For N.. output ...

  8. How to return values from a dynamic SQL Stored Procedure to the ...

    stackoverflow.com/.../how-to-return-values-from-a-dynamic-sql-stored- procedure-to-the-entity-framework - Cached
    I have a Stored Procedure which executes some dynamic SQL. ... I am doing
    something complex....that's why using dynamic sql...i want to use it ...

  9. The curse and blessings of dynamic SQL

    www.sommarskog.se/dynamic_sql.html - Cached - Similar
    In the introduction, I presented various strategies for data-access for an
    application, and I said that ...

  10. Using dynamic sql inside Oracle stored procedure - Database ...

    dba.stackexchange.com/.../using-dynamic-sql-inside-oracle-stored-procedure - Cached
    Assuming I have the following procedure. CREATE PROCEDURE foo ... The only
    reason why I might do that is if I needed to address an object ...

  11. Database - Advanced Stored Procedures Cursors and Dynamic SQL ...

    www.youtube.com/watch?v=B9zKi8H_IUs5 Feb 2013 - 13 min - Uploaded by Ron Eaglin
    A demonstration of using cursors and dynamic SQL to solve more complex reporting and ...
  12. Stored procedure - Wikipedia, the free encyclopedia

    en.wikipedia.org/wiki/Stored_procedure - Cached - Similar
    Also, some DBMSs will check the parameter's type. A stored procedure that in
    turn generates dynamic SQL using ...

  13. Speed Test: Dynamic SQL vs Stored Procedures :: BlackWasp ...

    www.blackwasp.co.uk/SpeedTestSqlSproc.aspx - Cached - Similar
    25 May 2008 ... This web site uses cookies. By using the site you accept the cookie policy. ...
    Speed Test: Dynamic SQL vs Stored Procedures. by Richard Carr ...

  14. Using Dynamic Sql Stored Procedure | Teradata Developer Exchange

    forums.teradata.com/forum/.../using-dynamic-sql-stored-procedure - Cached - Similar
    Hi ,I am trying to write a dynamic sql using Stored procedure wherein I am using
    the underlying table as one of the input parameters.Below is the SP which I am ...

  15. MySQL :: Using dynamic SQL in Informix's stored procedure..

    forums.mysql.com/read.php?64,548,548 - Cached - Similar
    Using dynamic SQL in Informix's stored procedure.. Posted by: Puneet (). Date:
    August 09, 2004 05:26AM. hi, i want to create a procedure in informix in which ...

  16. Return out parameter value from stored procedure while using ...

    social.msdn.microsoft.com/.../sqlserver/.../action?...stored-procedure...using- dynamic-sql... - Cached
    10 Jan 2013 ... Hi,. I have designed a stored procedure to convert any document in varbinary
    format. I want to return varbinary value using out parameter in ...

  17. Using Dynamic SQL with trigger and stored procedures - MSDN ...

    social.msdn.microsoft.com/.../sqlserver/.../action?...using-dynamic-sql...stored -procedures - Cached
    13 Feb 2008 ... Hi! I have an integration code write in T-SQL. It?s a TRIGGER that when some
    data is INSERTED on a specific table, verify the first caracter of a ...

  18. Customizing Operations by Using Stored Procedures Exclusively

    msdn.microsoft.com/en-us/library/bb546178.aspx - Cached
    You can modify the example provided in Customizing Operations By Using
    Stored Procedures by replacing even the first query (which causes dynamic SQL
     ...

  19. SQL injection: Dynamic SQL within stored procedures - The What ...

    https://blogs.msdn.com/.../sql-injection-dynamic-sql-within-stored-procedures .aspx - Cached
    5 Sep 2007 ... SQL injection: Dynamic SQL within stored procedures ... This is in spite of using
    parameterized input in data access code to call the stored ...

  20. Using Dynamic SQL in Stored Procedures ~ Gohil Infotech

    gohilinfotech.blogspot.com/.../using-dynamic-sql-in-stored-procedures.html - Cached
    27 Jun 2013 ... Dynamic SQL allows stored procedures to ?write? or dynamically generate their
    SQL statements. The most common use case for dynamic SQL ...

[T-SQL] How to add interim summary using T_SQL?

[T-SQL] How to add interim summary using T_SQL?


How to add interim summary using T_SQL?

Posted: 12 Aug 2013 12:13 AM PDT

My client has an application which also creates summary reports. My task is to improve those reports performance, as they have been written outside of SQL scope and only query SQL for the row data, i.e. SELECT * FROM myTable WHERE myRange.I need your advise to improve one of the reports, please. The following is an example of the expected result.I have used "Empty Space" because sqlservercentral removes the spaces for some reason, but if you will run my SQL you will see it in a correct way[b]"Customer Name" "Order Date" "Order Amount"[/b]HappyCustomer 1 01/05/2013 1000 "Empty Space" 04/05/2013 500 "Empty Space" 09/07/2013 20 TOTAL FOR HappyCustomer 1 1520HappyCustomer 2 01/01/2013 200"Empty Space" 08/04/2013 1200 TOTAL FOR HappyCustomer 2 1400Again, the application at the moment knows how to deal with it, but I need to re-write it in sql (Stored Procedure).The first task, to show customer's name only at the first line and to calculate total per customer was easy one(see working example below - implemented it via PARTITON BY), but I need your advise how to present in a required way, please. I mean how to add those [b]TOTAL FOR[/b] additional lines?WITH myResults AS(SELECT 1 AS customer_id, 'HappyCustomer 1' AS customer_name, GETDATE()-10 AS order_date, 12345 AS order_amount UNION ALL SELECT 1,'HappyCustomer 1', GETDATE()-9,322.32 UNION ALL SELECT 1,'HappyCustomer 1', GETDATE()-5,9875 UNION ALL SELECT 2,'HappyCustomer 2', GETDATE()-50,2387.5 UNION ALL SELECT 2,'HappyCustomer 2', GETDATE()-4,5467) SELECT CASE 1 WHEN ROW_NUMBER() OVER (PARTITION BY customer_id ORDER BY order_date) THEN customer_name ELSE '' END AS customer_name, order_date, order_amount, SUM(order_amount) OVER (PARTITION BY customer_id) AS total_per_customer FROM myResults; Thank you in advance

Logic for handling comma delimited column - tally table?

Posted: 11 Aug 2013 10:50 AM PDT

I have an excel sheet being imported with 8 columns. One column (say name)has comma delimited string.Difference with most other posts.. is that the 1 column that has the delimited string can have any number of values delimited. So some name field could be 12 substrings, some could be just 2.I need to ensure entire string < 2048 and every substring < 128Values will be checked for existence in current table.At the end, I will be displaying the values in the column as a string, but I could probably modify the stored procedure that displays info.I was thinking1) Use Tally Table to convert substrings to rows, but that would have a lot of repeated info with 8 columns.2) Use some other technique to convert substring to columns, but I have to check for the string with max values and then set those many columns with maybe a lot of nulls.I need some input as to what is the best way to handle this scenario.Any help is much appreciated.

NOT IN vs NOT EXISTS

Posted: 11 Aug 2013 07:13 PM PDT

I cant understand why these two statements gets different result for me.Statement with NOT IN gets no results.select *from Job_Queuewhere JobQueueID not in (SELECT JobQueueID from Payment)Statement with NOT EXISTS get a list of results.select *from Job_Queue jqwhere not exists (select * from Payment p where jq.JobQueueID = p.JobQueueID) Table definitions:CREATE TABLE [dbo].[Job_Queue]( [JobQueueID] [int] IDENTITY(1,1) NOT NULL, ... CONSTRAINT [Job_Queue_PK] PRIMARY KEY CLUSTERED ([JobQueueID] ASC) WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]) ON [PRIMARY]GOCREATE TABLE [dbo].[Payment]( [PaymentID] [bigint] IDENTITY(1,1) NOT NULL, [JobQueueID] [int] NULL, ... CONSTRAINT [Payment_PK] PRIMARY KEY CLUSTERED ([PaymentID] ASC) WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]) ON [PRIMARY]GO

How to alternate between two values in a column?

Posted: 11 Aug 2013 07:41 PM PDT

ShortType Outstanding Short_IdLong 2333.12 1Short 2333.12 1Long 2333.12 2Short 2333.12 2Long 2333.12 3Short 2333.12 3Long 2333.12 4Short 2333.12 4Long 2333.12 5Short 2333.12 5Is also possible to generate sql test data like the one above for 10000 rows without a table? By generating 10000 numbered rows in the Short_ID column at runtime would populate the other columns. All but two columns will have the same values repeating and ShortType will alternate between "Long" and "Short".Short_Id numbers will be repeat twice up to 10000 SQL Code so farSelect Long' AS ShortType ---- Long,Short everyother row,'2333.12' AS Outstanding,' ' AS Short_ID ?Thanks for the help.

Can this WHILE loop be replaced with a Tally table?

Posted: 11 Aug 2013 11:16 AM PDT

I'm making some changes to a report written with a while loop, and thought I would look at some performance improvements. I've been doing some reading on tally tables, and how they can in a lot of instances operate more efficiently than a WHILE loop. However, I'm having trouble getting my head around how it would work with a looping date logic.I've written a query below using adventure works, which is very similar to the structure of the the data I'm working with (note the date logic around start and end dates on the product dimension).Can anyone point me in the right direction on how a tally table might replace the WHILE loop?[code="sql"] USE [AdventureWorksDW2008R2]DECLARE @OrderDate DATETIME, @EndDate DATETIMESELECT @OrderDate = '20070625', @EndDate = '20070705'DECLARE @ResultsTable TABLE (SalesOrderNumber nvarchar(20),EnglishProductName nvarchar(50),EnglishDescription nvarchar(400), DealerPrice money, ProductStandardCost money, SalesAmount money, TaxAmt money, Freight money)WHILE @OrderDate <= @EndDateBEGININSERT INTO @ResultsTable SELECT fis.SalesOrderNumber , dp.EnglishProductName , dp.EnglishDescription , dp.DealerPrice , ProductStandardCost , SalesAmount , TaxAmt , Freight FROM dbo.FactInternetSales fis INNER JOIN dbo.DimDate orderdate ON fis.OrderDateKey = orderdate.DateKey INNER JOIN dbo.DimProduct dp ON fis.ProductKey = dp.ProductKey AND dp.StartDate <= orderdate.FullDateAlternateKey AND ( dp.EndDate IS NULL OR dp.EndDate > orderdate.FullDateAlternateKey )WHERE orderdate.FullDateAlternateKey = @OrderDate AND dp.ProductAlternateKey = 'BK-M68B-38' SET @OrderDate = @OrderDate + 1END SELECT * FROM @ResultsTable [/code]

self join - resolve Tsql

Posted: 11 Aug 2013 01:58 AM PDT

Hi,i am having the table as belowCol1 Col2G1 G2G3 P1P1 P2P2 G4G5 G6G7 G8but my expected out is :G1 G2G3 G4G5 G6G7 G8can you guys provide solution for this.

How to restrict to save duplicate date entry?

Posted: 11 Aug 2013 03:59 PM PDT

Hi Friends, I 've the table like below create table stude(stu_id int,leave_date datetime,reason varchar(20),is_save_mode varchar(20))insert into stude (stu_id,leave_date,reason,is_save_mode) values('002258','2013-08-15','Market Visit',' ')insert into stude (stu_id,leave_date,reason,is_save_mode) values('002258','2013-08-16','Market Visit',' ')Now My requirement is when student insert the date and try to make an save.before save the date and reason ve to validate already exists on table.if already exists means ll show show error mess?(i.e trying to insert into stude (stu_id,leave_date,reason,is_save_mode) values('002258','2013-08-15','Market Visit',' '))new date means update the column Is_save_mode='y' how to make procedure for these table?

locking queries

Posted: 11 Aug 2013 02:06 AM PDT

what type of locking will be happens when user executedselect * from table.what type of locking will be happens when user executedupdate table set col1=23 where col2=100when we have index in col2 what type of lock will be called.when we don't have index in col2 what type of lock will be called.

Search This Blog