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 2006 > threads for tuesday may 16

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

Simple XQuery Syntax Question
Posted by PJ at 5/16/2006 11:58:23 PM
/* I am trying to extract a subset of nodes from multiple xml instances into one instance, but I do now know the proper syntax. Can someone please help me out? Finally starting to learn XQuery! See below for DDL and desired result. Thanks so much!! ~PJ */ create table XmlDataTable ( ...more >>


Can't connect to SQL Server 2005 remotly
Posted by Shimon Sim at 5/16/2006 10:05:26 PM
I am running SQL Server 2005 on Virtual PC. I can connect to in VPC using SMS if I set server =win03 SQL Server Authentication Shimon2 and password If I go to my host machine I can't connect the same way - time out. I can see server. I have Team Server running on it and VS has no problem ...more >>

Loop Update
Posted by scott at 5/16/2006 9:23:53 PM
I'm trying to find a way to loop through the testnewsRecipients table and insert the value of the USERID field equal to the USERID field in the tempUsers table. As you can see in my DDL, currently the USERID field in testnewsRecipients table is empty and the only value the 2 tables have in c...more >>

SP_RUNWEBTASK
Posted by A. Robinson at 5/16/2006 8:58:02 PM
I am running into some odd behavior in a webtask and was looking for any help at all. I have a SQL job that is a web task. For the last few days it has been running fine. Now for some reason, it is failing. I'm getting the following error: Executed as user: dbo. SQL Web Assistant: Could ...more >>

Multiple foreign keys
Posted by HE at 5/16/2006 6:39:57 PM
Hi, I wonder if it is possible to have multiple foreign keys between to tables and delete data automatically. We have on table with a number of locations and another table with a number of routes between them. The foreign keys go from location to the beginning and the end of the route. How ...more >>

Variables inside a query
Posted by Hitesh at 5/16/2006 5:39:30 PM
Hi, I am novice SQL server 2000 guy and I am trying to use variables inside query.... but could not figure out how I could do that ... after so many errors I am turning to this group.... declare @db_name1 varchar(50) declare @db_name2 varchar(50) declare @id varchar(50) set @db_name1 = ...more >>

Inner Join Performance?
Posted by Tim B at 5/16/2006 5:07:14 PM
Hi All, Just a quickie... Is there any perfomance difference between joining tables in the... FROM clause eg. ...FROM a INNER JOIN b ON a.id = b.id to that of the WHERE clause eg. ...FROM a, b WHERE a.id = b.id TIA Tim ...more >>

Create a Text File
Posted by varkey.mathew NO[at]SPAM wipro.com at 5/16/2006 4:50:37 PM
Dear all, I wanted to create a text file to be passed as input to a Mainframe system. I have created an SP with the query to create the data exactly in the requisite format. I need to be creating the text file from within SQL Server only. I have used osql utility to achieve this and it works....more >>



update triggers
Posted by Robert Bravery at 5/16/2006 4:10:26 PM
HI all, If I have 3-4 update triggers, and each of them contain an update statement to the selfsame table that is calling the update trigger, would I end up with a recursive call Thanks Robert ...more >>

T-SQL
Posted by MS User at 5/16/2006 3:57:02 PM
SQL SERVER 2000 I got a table with columns ID, CityCode, CitySub Here is the sample data ID CityCode CitySub 1 AA CitySub1 2 BB CitySub2 3 CC CitySub3 4 DD We have a process called ReverseRoute, after that data needs to be in th...more >>

writing sql server 2000 properties out to a file
Posted by Wendy Elizabeth at 5/16/2006 3:39:01 PM
I basically would like to take a sql server 2000 table and have all the properties written out for me into a file. If I were able to do that then, I would be able to put this into a “CREATE TABLE” vb.net 1.1 program and not have to write out all that code myself. This way I could jus...more >>

Multiple Cascade Paths - Fails on SQL Server 2000
Posted by Jim Underwood at 5/16/2006 3:32:52 PM
This is an old issue, which I chose to ignore, since it was for a temporary app with a handful of users (famous last words, I know). The "multiple foreign keys" post today got me thinking about it, and I figured it is worth looking for a solution. I will post DDL at the end, but the theory i...more >>

Build a Web Interface to transfer DATA between Sql servers 2005
Posted by tillu at 5/16/2006 3:20:12 PM
Hello, I would like to know if there is any SDK i can use to build a WebPage which would enable me to transfer data between sql servers. Purpose: Non technical people who are not familiar with using administrative managers, would like to have a publish button where by they can publish/move...more >>

Full Text Search in text field for 'JN00001'
Posted by Matt Jensen at 5/16/2006 3:18:18 PM
Hi (I posted this on the full text newsgroup but it seems pretty quiet at the mo and I was hoping someone on this list might know the answer). I have a full text index on a table on a few columns including a text data type field, and I'm searching for JN00001 which I know is in the text col...more >>

Extract query to an MDB
Posted by utterlyanonymous NO[at]SPAM gmail.com at 5/16/2006 3:16:14 PM
Hello, I have some users which want a particular dataset provided on a daily basis. They do not and can not have permission to access SQL server. Their preferred tool is Microsoft Access. Hence, I would like to create a completely automated scheduled task which will run their query and stor...more >>

SQL Help Please
Posted by Brian Piotrowski at 5/16/2006 3:06:38 PM
Hi All, (This is a two-part SQL question) Can someone tell me if there is an easy way to delete records from a table where there are only four data elements on which I wish to base the delete routine? For example, I have a table that has numerous records in it. I want to delete all r...more >>

Importing Excell
Posted by Harry at 5/16/2006 2:53:01 PM
Looking for a way to import Excell with mulitple worksheets. 1. table that it is going into needs to have an additional column which is automatically populated with the name of excell file 2. the other table it is going to needs to have an additonal column which is to be automatically populat...more >>

legacy table
Posted by soc at 5/16/2006 2:51:48 PM
SQL2000: I have a table with records of types A,B and C say. In a situation where a C type record is updated, I would like that record (pre update) to be inserted into a legacy table. Can anyone advise on how to achieve this? Thanks S. ...more >>

Using inner and outer joins in the same query
Posted by curtmorrisonemail NO[at]SPAM gmail.com at 5/16/2006 1:53:18 PM
Can anyone tell me if it is bad practice to use both an INNER JOIN and an LEFT OUTER JOIN in the same query on SQL Server 2000? ...more >>

Question about Dynamic WHERE clause without Dynamic SQL statement
Posted by Nate at 5/16/2006 1:52:02 PM
I'm running into an issue while using coalesce to create a dynamic where clause. To give some background, here is the article that got me started on this: http://www.sqlteam.com/item.asp?ItemID=2077 What I am trying to accomplish is a series of user configurable filters that will ignor...more >>

Query using comparison between two fields as criteria
Posted by Jeff VanBishler at 5/16/2006 1:34:26 PM
Hi all, Apologies if this is the incorrect group. I couldn't find a group that specifically handled queries in SQL Server. I originally posted this in the Access Queries group, but since my back-end database is actually SQL Server and I am just using Access as my front-end I need suggestion...more >>

Reinstalling of Sample database( AdventureWorks - OLTP) in SQL 2005
Posted by Naana via SQLMonster.com at 5/16/2006 1:31:48 PM
Hi All, I was successfully installing sample database AdventureWork on my server the first time, But realized that I didn't install with all the features with it. I delete the DB and try to reinstall it with all the features. it goes through all the steps but DB don't install or attach. There ...more >>

odd NETWORKIO lock problem after move to w2k3
Posted by Ryan Davis at 5/16/2006 12:34:01 PM
I recently moved a hosted site to a new server, and now am getting NETWORKIO locks, and am having a hard time resolving the issue. The site is ASP/SQL Server 2000, with fairly low quality code. The ASP was generated by Dreamweaver and in many cases copy/pasted from the web. The site was o...more >>

identity and identity increment
Posted by John Smith at 5/16/2006 12:20:48 PM
Hello, whenever I add a record to a table with identity column it increments by one which is what I want. But when I input a record that was reject for any reason (I.e. primary key violation) and then input another record it will not be increment by one....it skips the number that would of be...more >>

Column allows nulls i want to change not to allow
Posted by thom at 5/16/2006 12:10:02 PM
When i do a select on my emplee table for rows with null idCompany i dont get any records I then try to modify the table to not allow a null idCompany and i get this error message: 'Employee (aMgmt)' table - Unable to modify table. Cannot insert the value NULL into column 'idCompany', ta...more >>

prob inserting nulls even after using Case When col1 is null then
Posted by Rich at 5/16/2006 11:50:01 AM
Create Table tbl1( recID int Identity(1,1) Primary key, col1 varchar(10) not null default '', col2 varchar(10) not null default '' ) CREATE TRIGGER t_tbl1Insert ON [dbo].[tbl1] Instead of INSERT AS Begin Insert Into tbl1(col1, col2) select case when col1 is null then '' else col1...more >>

Add a column to a view
Posted by Sonya at 5/16/2006 11:28:03 AM
hello, I am trying to add a column to a view. This is a generic column not pulling from the other tables but will be updated based on the values of the other columns. I thought I simply altering the view and add a column and set a value, if the other values were found true. However, it i...more >>

How TO Block a Record From Read/Write
Posted by Scott at 5/16/2006 11:23:02 AM
Is there a way to block another transaction from reading/updating a record while another read/write operation is ocurring? I tried using "SET TRANSACTION ISOLATION LEVEL REPEATABLE READ;" not sure if this is viable. See below: SET TRANSACTION ISOLATION LEVEL REPEATABLE READ; DECLARE @IsO...more >>

Distributed SQL VS. Service Broker
Posted by Spike Spiegel at 5/16/2006 11:01:02 AM
Hello SQL Programmers. What is the big difference between distributed SQL and Service Broker? Am I just confusing things here? I am starting a project in SQL 2005 and basically I have regional server and a data warehouse, customer might request reports which have data coming from both ...more >>

DB connection within SSIS
Posted by Panos Stavroulis. at 5/16/2006 10:54:01 AM
Hi, I need to be able to query the database within a Script task. I basically need to get the current connection and then execute some sql or stored proc and find out what's in the database and based on this info make a decision in the script. Does anybody have an example in VB.net how to d...more >>

Header information missing from stored procedure
Posted by Dinesh at 5/16/2006 10:15:01 AM
Hi, SET NOCOUNT ON SET TRANSACTION ISOLATION LEVEL READ COMMITTED SET DEADLOCK_PRIORITY LOW GO These above lines are part of stored procedure creation script but these info is seem to be missing when the sp is actually created. May be silly mistake Pls help Thanks...more >>

Stripping unwanted chars
Posted by KatMagic at 5/16/2006 9:28:15 AM
I have a procedure that strips unwanted characters in vb.net, is there a way to do this in t-sql? For instance, I want to take all the symbols out of a string: stripped = Regex.Replace(StringToStrip, "[^ .@/:&A-Za-z0-9]", String.Empty) ...more >>

How to: call a Job using T SQL...
Posted by Roz at 5/16/2006 9:10:02 AM
Hello, all. I'm using SQL 2005. I have a job that I'd like to call from a ASP.NET web page. My plan is to create a stored procedure that calls the job, then on my web page all I have to do is execute the store procedure. My question is how can I call the job using T SQL. I will then embed...more >>

lock_timeout error
Posted by wq352 at 5/16/2006 9:04:02 AM
I have a question about transaction when lock_timeout error occurs the procedure as follows, CREATE PROCEDURE dbo.usp_glock AS BEGIN SET NOCOUNT ON SET LOCK_TIMEOUT 2000 UPDATE glocktbl SET name='john' WHERE id=1 IF @@Error<>0 BEGIN GOTO Err_...more >>

how to delete unused connection in DTS package
Posted by Kevin at 5/16/2006 9:03:01 AM
hi guys, I have a dts package which has 2 unused connections, but I don't know how to delete them using dts package designer... is that possible to do on UI level or do I have to write a script to drop unused connections? -kev...more >>

restore db dump
Posted by William at 5/16/2006 8:58:02 AM
Hi, I have a problem during the recovery of the sql db dump. A user had sql server installed in driver c, my application backed up a db using 'backup database'. Later on the user reinstalled sql server to driver d, and ran my application to do the recovery. The restore db was successful ...more >>

xp_sqlmaint
Posted by sqldba at 5/16/2006 8:12:10 AM
I need help to write Transaction Log BACKUP JOB with the help of xp_sqlmaint. i try to gather require information, but some how it is not working. i will appreciate if some one can help me to put all together. I am trying to do is to create transaction log backup job which runs every hour & ...more >>

Another Way To Write a Stored Procedure
Posted by Mike Collins at 5/16/2006 7:24:02 AM
In the stored procedure below, there are 9 different if conditions being checked. I was wondering if there is a more efficient way (or not) to write this procedure, without having to write the same select criteria each time. The only thing different is the where clause. Any suggestions are gr...more >>

User defined function
Posted by Ulrich at 5/16/2006 7:20:02 AM
I thought it's very easy and wrote: create function easy() returns char(3) begin return 'Uli' end after this typing: select easy() I expected to get the output 'Uli' but I got the error message "easy() can't be recognized as function" (- sorry for my English) What's wrong? -- ...more >>

Checking field within a selected record (**)
Posted by ITDUDE27 at 5/16/2006 5:58:01 AM
Hello, I have sql statement that is selecting multiple invoice records and doing multiple calculations. Now, I need to look in each invoice record for Item_detail, any direction on how I would do that would be appreciated? Thanks....more >>

Help with SQL-script
Posted by pebelund at 5/16/2006 5:56:48 AM
Hi Im a bit of a beginner with sql and need some help with a script. I got a table where I have 2 columns (more, but im focusing on these 2), where I need to switch the data. the data in Column 1 is to be transfered into Column2 and vice versa. How do I script this? I guess I need to fetch th...more >>

Having Multiple ranges in the query
Posted by Atif Iqbal at 5/16/2006 4:08:09 AM
Hi All, I have a problem to get this work done. I want to optimize this by using multiple ranges in having cluase.. for the understanding i'm writing down the whole Query here ... ------------------------------------------------------------------------------------------ SELECT ...more >>

Change TinyInt identity into SmallInt
Posted by Stijn Verrept at 5/16/2006 4:07:31 AM
Hi, I have a table BehaviorProp with an TinyInt identity BP_ID, I need to change the column to a SmallInt. I tried this: drop index behaviorprop.PK_BehaviorProp alter table behaviorprop alter column BP_ID smallint but I get An explicit DROP INDEX is not allowed on index 'behavior...more >>

Get Current Job Status
Posted by len at 5/16/2006 2:42:01 AM
Hello there. I was just wondering if there's a way to get the current status of a particular scheduled job using T-SQL. I'm looking at sp_help_jobhistory but I'm not sure if it'll give me the most up-to-date info that I need. Specifically, I want to check to see if a particular job is cu...more >>

reporting services table formatting
Posted by Mike P at 5/16/2006 1:11:38 AM
When you have a table that continues onto another page, how do you get the table headers to show on the 2nd page? I just get a continuation of the table with no headers on subsequent pages. Anybody know how to do this? *** Sent via Developersdex http://www.developersdex.com ***...more >>

IS NULL not working
Posted by NJ at 5/16/2006 1:07:49 AM
Hi I am trying to do this on a temp table DELETE FROM #output where [tst1] is NULL this for some reason doesnt seem to work. on the other hand when i do the below insert into db_comp select tst1, tst2,tst3 from #output where tst1 is not null seems to work. does anyone know why this is...more >>

Filter records on a Month & Year
Posted by ricky at 5/16/2006 12:00:00 AM
Hi This may sound like a stupid question, but I have a query that returns records on a month and year of a the transaction. What I wish to do now, is write a WHERE clause to filter records to a certain period. For example I wish to show transactions up to and including March 2006. so w...more >>

Subquery? Join? Exists? Dynamic Columns.
Posted by at 5/16/2006 12:00:00 AM
I have 2 tables, Products and Instructions that look like so: Products ProductID, InstructionID, ProductMSRP, ShipDate 123, 345, 119.99, 01/01/2001 456, 678, 20.00, 02/02/2002 789, 890, 345.99, 03/03/2003 Instructions ProductID, InstructionID, InstructionLineNumber, Instruction 456, 67...more >>

SQL Possibility
Posted by Anne at 5/16/2006 12:00:00 AM
I want to create a query that can highlight equal but opposite signed values over the last 5 days. E.g. Sale 500 1 Jan Sale Return -500 3 Jan I this possible within a SQL query? The recordset would be say as below and return the above only. Sale ...more >>

How to generate insert data ?
Posted by Jarod at 5/16/2006 12:00:00 AM
Hey I have database with data in it. I would like some tool to generate Insert statments that will Insert the same data in case I will build another database with the same data model. Just like copying data from one database to the other. It's for testing purposes. I need sample data so I cou...more >>

Service Broker: Sending messages to remote SQL servers.
Posted by Dark Horse at 5/16/2006 12:00:00 AM
Hi All I am trying to find an example of how to send messages to a queue on a remote sql server. Books online is cryptic at best and the other examples I have seen are all very basic. Any pointers much appreciated DH ...more >>


DevelopmentNow Blog