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 > november 2004 > threads for tuesday november 9

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

Error in DTS wizard
Posted by Rob Meade at 11/9/2004 11:24:18 PM
Hi all, If anyone can shed any light on this I would be very grateful.. Event Type: Error Event Source: Application Error Event Category: (100) Event ID: 1000 Date: 09/11/2004 Time: 20:03:03 User: N/A Computer: TITUS Description: Faulting application mmc.exe, version 5.2.3790.0, fa...more >>


Delete Statement and related records in another table?
Posted by John Rugo at 11/9/2004 11:06:18 PM
Hi All, Is there a simple way of deleting records in one table and also those tables related in another table. Create Table Table1 (PID VarChar(50), RID VarChar(50)) Create Table Table2 (RID VarChar(50)) --------------------------- DELETE FROM Table1 WHERE PID = @pidVal...more >>

Convert access query that uses DSUM - to SQL server.
Posted by jonefer at 11/9/2004 10:26:01 PM
Please help me convert an access query. I have the following alias formula in an access query that I'd like to convert for SQL server for an Access Data Project: (To a Function?) AcumTime: Format(DSum("[SPTime]","qryPrograms"),"h\.nn\.ss") SPTime is time in hours minutes and seconds exam...more >>

Error message
Posted by Derek at 11/9/2004 10:25:01 PM
The error message is: Could not find database ID 102. Database may not be activated yet or may be in transition. A view with the following as a part of a union query runs fine. SELECT * FROM vwIAPSRTWRK I INNER JOIN tblState W ON I.NextActionID = W.ActionID INNER JOIN Action A ON W....more >>

New transaction cannot enlist in the specified transaction coordinator
Posted by John A Grandy at 11/9/2004 9:23:15 PM
sql-server 2000 developer edition, sp3 windows xp pro sp1 anyone have insight into the following error message ? my sp is attempting to query a linked server. the linked-server has been successfully added in sem via ip address (can view tables, etc.) the linked-server is designated in ...more >>

Cartesian product query
Posted by Mike at 11/9/2004 9:09:42 PM
Hi, In the following query, I cannot get records if the "IN" clause is not = satisfied. I would like to have the same clause in a way similar to an = outer join, so that the records from tables ce1, ce2, ce3, ce4 are = always returned. Any idea on how to do that? Thanks. Mike SELE...more >>

Simple or Full recovery
Posted by Edward W. at 11/9/2004 9:02:35 PM
Does sql server operate differnetly with respect to performance if you use simple recovery over full? Or is the only difference between them what you can restore to if you have to restore? In simple what then is in the log for it to remain so small? Does the log grow in simple mode? ...more >>

SQL Newbie - Join Question
Posted by Robert NO[at]SPAM thomasgeorge.com at 11/9/2004 8:41:35 PM
I have a table with codes in it and I want to return the lookup values all in one query....an example is probably easiest: Code-Table: code desc ---- ---- 1 desc1 2 desc2 3 desc3 Data-Table: UserID Code1 Code2 ------ ----- ----- ABC 1 2 DEF 2 ...more >>



Serializable transaction isolation level
Posted by Tumurbaatar S. at 11/9/2004 7:41:57 PM
I'm writing a SP which does several update/insert within some related tables. And I need to serialize calls to this SP so if multiple users try to execute this SP at same time, everyone have to wait for a previous call end. To do it, I start the SP body with SET TRANS ISOLATION LEVEL SERIALIZABL...more >>

xp_cmdshell return code
Posted by SQLUser at 11/9/2004 7:40:32 PM
I am receiving different return codes from xp_cmdshell depending on the operating system. I execute the following code: declare @retcd int exec @retcd=master..xp_cmdshell 'del file.txt', no_output print @retcd (Note: The file file.txt does not exist) When SQL Server is running on... ...more >>

GROUP BY complication
Posted by Stephen Howe at 11/9/2004 7:00:39 PM
Hi I can do SELECT field1,field2 FROM Table1 GROUP BY field1,field2 no problem. field1 and field2 are integer fields >= 0. But in this case for each row value in field1, I only want (rowvalue,0) if zero exists on field2 for that rowvalue in field1 otherwise all non-zero entries for t...more >>

Paths of data file and log file
Posted by krygim at 11/9/2004 5:57:01 PM
Is there any stored procedure which returns the paths of the physical data file and log file of a database? TIA KM ...more >>

Timestamp field usage
Posted by Smartikat at 11/9/2004 5:47:30 PM
Hi, I am trying to find out how to use the timestamp field. I understand that it is just a binary field containing an unique value and the field is updated every time the row is updated or inserted. Here is what I want to get done... 1) All my tables contain a timestamp field 2) I w...more >>

