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 2004 > threads for friday may 14

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

Running Totals
Posted by Bret at 5/14/2004 10:41:04 PM
Please I've migrated my Access 2002 VBA program over to SQL 2000. In ACCESS I had a query that creating running totals in a table. It worked but took hours to run with a table of over 35000 rows and now I want to convert that to a stored procedure. I am in need of how this should be designed or i...more >>


Latin1_General_BIN vs. SQL_Latin1_General_CP1_CI_AS
Posted by Dean at 5/14/2004 8:46:04 PM
As I understand it, binary is the fastest sort order. Could anyone ballpark the kind of improvement in performance of binary over DOCI? Would it be relatively minor like 2-5% or something more significant Thanks Dea ...more >>

How Can I know if a job is running
Posted by Heiner at 5/14/2004 5:57:17 PM
I need to start a DTS when a job finish, How can I know it has finished....more >>

constraints (newbie)
Posted by ben h at 5/14/2004 5:45:54 PM
Two tables reference each other: tblStaff username varchar (PK) orgID int (constraint: FK - tblOrgunit.orgID) tblOrgUnit orgID int (PK) owner (constraint: FK - tblStaff.uname) How do i set it up so that every user (in tblStaff) is associated with an Organisation Unit in tb...more >>

Accessing adjacent rows
Posted by Ilya Margolin at 5/14/2004 5:13:54 PM
Hi All, I have a need to calculate a value based on two adjacent rows on a sorted rowset. I've tested two solutions. The one that employes cursor works about ten times faster. My probles here is I do not like cursors. Is there a better way to access adjacent rows without a cursor? Thanks, ...more >>

How to detect an error in ADO raised in sproc
Posted by CW at 5/14/2004 4:18:26 PM
I am running into a brick wall on this issue and would appreciate some help: A stored proc returns a recordset via a select statement. After the select statement, some more processing is performed - which may or may not result in an error. Basically I have a proc as follows create proc MyPr...more >>

setting foreign key to null when deleting primary key
Posted by Christiaan at 5/14/2004 4:13:32 PM
hi all, when I delete a primary key record, how can I make sure foreign key values of other records to this primary record are set to null, preferably using constraints, not triggers? kind regards, Christiaan ...more >>

