Looping
Is there any way to do a loop in a stored procedure? I have a "ripple effect" delete I need to and appearantly you can't do a join in a delete statement. A->B->C->D Table B is relationally tied to A Table C is relationally tied to B Table D is relationally tied to C If I delete a record in Table A, all ... 28 Jan 2006 22:21
Computing a Grand Total
I have inherited a table that has entries such as: AccountName, [Invoice No], [Sales Price] Qty, etc... I would like to have a SubTotal and GrandTotal. So, I have a select statement something like this: Select AccountName, Qty, [Invoice No], [Sales Price], [Sales Price] * Qty as SubTotal FROM ... That ... 24 Jan 2006 14:48
sa password rules
SQL Server 2005 rejects empty or very short sa passwords. Where can i read formal definition of sa password rules. I writing setup application which will install SQL Server Express in command line unattended mode. So i need to check sa password for its stronginess prior to passing it to SQL Server's install... 25 Jan 2006 09:03
Transaction log file size?
Hi, I'm just wondering, how big should the transaction log files be in relation to the database files? I noticed the the transaction log files on my server are quite a bit larger than the database files. Is this normal? Thanks in advance, Linn ... 23 Jan 2006 14:46
sa password
Is there default password for sa user in SQL Server 2005 Express Edition? ... 20 Jan 2006 11:53
Joining Tables
help please I have two tables I want to join, Table 1 (T1) nd Table 2 (t2). Table 1 has several fields A1,B1,C1......... etc and Table 2 has several Fields A2,B2,B3 etc I want to join A1 to A2, which is simple enough, but then I want to join B1 to B2 based on the field value in B1 being in the field B2 e... 20 Jan 2006 06:00
Slow Query with sp_prepare and sp_execute
Does anyone know why I would get a different execution plan when I use sp_prepare versus a straight T-SQL query? Running the query with sp_prepare is much slower than just a straight query. I believe it's slower due to the poor execution plan sp_execute chooses to use. For example, I have the following table... 18 Jan 2006 18:39
SQL 2005 Mirroring Databases
Im having trouble rying to mirroe a test database from one SQL2005 Server to a second SQL2005 Server I created a test database on SQL 1 ( server 1 ) and mad a full back up . i did a restore on SQL 2 ( server 2 ) through Management Studio and set the recovery option to RESTORE WITH NORECOVERY. when ok the res... 18 Jan 2006 11:51
set ANSI_NULLS ON
I just realized that the SQL Server 7 used set ANSI_NULLS off as default, but SQL Server 2005 use ANSI_NULLS on. I was modifying a stored procedure on a SQL Server 7 with the new SQL Management Studio 2005. The stored procedure I modified contained the following code: if (@value = null), but I did not pay attenti... 17 Jan 2006 04:44
Type Casting Problem
begin transaction create table t ( tuple varchar(30), ItemId integer, Name varchar(30), Weight integer, Price integer, Type varchar(30) ); insert into t values ('i1', 1, 'Soap', 4, 20, 'Non-Eatable'); insert into t values ('i2', 2, 'FacePowder', 250, 70, 'Non-Eatable'); insert into ... 18 Jan 2006 17:05