Archived Months
January 2003
March 2003
April 2003
May 2003
June 2003
July 2003
August 2003
September 2003
October 2003
November 2003
December 2003
January 2004
February 2004
March 2004
April 2004
May 2004
June 2004
July 2004
August 2004
September 2004
October 2004
November 2004
December 2004
January 2005
February 2005
March 2005
April 2005
May 2005
June 2005
July 2005
August 2005
September 2005
October 2005
November 2005
December 2005
January 2006
February 2006
March 2006
April 2006
May 2006
June 2006
July 2006
August 2006
September 2006
October 2006
November 2006
December 2006
January 2007
February 2007
March 2007
April 2007
May 2007
June 2007
July 2007
August 2007
September 2007
October 2007
November 2007
April 2008
all groups > sql server programming > may 2007 > threads for tuesday may 29

Filter by Day: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31

SQL Server RollBack History
Posted by Que at 5/29/2007 10:52:19 PM
Hi I have an application that commits Transactions to MSSQL Server 2000 DB. I am not sure when or why transactions fail as this happens sometimes and is not regular. Is it possible to look within the DB and check for possible Roll Back History as to when roll backs happened and if possib...more >>


Stored Procedure querying for a particular year
Posted by RuthE at 5/29/2007 10:21:01 PM
I have written the stored procedure below. My intention is to execute the SP and only get information for the year 2000. I ran the query separately so I know there is data for 2000 but I get a blank when I add the year. use bellpeek IF Object_ID('spCombineCustData7') IS NOT NULL DROP Proc ...more >>

Need help with subquery on same table
Posted by Spaz at 5/29/2007 8:34:00 PM
help with same table subquery I am trying to extract and compare 2 sets of data from the same table in a T-SQL (or even SP) but am running into a major head ache. The sample database layout is as follows: [GroupSeqNumber] = is a bit column that contains an int value for each batch load. ...more >>

how safe it is to use Max + 1
Posted by Ed at 5/29/2007 7:12:00 PM
Hi, I have a process (Trigger) that uses Max(SequenceNumber) + 1 from a table instead of using identity column to insert record to another table. I would like to know what if two prcoesses happen exactly at the same time or one prcoess is not commited yet but another process also get the s...more >>

making views refresh themselves
Posted by jeljeljel at 5/29/2007 6:25:56 PM
I have a view (vwParent) that inner joins with another view (vwChild). If the underlying vwChild view is modified, the vwParent still returns the old columns it originally returned. Only rerunning the vwParent view corrects the issue. I have sample sql below that clearly illustrates the issu...more >>

AVG in query help
Posted by Hulicat at 5/29/2007 4:28:32 PM
I have the following stored prodecure and I need to add the average time of the "Total closed for range" was opened for. ( @startdate datetime, @enddate datetime ) as select count(*) as 'Total closed for range', Priority_type_name 'Priority', location_name 'Cient', email 'Engineer' fr...more >>

Declare Variable problem...
Posted by ThomBeaux at 5/29/2007 3:44:00 PM
Our system is starting to slow done when something like this takes 15-20 seconds: declare @tcVisID varchar(20) select @tcVisID = '087234' Is this Procedure Cahce? This machine is a 64-bit 8 processor server rebuilt recently, and the problems happened after the rebuild? Is there a se...more >>

Indexed Views
Posted by Loren Z at 5/29/2007 2:01:44 PM
Hello, We have implemented a couple of index views on one of our application databases. Our applications analysts have found some problems when using them. They have found that when they look for the some record the results that they get are not in sync with the base table. For example, if ...more >>



simple sp_executesql question
Posted by Mike Mertes at 5/29/2007 1:49:09 PM
Hi all, Can I pass table variables into sp_executesql ? I don't believe t-sql supports such a thing as reference/pointer vars so I can understand why this won't work: DECLARE @ResultSet TABLE(cols) --Table full of records to be excluded DECLARE @SqlStr nvarchar(100) --Ad hoc sql s...more >>

Re-raising errors in TRY/CATCH
Posted by Vern Rabe at 5/29/2007 12:16:02 PM
SQL 2005. Is there any way to re-raise a system error that occurs within a TRY block as the system error? Within the CATCH block I can identify the error number via the ERROR_NUMBER() function and I can include that number within the error message when I re-raise the error, but client code the...more >>

Faster Aggregate
Posted by Thom at 5/29/2007 11:58:01 AM
I have a table as defined below: wrkstnid int cityid int stateid int countryid int projectid int viewdate datetime The viewdate is when the wrkstnid viewed the project, each wrkstn is assigned a city,state and countryid (usually US) I need to be able to sum up the views by cit...more >>