Constraint doesn't work as expected
Posted by Brad Wood at 5/14/2004 4:03:39 PM
Given the table: CREATE TABLE [Address] ( [AddressID] [int] IDENTITY (1, 1) NOT NULL , [Address1] [nvarchar] (40) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL , [Address2] [nvarchar] (40) COLLATE SQL_Latin1_General_CP1_CI_AS NULL , [City] [nvarchar] (25) COLLATE SQL_Latin1_General_CP1_CI...more >>



Why does 1:3 relationsihp require another table?
Posted by Rick Scott at 5/14/2004 3:46:04 PM
Preface: I am relatively new to DB design I have built an intranet for my company from the ground up using SQL Server 2000. One of the tables is name simply "users". The users table has the things you would expect, including a PK of userid, a username and a password, as well as a date the password...more >>

Want to Concatenate Year and Month to get a Date
Posted by Learner at 5/14/2004 3:36:52 PM
My table contains only the PLAN Year and the PLAN MONTH. FYI, both my YEAR and MONTH fields are smallint. What I want is to create a view based on this table which will display a Date as well (despite the fact that date is not stored in the underlying table). The date can be the 1st of the...more >>

System stored procedure on MSDE
Posted by Gerald Hopkins at 5/14/2004 3:31:03 PM
Are system stored procedures available to be called from a DTS package on an MSDE machine. I know I need the DTS dll's to be registered to run a DTS package on an MSDE machine, but I need to know if I can create a linked server to a text file using sp_addlinkedserver in an Execute SQL Task. T...more >>

Need help with select
Posted by ajmister at 5/14/2004 3:29:24 PM
Hi tmp_table company_name char(33) prd_yr char(4) code char(9) value char(25) and table has values XYZ 2004 n_code 10000 ABC 2004 i_code 24545XY NBC 2005 b_code 1234. A NOP 2004 r_code DOG select company_name, prd_yr SUM(CASE alt_source WHEN "n_...more >>

cumulative order / sum / count (help!)
Posted by c.s NO[at]SPAM scratchmonkey.nospam.org.uk at 5/14/2004 3:18:51 PM
Hi, Can someone help with a solution for this problem? Basically, I've generated the following data APART from the order column from an excel spreadsheet, loading into SQL Server using DTS, crosstab join and all sorts of pants. Unfortunately I have no idea how to generate the order column ...more >>

Local Database Persistence
Posted by samantha at 5/14/2004 3:10:49 PM
is it possible to synchronize a local MSDE database that resides on a workstation with the central database residing on a separate SQL Server? also, does .net provide any way for local database persistence? some solution that is like the dataset object but, with the ability to persist the info...more >>

MSDE and Windows 98 connection problems
Posted by languy at 5/14/2004 2:58:06 PM
Hi there, I have an application, which runs at several platforms with MSDE. When I run my application on Windows 98 and MSDE then MSDE suddently stops accepting any connections. Neither my application nor a VBS script is able to connect to the database. When I look in the enterprise manager ...more >>

xp_cmdShell
Posted by simon at 5/14/2004 2:43:42 PM
I have user with read permissions on my tables and execute permission on = my SP. In SP(owner is DBO) I update table(owner is DBO), and on update the = trigger is fired witch write some data into the text file in my disk. I get an error message: EXECUTE permission denied on object 'xp_cmdsh...more >>

Msgbox in a job step
Posted by Mauro D. at 5/14/2004 2:23:48 PM
Hi guys! How can I open a msgbox with an exclamation like "Job Finished!!" ? I have configured a job step with ActiveX code (VBScript) an a code like: Sub MainBox() MsgBox "Job Finished!!" end sub But job execution stay in the step forever without display any message!! Any sugges...more >>

Use statement or database specification problem
Posted by Ken Pinard at 5/14/2004 2:13:04 PM
I want to send a script out to my users, including stored procedures. I am using the following code to reference their database: Use UserDBName I access my database with: dbstatus.dbo.tablename The problem I have is that they have different database names. Is there a way to dynamically cha...more >>

QA Server Trace vs Profiler vs Set statistics
Posted by Andres Taylor at 5/14/2004 1:56:28 PM
Hello, We have encountered a strange thing using the Show Server Trace functionality in Query Analyzer. To see it, execute the following query in Northwind with Show Server Trace on: SELECT FirstName, LastName, TotCost FROM dbo.Employees e INNER JOIN ( SELECT e.EmployeeID, SUM(UnitP...more >>

Need a strong SQL Server Developer
Posted by Sean Smith at 5/14/2004 1:02:23 PM
Looking for a STRONG sql server (T-SQL) developer with financial/accounting industry experience/exposure. Location NJ, assignment immediate, long term contract. MUST be able to write and debug complex and lengthy stored procedures. Has to be good with transaction management and error handling....more >>

Converting Columns into Rows
Posted by bguymon at 5/14/2004 12:56:07 PM
I am querying a Call Center Staffing Database, and am running into trouble because of the table design. The Table Schema looks similar to this ID (PK SPQueueID (FK inDateTime CallVolume CallVolume CallVolume CallVolume ..... CallVolume9 The SPQueueID relates to the call typ The inDateT...more >>

Issue on Money to NVarChar implicit conversion
Posted by Leonard Poon at 5/14/2004 11:33:25 AM
I want to know more detail about the implicit conversion from money type to nvarchar() type values for SQL2000. I'm having a problem that the value after conversion is only precised to 1 decimal place. What is the best way to handle this? e.g. I had fetched a money type value '32132.43' from q...more >>

indexes on tables
Posted by PVR at 5/14/2004 11:24:34 AM
Hi Sql Gurus I am extremely Sorry for making you confused This is question. A table which contains few records less than 8 KB Size lets suppose customer type table there are 3 records in the table 1. Good Customer 2. Bad Customer 3. Normal Customer. Customer Type Table contains ...more >>

How to query job history
Posted by JC at 5/14/2004 11:09:46 AM
I start a job on sql server via sp_start_job, i then need to wait until that job completes and run some other jobs, how can i get the job history from this job via a stored proc in c#. ...more >>

performance problem
Posted by mircu at 5/14/2004 11:07:34 AM
Hello, I've some problems with performance on SQL Server 2000 and maybe someone could help me. I need to insert 200,000 and more rows with binary data (serialized objects, 11kb big). After inserting the sql server virtual memory grows to more that 500 MB and the it doesn't free. Following i...more >>

Trigger for tracking moddate & moduser
Posted by Jared Hoffman at 5/14/2004 10:19:54 AM
I've got a system that changes database tables but I can't put code in to change the moddate and moduser so I want to make a trigger to update the moddate and moduser records and set them to getdate() and suser_sname(). However, I can't figure out how to make the trigger update just the row that ...more >>

How to recover the backup database
Posted by Ray at 5/14/2004 10:06:21 AM
Dear all, I would like to ask how to recover a backup database in the SQL server. Thanks a lot, Ray ...more >>

Linked Server question
Posted by Mark Andrews at 5/14/2004 10:02:37 AM
Having trouble getting a linked server which points at another SQL Server 2000 server to work. I can add the server in enterprise manager, but cannot even see any tables when I try and add it as a linked server? When setting up the linked server I am using: - ip address for server name - s...more >>

Index on Type Tables
Posted by PVR at 5/14/2004 9:37:33 AM
Hi Sql Gurus. we have lots of type tables with 5 or 6 records which is less than 8 KB (DATA PAGE SIZE) we default creating clustered Index on the type table. I am feeling some wat in appropriate of clustered index creation. since when a particular record is required it retreives the c...more >>

Trigger activity without altering rowcount response?
Posted by Bob Butler at 5/14/2004 9:33:09 AM
Very new to TSQL and searches at http://groups.google.com didn't find anything relevent so forgive me if this is a stupid question... I have an insert trigger on a table that is running fine but under some conditions the trigger runs a stored procedure to do some other actions (it's actually t...more >>

WHERE and CASE
Posted by shank at 5/14/2004 9:29:11 AM
I'm having problems using the CASE statement in my WHERE clause. Not even sure this is possible. What I'm trying to achieve is if the length of @Manuf is less than 3 characters, then WHERE (ItemStock.SoftHard = 'Soft'), otherwise, WHERE (ItemStock.SoftHard = 'Soft') AND (ItemStock.Manuf = @Manuf...more >>

Help with Dynamic T-SQL
Posted by Craig G at 5/14/2004 9:26:30 AM
Hi, i have been given this stored procedure to review as its not bring back the correct values, im assuming its to do with all the parameter guff at the bottom, all of the input parameters are optional i was going to convert it using sp_executesql but im not sure how you include CASE statme...more >>

URGENT - Create sequence
Posted by Sassgirl at 5/14/2004 8:58:48 AM
I am trying to create a sequence count on records, but the specifics are throwing the count off - can anyone help? I have these fields: ID office specialty primary 1 3 EM 1 1 4 FP 1 1 3 ...more >>

Comparing dates
Posted by D Mack at 5/14/2004 8:56:03 AM
I have a trigger that sends emails based on updating a table. The problem is, it sends too many emails. It will send an email whenever the record is updated and I don't like that. I need to modify the trigger so it compares the date a record was entered to today's date. If today's date is equal ...more >>

SQL Server Agent / Jobs Question
Posted by Amos Soma at 5/14/2004 8:06:23 AM
I have a job created that executes an application I've written when it fires. When this application attempts to print, it fails because it seems the application is running under the context of the NT System User account. This account has no access to any network resources, and, it seems, cannot ...more >>

DMO Scripting ONE object WITH dependencies ?
Posted by Bob N at 5/14/2004 7:39:18 AM
Hello there Anyone know how to include all the dependencies when generating the script for 1 object ? Here's what my script looks like: -------------------------------------------------------- Set oServer = CreateObject("SQLDmo.SqlServer") set oProc = CreateObject("SQLDMO.StoredProcedur...more >>

Bound Parameters Stored Procedure Issue
Posted by Brandon at 5/14/2004 7:32:11 AM
HELPPPP... We recently upgraded from 6.5 to 2000 SP3. We have a ton of legacy code that uses bound parameters. The are all failing now. The Transact SQL looks like this: "?=SP_GetNext 'Val1','Val2','Val3'" A return parameter is bound to the statement and the execution of the statement...more >>

Trigger Problem
Posted by brian at 5/14/2004 7:30:58 AM
I have a trigger created that uses the Inserted/Deleted tables. If I statically store an update statement in a stored procedure to update a date the trigger works fine and sends an email to a user with the updated information. If I update the field through our 3rd party management so...more >>

Stored Procedure - Dynamic Select
Posted by Eric Fleet at 5/14/2004 6:46:04 AM
I'm working in an environment where I am using stored procedures as the application's interfact to the database. The users have no direct rights to the underlying tables. Now I am tring to create a dynamic query. Ofcourse, this doesn't work because of the right issue. The query should return 1 or mo...more >>

Using a comma delimited array in a where clause
Posted by hilary321 NO[at]SPAM yahoo.com at 5/14/2004 6:39:11 AM
Your help would be appreciated... I'm passing in a comma delimited array of integers (9, 10, 11) that is created with a multi-select box into a varchar(100) variable in my stored procedure. I need to do a select query and use the numbers in a where clause to get the data back with those speci...more >>

Clustered vs Non-Clustered
Posted by rsocol NO[at]SPAM fx.ro at 5/14/2004 5:49:07 AM
Let's suppose we have the following tables: CREATE TABLE Customers ( CustomerID int IDENTITY PRIMARY KEY, CustomerName varchar(255) NOT NULL UNIQUE ) CREATE TABLE Orders ( OrderID int IDENTITY PRIMARY KEY, OrderDate smalldatetime NOT NULL, OrderNumber varchar(10) NOT NULL UNIQUE, ...more >>

asp page displays sql records twiceTWICE !!
Posted by gabrielle at 5/14/2004 5:11:01 AM
Hey, I've just moved a website and 2 SQL d/bs from a MS Windows Server 2000 to a MS Windows Server 2003. They are SQL 2000 d/bs so we've put SP3 the new server. On the old server a page with the following code would display each record from one of the SQL tables ONCE. <% Set articles = ...more >>

Error at stored procedure call
Posted by Youssef at 5/14/2004 5:09:12 AM
Hi all, i have an SQL server 2000 sp3a installed on a windows server 2003, i'm developping a VB 6 application that contacts the server, the connection is encrypted using a certificate authority on the windows server 2003, and by enabling "force encryption" on the sql server The vb appl...more >>

Bset way for updating/modifying DB
Posted by Patrick Delifer at 5/14/2004 3:17:27 AM
Does anyone know the best practice for this: Updating a Live database at a clients side, with new stored proce's, columns, etc. Should I create a script of the new DB and generate it at the Client's, then export the data from the live DB to that one? THx *** Sent via Developersdex http...more >>

transfer a xls to sql database
Posted by enercido ocanse at 5/14/2004 3:16:02 AM
how to copy a file at excel for a database i need to use the file in sql...more >>

Advice on locking/performance issue
Posted by Garrek at 5/14/2004 2:46:27 AM
I have a DotNet project which imports data from Xml into a Sql Server 2000 database. Not only does it run extremely slow but we're experiencing locking that's forced us to only run the imports at night. The hardware is a Dual Xeon 933Mhz server w/1gig RAM against a Raid 5 array. To perfor...more >>

Returning different number of rows
Posted by zozz NO[at]SPAM dalnet.se at 5/14/2004 1:01:21 AM
Hi, How come that "select count(*) from <table>" returns the correct number of rows for a table and "select object_name(id), sum(rowcnt), sum(reserved * 8192) / 1024 from sysindexes where indid in (1,0) and objectproperty(id, 'IsMSShipped') = 0 group by object_name(id)" doesn't?...more >>

Somewhat newbie question regarding like/in and comma seperated id's
Posted by tutankhamon NO[at]SPAM hotmail.com at 5/14/2004 12:27:35 AM
So, after reading through this NG, I think that anyone can repro my problem fairly quick. I want to take data out of another column (varchar or basically text) and use a like operator or the in operator on an int column. IE, the data in my source column will be: 1,2,3 And I want to select a...more >>


DevelopmentNow Blog