CodePaste Logo
New Snippet New Snippet Recent Snippets Recent Snippets My Snippets My Snippets Web Code Search Snippets Search
Sign inor Register
Format:
Recent snippets matching tags of database
SQL
CREATE PROC SearchAllTables
(
    @SearchStr nvarchar(100)
)
AS
BEGIN
    CREATE TABLE #Results (ColumnName nvarchar(370), ColumnValue nvarchar(3630))
 
    SET NOCOUNT ON
by Prithvi Ramana A   December 22, 2011 @ 6:46am
62 Views
no comments
 
SQL
select name as 'Database Name', [dbid] from master.dbo.sysdatabases
by Egli   November 09, 2011 @ 4:56pm
66 Views
no comments
 
SQL
/*
Since you cant alter the database straight away, you first need to kill the user thats currently connected to it...
So...
Step 1:
Get the session thats connected to that database
*/
 
select d.name, d.dbid, spid, login_time, nt_domain, nt_username, loginame
from master.dbo.sysprocesses p inner join master.dbo.sysdatabases d on p.dbid = d.dbid
where d.name = 'DATABASE NAME GOES HERE'
by Egli   November 01, 2011 @ 5:33pm
64 Views
no comments
 
C#
// ===============================================================================
// Microsoft Data Access Application Block for .NET
// http://msdn.microsoft.com/library/en-us/dnbda/html/daab-rm.asp
//
// SQLHelper.cs
//
// This file contains the implementations of the SqlHelper and SqlHelperParameterCache
// classes.
//
// For more information see the Data Access Application Block Implementation Overview. 
by mattjcowan   August 18, 2011 @ 8:46am
Tags: database
204 Views
no comments
 
C#
using System.Data;
using System.Data.OracleClient;
using Microsoft.Practices.EnterpriseLibrary.Data;
 
string sql = "DELETE from FFATA_RULES where N_ID = :N_ID";
Database db = DatabaseFactory.CreateDatabase();
System.Data.Common.DbCommand cmd = db.GetSqlStringCommand(sql);
db.AddInParameter(cmd, ":N_ID", DbType.Int32, ID);
db.ExecuteNonQuery(cmd);
by Gary Cline   September 22, 2010 @ 7:19am
153 Views
no comments
 
brought to you by:
West Wind Techologies



If you find this site useful and use it frequently please consider making a donation to support this free service.
Donate