background preloader

Sql

Facebook Twitter

Helpdb-2008. /* Compile from the command line with: csc /target:library helpdb.cs You may need to add C:\Windows\Microsoft.NET\Framework\v3.5 to your path. */ using System; using System.Data; using System.Data.SqlClient; using System.Data.SqlTypes; using Microsoft.SqlServer.Server; public partial class StoredProcedures { [Microsoft.SqlServer.Server.SqlProcedure] public static void helpdb(String dbname) { // Connect through the context connection. using (SqlConnection conn = new SqlConnection("context connection=true")) { conn.Open(); // Setup the command to run sp_helpdb.

helpdb-2008

SqlCommand cmd = new SqlCommand(); cmd.Connection = conn; cmd.CommandType = CommandType.StoredProcedure; cmd.CommandText = "sp_helpdb"; cmd.Parameters.Add("@dbname", SqlDbType.NVarChar, 128); cmd.Parameters["@dbname"].Value = @dbname; // And run it. How to share data between stored procedures. An SQL text by Erland Sommarskog, SQL Server MVP.

How to share data between stored procedures

Most recent update 2013-11-02. Introduction This article tackles two related questions: How can I use the result set from one stored procedure in another, also expressed as How can I use the result set from a stored procedure in a SELECT statement? How can I pass a table data in a parameter from one stored procedure to another? In this text I will discuss a number of possible solutions and point out their advantages and drawbacks. Here is a summary of the methods that I will cover. At the end of the article, I briefly discuss the particular situation when your stored procedures are on different servers, which is a quite challenging situation.

A related question is how to pass table data from a client, but this is a topic which is outside the scope for this text. Examples in the article featuring tables such as authors, titles, sales etc run in the old sample database pubs. OUTPUT Parameters Rewrite this procedure as: Table-valued Functions. Berkeley DB.

Sql olap

Sql reporting service. DB Testing. These are my notes on how I've gone about unit testing database functionality.

DB Testing

The examples are in Java, but I think the ideas are applicable to a variety of programming environments. I'm looking for better solutions. The problem is this: you have a SQL database, some stored procedures, and a layer of code sitting between your application and the database. How can you put tests in place to make sure your code really is reading and writing the right data from the database?

Original: April/May 2001. Updated: 2006-08-15: Cleaned up links, added a view from 2006. 2004-10-20: Added note on how DB testing has moved on. 2003-06-24: Updated links (thanks Ted). 2003-01-06: Added link to Martin Fowler and Pramod Sadalage's "Evolutionary Database Design" paper. 2002-02-08: Added link to Areca Chen's traditional Chinese translation. 2001-09-26: In resources, add link to Mock testing paper. 2001-07-31: Started to collect related items from the JUnit Yahoo!

Why bother? Approaches that don't work.

Sql xml