This is a tough one.....
Posted by Binary Poet at 11/9/2004 5:42:35 PM
I just was given this task almost a month ago and am now asking for desperate help. We have a table as shown below and need to get the databack as shown below. Currently we have a programmer who is doing it by hand, but it is slow. Managment "feels" that there is a way to do this via SQL whic...more >>

I'm sure its quite simple :)
Posted by Rob Meade at 11/9/2004 5:40:29 PM
Hi all, I have a database on my local machine set to backup each night - I used the gui / wizard in Enterprise Manager to configure that and to set the scheduling options. I have noticed that this thing just grows, and grows and grows....I very much like the way that when I opt to 'restore...more >>

XML EXPLICIT
Posted by Naveen at 11/9/2004 4:53:04 PM
Hi Is there any way that I can get a xml string back from SQL. I used FOR XML EXPLICIT but its not returning the fields that has no values (Null) How should I get them also Ex: This is what it should be <Employee> <Name>XYZ</Name><Age>28</Age></email> </Employ...more >>

OPENXML
Posted by Mark at 11/9/2004 4:21:12 PM
Is there a way to use read data from an XML file, and insert it into a table? The code example below is from BOL using OPENXML, but doesn't call to a file directly. Thanks in advance. Mark DECLARE @hDoc int EXEC sp_xml_preparedocument @hDoc OUTPUT, N'<ROOT> <Customers C...more >>

Raising error automatically
Posted by Tumurbaatar S. at 11/9/2004 4:16:41 PM
If a stored procedure or a user function contains multiple insert/update statements, there're too many lines which contain almost identical codes like: IF @@ERROR <> 0 ... Is there a way to say server automatically RAISERROR if any error occurs within SP or UDF? ...more >>

SQL server monitoring
Posted by Patrick at 11/9/2004 3:07:29 PM
Hi Freinds, Wha arethe best varibles for monitoringSQL server from win performance monitor. Just a regular monitor, to find out about server is healty and running fine. Thanks in advance, Pat ...more >>

Search SP Dynamic WHERE
Posted by Dan at 11/9/2004 2:29:07 PM
I am writing a stored proc for a search that has parameters for each filtering criteria of the result set. I want to be able to search on any combination of the parameters. Each parameter is initially set to null so i only have to set the ones that I want to search on. I have seen the foll...more >>

Easy SELECT question !
Posted by Pascal at 11/9/2004 2:17:20 PM
Hello If I do : SELECT name FROM my_table WHERE id > 100 And it returns me --------- egan egan egan egan perry perry blagg blagg blagg egan egan egan ------ What is the SQL command that only makes the names appear once ? -------- egan perry blagg ----- Than...more >>

Need help with query
Posted by Eric Tishkoff at 11/9/2004 1:23:03 PM
My company sells magazines. Some of the mags we sell are ones that we own (publish). Others are owned by an external vendor. Occassionally a particular magazine changes hands such as when our company acquires a magazine that was formerly owned by an external vendor. The reverse is also possibl...more >>

Backup
Posted by Ed at 11/9/2004 12:25:05 PM
Hi, I do the Backup via EM. When I do a full backup of the database, does it also truncate the transaction log, too or I have to do the transactional backup in order to truncate the transaction log, but not shrink the log file. Thanks Ed ...more >>

Creating an Index for Temporary table returned by Functions
Posted by dance2die at 11/9/2004 12:23:03 PM
I have a function returning a table. ========== CREATE FUNCTION fnExample() RETURNS @exTable TABLE ( f1 char(8) , f2 datetime , f3 integer ) AS BEGIN -- MAIN -- Fill @exTable... RETURN END ========== Rows returned from the @exTable is not UNIQUE. therefore I cannot use UNIQU...more >>

track down table usage
Posted by Rea Peleg at 11/9/2004 12:17:49 PM
Hi all I need to be sure a table had not been updated since it was created. Is there a way to extract a log of updates, deletions and inserts commited against a table from sql server?? TIA Rea ...more >>

