sql-server-2005

Inserting and viewing data simultaneously from a single table

六眼飞鱼酱① 提交于 2019-12-25 03:44:25
问题 I want that as a user is inserting data into a table, he is also viewing it simultaneously. For this if I use a single table , then will it take more time & processing load because the 2 processes: INSERT and SELECT, both would occur on the same table? So I want that both the processes are executed separately on two different database objects. Like INSERT should be done on one database object and SELECT should be done from the other but the data which in inserted, would be seen by the Select

Connecting to SQL Server in ASP.NET

坚强是说给别人听的谎言 提交于 2019-12-25 03:36:30
问题 I am trying to connect to the SQL Server from Visual Web Developer using asp.net but I am facing some problems If anybody helps in this regard i will be greatful. public partial class _Default : Page { protected void Page_Load(object sender, EventArgs e) { SqlConnection conn = new SqlConnection("Server=localhost;" + "Database=DB;User ID=aaaa;" + "Password=aaaa"); conn.Open(); SqlDataReader reader = conn.ExecuteReader(); while (reader.Read()) { employeesLabel.Text += reader["Name"] + "<br />";

Cannot write to MS SQL database using PHP ODBC connection

北战南征 提交于 2019-12-25 03:30:48
问题 Problem: I can successfully use a select query in PHP using odbc_exec, however, I can not execute an INSERT INTO or UPDATE query. Resources: Windows Server 2003: IIS 6, SQL Server 2005. Here is my code: <?php require('../_DSN/DSN_M.php'); $cnnOra = odbc_connect($strarrDSN['dsn'], $strarrDSN['username'], $strarrDSN['pswd']); $res_slct = odbc_exec($cnnOra, " select * FROM person;") or die (odbc_errormsg()); odbc_result_all($res_sldr); $sqlupd = "UPDATE person SET person_ame='Steve Woz' WHERE pk

Configure SQL-SERVER without running service

余生颓废 提交于 2019-12-25 03:14:01
问题 Is it possible to change the location of the temp.mdf or other files without starting SQL-Server? I wanted to reactivate an old server but one of it's USB hard disk was been already used somewhere else. Now i'm unable to start the SQL-Server service in Configuration Manager. The event log has following entry: Event Type: Error Event Source: MSSQLSERVER Event Category: (2) Event ID: 17207 Date: 30.08.2011 Time: 15:53:10 User: N/A Computer: SQLSERV Description: FCB::Open: Betriebssystemfehler 3

Update statement in sql server 2005

邮差的信 提交于 2019-12-25 02:44:23
问题 Consider the following Dig, Assume that all the three tables have a column Is_Deleted by default it is set to 0 ... I want to update Is_Deleted=1 field of Customers table where CustId=2 only when the rows containing CustId=2 and Is_Deleted=1 in Orders and OrderItems Tables... I dont want to use Cascade option.. Any suggestion (source: microsoft.com) 回答1: Easiest way is EXISTS. I assume you want to check both Orders and OrderItems. This also means you only filter on CustID once. UPDATE C SET

Store image in database and retrieve it

冷暖自知 提交于 2019-12-25 02:43:05
问题 My code for inserting image in database is as follows: MemoryStream ms =new MemoryStream(); byte[] PhotoByte=null; PhotoByte=ms.ToArray(); pictureBox1.Image.Save(ms, ImageFormat.Jpeg); PhotoByte =ms.ToArray(); Str = "insert into Experimmm Values('" + PhotoByte + "','" + textBox1.Text + "')"; Conn.Open(); cmd.Connection = Conn; cmd.CommandText = Str; cmd.ExecuteNonQuery(); Conn.Close(); Which is going well. I can see binary data in ma database table like <Binary Data> My code for retrieving

How to make a SSIS transaction in my case?

徘徊边缘 提交于 2019-12-25 02:43:00
问题 I am using SSIS 2008. Let a person be defined by PersonID, a number. In my SSIS package, for each person, I first load some info into Table1 (with execute sql task) and then some info into Table2 (with execute sql task). I want this entire process to be considered as a transaction. That is, the transaction is complete only when information for A person is loaded both into Table1 and Table2. If we could not load info into Table2, then info already loaded in Table1 should not be committed. How

SSIS Connection Error - File name not valid

荒凉一梦 提交于 2019-12-25 02:13:18
问题 I'm seeing an issue with an SSIS (SQL Server 2005) job where I'm getting the following error: The file name "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\UNC\FOLDERS\filename.xls;Extended Properties="EXCEL 8.0;HDR=YES";" specified in the connection was not valid. My searching around this site and others indicates that the most common cause of this is a permissions error but I don't believe that's the case in this situation since any number of files have successfully been processed through

How to generate a date for the given time?

我怕爱的太早我们不能终老 提交于 2019-12-25 02:12:37
问题 Using VB.NET and SQL Server 2005 I want to generate a date according to the given Outtime, Am entering the value like ID Date Intime Outtime Holiday 001 23-02-2009 08:00:00 17:00:00 no 001 24-02-2009 17:00:00 08:00:00 no 001 25-02-2009 10:00:00 16:00:00 no 001 26-02-2009 18:00:00 20:00:00 no 001 27-02-2009 yes Expected Output Table1 ID Date Intime Outtime DateIn Dateout 001 23-02-2009 08:00:00 17:00:00 23-02-2009 23-02-2009 001 24-02-2009 17:00:00 08:00:00 24-02-2009 25-02-2009 001 25-02-2009

Nhibernate setting query time out period for commands and pessimistic locking

霸气de小男生 提交于 2019-12-25 02:11:19
问题 I wish to specify a specific command timeout (or LOCK_TIMEOUT) for an SQL and once this time out is reached an exception (or alert) has to be raised in nHibernate. The following is an example pseudo-code what I have written: using (var session = sessionFactory.OpenSession()) { using (var sqlTrans = session.BeginTransaction()) { ICriteria criteria = session.CreateCriteria(typeof(Foo)); criteria.SetTimeout(5); //Here is the specified command timout, eg: property SqlCommand.CommandTimeout Foo