IsNull() Returns Values in Query but not in Stored Procedure....
Posted by Fred at 5/29/2007 11:30:02 AM
Hi, I have a canundrum.... I have a query that pulls 10 derived columns, using the IsNull to return 0 if there's no result, in a straight query the values are returned (using Management Console). However, when I add "Create Procedure sp_xxxx" then execute, my values are not returned. An...more >>

Microsoft Jet Database Engine (DTS Error)
Posted by Tomas at 5/29/2007 11:26:01 AM
I am trying to open using the DTS excel connection (SQL 2000) an excel document with 20 tabs and n number of macros. That tab that I will be pushing data into, does not have a macro. But when I try to assign the excel document to the Excel Connection object, it return the following error: Mic...more >>

Analytics & OLAP in SQL errors
Posted by --CELKO-- at 5/29/2007 11:09:12 AM
Copies of my book "Analytics & OLAP in SQL" have pages 13-44 missing and pages 61-92 printed twice. Please contact Morgan-Kaufmann or your book dealer for replacements. I cannot do anything (Remember the movie THE PRODUCERS? "Don't kill us [the producers]!! Kill the actors!!') ...more >>

Simple Query Help
Posted by eggie5 at 5/29/2007 10:45:13 AM
Hi, I have a table with 3 columns MP4, 3G2 and 3GP, all of each have are bit value types, e.g., True or False values. MP4 | 3GP | 3G2 False | True | False I'm trying to create a select statement that will give me the first column in the table that has a true value...more >>

Using trigger between two different databases
Posted by Mahmoud Shaban at 5/29/2007 10:39:00 AM
"You can create a trigger only in the current database, although !!!!!!! a trigger can reference objects outside of the current database." I found thit inifo in SQL 2000 books online now i want to understand is it applicable to use trigger between two different databases .... may be on dif...more >>

showplan_text via oledb
Posted by pfa at 5/29/2007 10:32:06 AM
I'm trying to get the textual result set of a showplan from a query using OLEDB. I'm issuing an ICommandText command of "set showplan_text on" using IID_NULL then I'm executing my query. The result set I get back is the result of the query, not the show plan. I tried using MultipleResults thinki...more >>

trigger calling stored procedure to insert records across servers fails
Posted by Steve at 5/29/2007 10:10:20 AM
Briefly, an insert trigger on table1 should do the following: (1) appends the inserted records to a table2; (2) calls a stored procedure that attempts to insert the records from table2 into table3. However, in practice, record(s) inserted into table1 cause the database to hang - never errors, j...more >>

Help comparing field values
Posted by Sandy at 5/29/2007 10:05:01 AM
I am trying to see if field1 is in field2, field3, field4, or field5 by using a simple field1 IN(field2, field3, field4, field5) statement. However, this seems to work sporadically, and I am not sure how to accomplish this without using a loop. Does anyone have a suggestion to keep this data c...more >>

Problems with concatenation in cursor
Posted by Elmo Watson at 5/29/2007 9:50:43 AM
I've got a sProc that gets two fields (employeeID and email), based on certain criteria. Then, I create a cursor, in order to send emails to the returned email addresses, but I need to send them to specific web pages, based on their EmployeeID - - The problem apparently has something to do...more >>

Please help with linking a table to sql server
Posted by Al at 5/29/2007 9:50:00 AM
How can I link a table in database to my database. Both databases are in sql server 2000. I want that table to be read only to use for a lookup list.thanks Al...more >>

Sql to file bulk export best practice?
Posted by Rich at 5/29/2007 8:56:02 AM
Good day everyone, I have a question regarding the best way to export bulk data from Sql tables or stored procedures into flat files. This question stems from our infrastructure which I think is quite typical: 1. Database server (Sql 2005) has only SS, SSAS and SSIS installed and is behi...more >>

Question: datetime
Posted by Stone Chen at 5/29/2007 8:51:20 AM
Hello there, I wanna save the zodiac info to a table, but don't know how to store the days. Is there anyway to store datetime or smalldatetime to only months and date but no year or time values? Thanks...more >>

Stored Procedures Syntax
Posted by RuthE at 5/29/2007 8:16:00 AM
Hello, I am currently trying to learn SQL and I am having trouble with the syntax for including mutiple variables. I have 3 that are input optional and two that are calculated output. I have included my code to see if someone can see my error or offer a good place for me to find more detail...more >>

Database design and normalisation ??
Posted by calderara at 5/29/2007 8:01:00 AM
Dear all, I am preparing my last exam for MCSD and actually I have a huge lack of undertsanding on the best way to organise your dtabase based on buisness requirement as well as normalization part. Does anyone has a good link which explain this and guide lines from a practclae case ? ...more >>

Identifying Vendors with no activity
Posted by Sam at 5/29/2007 6:37:48 AM
I am trying to identify Vendors with no activity whatsoever My current scripts is trying to check for Vendors from the Vendor table (Vendor.vendid) and making sure that I can isolate all Vendors who have no presence in the APdoc table. (Apdoc.Vendid) select vendor.vendid,vendor.* from Vendor...more >>

Error "Lock Request"
Posted by Sundara Murthy at 5/29/2007 5:58:01 AM
Hi eperts, While insertion, we are getting the lock request time out error in the visual basic. how to rectify that error. Thanks in Advance. regards Sundara Murthy...more >>

MS SQL Connection Error from Client
Posted by icegray at 5/29/2007 5:30:06 AM
Hi, I am new about C# and MS SQL. I have done a new program which use MS SQL Database and I've install it to a new computer. But program doesn't run on new computer. I give SQL Server Connection Error (provider:SQL Network Interfaces, error: 26 - Error Locating Server/ Instance Specified ). ...more >>

Interview questions in sql
Posted by veeru at 5/29/2007 4:51:45 AM
1.What is the default key created when a primary key is created in a table ? 2.maximum number of joins in single select statement ? 3.How to get more than one row using out parameter in functions ? thanks ...more >>

Finding column references in sprocs
Posted by AlBruAn at 5/29/2007 4:24:01 AM
I had a couple of questions, but one was answered when I used the search function here...namely, trying to find all tables containing a certain columnname. So, my only question here is: how do I go about searching through at least 100 sprocs to find all references to either a particular col...more >>

SELECT with one-at-a-time view...
Posted by trint at 5/29/2007 4:03:25 AM
Hi, I have a problem I've been stuck in for three days - categories in a datagrid view. My first SELECT is simple: select * FROM categories where parent_id = -1 and active = 1 order by sort_order asc which produces this: id parent_id name 1239 -1 Battery Related 1264 -1 ...more >>

Need Help
Posted by venus at 5/29/2007 2:24:54 AM
Can anyone help me on this ? I have executed a stored procedure i have got a resultset , i have to add all the values of that result set to the target table. Regards, Venu S. ...more >>

Creating a pivot in SQL2005
Posted by Peter Newman at 5/29/2007 1:56:00 AM
If i have a table with a datetime field (recieveddate) and an Integer field (counts), can i create a pivot query to show the total counts i from our clients for each month over as many years as stored i our table. ( month & year to be taken from revieved date ) I can create the simple quer...more >>

sql 2005 backup
Posted by farshad at 5/29/2007 1:33:01 AM
A mainitenance plan is setup to create a daily backup od a database. It is set to overwrite. Backup type is set to full. Not sure why the size of the backup increases every day. Could this be to do with full/differential backup? Thanks...more >>

Sql Mythology
Posted by Steve Dassin at 5/29/2007 12:51:52 AM
Greetings, (This is also available and probably easier to read at: http://beyondsql.blogspot.com/2007/05/sql-mythology.html) To paraphrase 'V' from the movie 'V for Vendetta' if as an application developer or even as an sql programmer you feel that everything is fine and dandy in S2005 an...more >>

Performance
Posted by Yan at 5/29/2007 12:00:00 AM
Hi, SQL Server 2005 sp1 + coumlative HF The problem we face is a stored procedure that consists of one complicated SELECT that runs in different durations on different servers. On the Publisher srv the sp takes 30 sec to complete due to an inefficient execution plan while on 2 Subs...more >>

Check contraints and TSQL scalar function
Posted by Steve B. at 5/29/2007 12:00:00 AM
Hi, In a SQL 2005 DB, I've create a scalar function with TSQL that works life this : NumberOfSomething(param1 int, param2 int) the function works correctlyand return NULL or an int. I've also a table with some columns, including two columns that match param1 and param2 and I'd like...more >>

SQL Server - entering Empty Strings
Posted by Simon Woods at 5/29/2007 12:00:00 AM
Hi Pretty much a SQL programming newbie so ... I have this code and I'm getting an error on the Update statement. I'm not sure how to represent the '' in the string to be executed. Is there a function or a system-wide constant? The error reported is Server: Msg 105, Level 15, State ...more >>

INSERT INTO .... PROBLEMS !!!
Posted by Daniele Livio Dainesi at 5/29/2007 12:00:00 AM
Hi, I am tring to insert a lot of records (about 10.000) in a local table on PPC with SqlCE 2.0 and an application written with VB.NET 2003 I retrieve data from a SQL Server 2000 via Internet and parking them on datatables. Then I use a sqlCeCommand to execute a bulk operation (insert records...more >>

Calculations in SQL
Posted by obelix via SQLMonster.com at 5/29/2007 12:00:00 AM
What data ype manipulations do I need to apply to get 'select 10/100' giving me a result of 0.1 instead of 0 -- obelix "Whether you think you can or you think you cant you are right" .... Anon Message posted via SQLMonster.com http://www.sqlmonster.com/Uwe/Forums.aspx/sql-server-progra...more >>


DevelopmentNow Blog