Performance Problem.
Posted by Ramnadh\\ at 11/9/2004 12:09:06 PM
Hi, I am having two Tables Master and Child with the schemas Master ( Id INT, EditedById INT, SentState VARCHAR(50) ) Id is the Primary Key Child ( MessageId INT, Recipie...more >>

parse comma delimited string into normalized table
Posted by Terri at 11/9/2004 11:52:46 AM
I need to 'fix" a poorly designed database. I have a field with comma delimited values in it. I have lost the political battle to re-design the tables correctly. I am resigned to a workaround. drop table [dbo].[tblTest1] GO CREATE TABLE [dbo].[tblTest1] ( [ContactID] [int] NULL , [TestD...more >>

Looking for a set based solution...
Posted by William Morris at 11/9/2004 11:35:48 AM
Schema ContactStatus StatusID int ContactID int CompanyID int StatusChange datetime Sample data: StatusID ContactID CompanyID StatusChange 200 100 2 1/1/2004 201 100 2 2/1/2004 ...more >>

First VBScript in SQL Server
Posted by John at 11/9/2004 11:31:30 AM
I am trying to used the vbscript functionality when creating a job. Since this is very new to me I am going step by step. The following is my code. dim objCDONTS Set objCDONTS = Server.CreateObject("CDONTS.NewMail") Set objCDONTS = Nothing Below is the error that I am getting. Error Source...more >>

Need to replace multi-value function call with inline select
Posted by KB at 11/9/2004 11:04:07 AM
Hi guys I will appreciate any help with the following: I have two tables: Users and Books, and the BookUsers table which allows the many-to-many relationship between books and users: CREATE TABLE xusers ( Id int IDENTITY (1, 1) NOT NULL , Name varchar(50) NOT NULL , CONSTRAINT [PK_xuse...more >>

xp_sendmail
Posted by Robert Taylor at 11/9/2004 11:00:55 AM
I have a script that generates an error on the following DDL when ran at the end of a long import script. The error is "xp_sendmail: Procedure expects parameter @user, which was not supplied". If I add @set_user as a parameter it doesn't help. If I add @user it tells me it is an invalid param...more >>

Problem with SP?
Posted by Damon at 11/9/2004 10:48:40 AM
Hi, I have a stored procedure which is being inconsistant but not sure why. Here is the SP. CREATE PROCEDURE dbo.[proc_test_ad_hoc] @field as varchar(25), @criteria as varchar(25) AS exec ('select ' + @field + ' from tbl_referral_name where ' + @field + ' = ' + @criteria) GO ...more >>

passing field name into stored procedure?
Posted by Damon at 11/9/2004 10:24:46 AM
Hi, I want to be able to pass a variable from VB6 into a stored procedure but the variable is a field name. i.e SELECT @FIELD FROM TBL_REFERRAL WHERE @FIELD = @CRITERIA. How can I do this? Appreciate the help Thanks Damon ...more >>

Update image column
Posted by Peter Proost at 11/9/2004 10:19:41 AM
Hi group, I hope this is the correct group for this post. I've got the following problem: I've got two tables table1 and table2 the 2 tables contain the same information, a code field and some information fields and an imagecolumn table1: Code (PK) ..... Imagecolu...more >>

Error Descriptions
Posted by Larry Menzin at 11/9/2004 9:58:08 AM
I am trying to find a way to extract run-time error descriptions from SQL Server. After running a statement I check the @@ERROR variable and if it's not zero, I select the Error Description from sysmessages and get something like the following: Invalid column name ''%.*ls''. I am trying ...more >>

Text Files
Posted by John at 11/9/2004 9:54:50 AM
I want to open up a text file and reorganize the data in it. Can someone give me direction as to how I might go about doing this in tsql? I was wanting to do this with the log file created for scheduled tasks. ...more >>

Trouble with Max() and WHERE
Posted by DC Gringo at 11/9/2004 9:37:57 AM
I'm having trouble getting query results that I want. Suppose the table looks like this: mewr_id, rpt_published, country_id, lang_id --------------------------------- id1, 1/2/2004, ab, en id2, 1/5/2004, ab, en id3, 1/8/2004, bc, en id4, 1/9/2004, bc, en id5, <NULL>, bc, en id6, 1/12/20...more >>

Proper Index Choice
Posted by Stefan Berglund at 11/9/2004 9:31:11 AM
There are two questions here. First is there a VIEW or other suitable alternative to referencing sysindexes directly as follows? Secondly should the nonclustered indexes include the ShowID column or can I exclude that since it's already an index? Typically there may be anywhere from 10,000...more >>

Counting multiple times on the same field
Posted by Nathan Howard at 11/9/2004 9:04:07 AM
Hi Anyone, I have what seems to be a simple SELECT statement to write but I cannot figure out how to get it done. I have an Orders table which has a one-to-many relationship with an OrderItems table. In the OrderItems table there is a status field(tinyint) which indicates the status of th...more >>

CDOSYS Mail Problem: Win2003 Server?
Posted by TomT at 11/9/2004 8:59:10 AM
I have a stored procedure that sends mail, and it works fine on two Win2k servers running SQL Server 2000. However, we're upgrading one server to Windows 2003 Server, and the procedure fails on that system. I've tested it on 2 Win2k servers, and 2 Win2003 servers. I have had no luck with ei...more >>

Strange Goings On - incorret row count being reported
Posted by Keith at 11/9/2004 8:59:03 AM
On Friday, I was performing a long but uncomplicated query (only 8 left joins, 7 small reference table, 1 large reference table) and life was wonderful. Now the same query is taking 5 or 6 minutes. I did an execution plan in query analyzer and one table now has a row count of 14 million. (T...more >>

Decrypt
Posted by L Gonzales at 11/9/2004 8:32:46 AM
Is there a way to decrypt an object in the database without resorting to VSS? I inherited a database which has several hundred encrypted objects and I need to search for an occurences of particular columns. What is the painless way to go around this? Thank you....more >>

Search function, one textbox
Posted by Angela at 11/9/2004 8:30:31 AM
Hi I have a text box on a homepage that I want to use to search three fields in the database so far I have: Select * from Contacts where firstname like '%' + @SearchPhrase + '%' or surname like '%' + @SearchPhrase + '%' or company like '%' + @SearchPhrase + '%' Which works find...more >>

how to conver nvarchar with value like(12.23) to time (12:23)
Posted by itimilsina NO[at]SPAM savannaenergy.com at 11/9/2004 8:28:38 AM
Hi There, i need to insert in to table with the value in differnt table. suppose table A has vaule (12.23 or 1.00) as a nvarchar which need to insert to table B as datetime with value (12:23 or 1:00). if you have any idea please let me know. Thanks....more >>

Encrypted Stored Proc
Posted by L Gonzales at 11/9/2004 7:51:46 AM
Is there an easy way to identify how many stored procs are encrypted in a database? TIA....more >>

How to drop multiple users from a database
Posted by Brady Snow at 11/9/2004 7:24:06 AM
What is the best way to drop multiple users from a database? Can you use the SP Dropuser to drop multiple users? If so what is the syntax? Thank you, Brady Snow McKinney, Texas...more >>

How to drop multiple users from a database with a script or SP?
Posted by Brady Snow at 11/9/2004 7:23:02 AM
I am needing some help on generation a script that will delete multiple users from a database. Or what is the easiest way to drop 30 or so users from a database? Thank you, Brady snow McKinney, Texas...more >>

Query timeout reveals multiple StmtStarting in Profiler
Posted by EBohn at 11/9/2004 6:38:03 AM
An application is executing a call through ODBC. ODBC has decided that is needs to get the metadata for a table so it issues a call such as this: Set FMTONLY On Select col1, col2 from table1 Set FMTONLY Off This call always times out. When looking at the Profiler output, we see this: Ba...more >>

Conditional Triggers
Posted by Rupert West at 11/9/2004 4:59:02 AM
I am new to Triggers and i am looking for some advice on how to carry out the following actions. I have a SQL table (Table1) that contains details of boxes weighed in a production system. The uniqueid on each box is their Barcode iD. When a box is weighed, it is appended into a separate table...more >>

bcp error handling
Posted by Vivek T S at 11/9/2004 4:58:01 AM
when i try to insert a row with null values into a table whose columns have not null bcp fails. but it aborts the whole batch. is there any way only the faulty row will not be inserted but all the other rows in the batch may be inserted. -- Vivek T S Member Technical Staff (Inucom)...more >>

Simple parent/child - alternate parents
Posted by Duke Carey at 11/9/2004 4:57:03 AM
This concerns FDIC data about deposits at bank and thrift branches (the children) and the 'holding companies' that own them (the parents). I can obtain the data in either of two ways (alternate parents): 1) with the holding company that currently owns the branch, or 2) where the...more >>

Query for CrossTabbed report
Posted by Peter Newman at 11/9/2004 4:43:02 AM
im trying to generate a query for a report showing counts for how meny clients are at which status on all of our services. for example if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Table2]') and OBJECTPROPERTY(id, N'IsUserTable') = 1) drop table [dbo].[Table2] GO ...more >>

upload images or binary files
Posted by Sri at 11/9/2004 3:18:03 AM
How do you upload images or binary files into SQL Server tables? Thanks in advance....more >>

exec SP_delete with multiple fields as arguments
Posted by cap_sch NO[at]SPAM yahoo.co.uk at 11/9/2004 3:12:40 AM
ok need to do this I have a sp that deletes multiple entries using an author as an argument. exec sp_delete (select author from books) I have had a look at the array trickery but do not think this is suitable any idea?...more >>

searching for sql servers on network
Posted by StephenDunbar at 11/9/2004 1:54:10 AM
I am creating an installation program to install a SQL Database on a users computer. I need to get a list of SQL servers available on the domain to ask the user on which srever they want the database created or to install a copy of MSDE localy if none are available. I am using Visual Studio 2...more >>


DevelopmentNow Blog