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 > february 2006 > threads for thursday february 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

Regarding OPENXML to get the values
Posted by Herbert at 2/16/2006 11:55:27 PM
Hi All, Am using the following XML String. I want to get all the values from the XML. but i dont know how to get it. Can any one please help me ASAP. Eg: '<?xml version="1.0" ?> <ArrayOfAdminSearchCriteria> <AdminSearchCriteria Name="Test0"> <Value>0</Value> <Value>T0</Value> ...more >>


Regular Expression Support
Posted by Jeff S at 2/16/2006 11:21:27 PM
Is there any Reg Ex support in any recent version of SQL Server; like for use with check constraints? -Thanks ...more >>

project server
Posted by Frank Dulk at 2/16/2006 9:56:48 PM
I installed SP4 of SQL SERVER 2000 and even so I don't get to install project server. Somebody knows how I can solve that.. the error message says that I have to install the sp3 or superior of the sql server 2000. ...more >>

1, 2, or 3 Tables (Data Modeling Question)
Posted by Jeff S at 2/16/2006 9:50:45 PM
I'm modeling some entity that could reasonably be considered to be [one entity] or [two entities] --- people which are customers and employees. AFAIK, these are my three basic options: OPTION 1: Have one table, People, with some "flag column" that tells us which kind of person we're deali...more >>

Pull if matches 2nd to end of text field
Posted by Dan at 2/16/2006 9:35:38 PM
I have 2 tables in a database. Table 1 has a field (1a) that contains a customer part number. It also has a field (1b) that contains just a manufacturer part number. Table 2 contains 2 fields. Field (2a) has the description that might have a word or many words then the manufacturer part num...more >>

Need Help Please...
Posted by JonB at 2/16/2006 9:23:06 PM
ok i want to say first off i'm really bad at explaining problems so people can understand them but i will try my hardest. i need to write a query for our apparel department that shows total revenue per retailer. this report will get compared to last years. i use 3 tables to create this query, slc...more >>

Comparing two databases
Posted by AkAlan at 2/16/2006 4:56:30 PM
Is there a way to compare the strored procedure,views and UDF's between two databases to see if there are any differences. I use one database for developement and the other is online. I would like to be able to run a structural comparison between the two to make sure i didn't forget to script ...more >>

can someone tell me what I am doing wrong
Posted by Robert Bravery at 2/16/2006 4:40:01 PM
HI all, I have this trigger on a table ********** CREATE TRIGGER addtotal ON dbo.ClaimFinancialLoss AFTER INSERT, UPDATE, DELETE AS if update(Ammount) begin Declare @tot int, @id int select @id = ClaimID from inserted --Print 'Id after insert' +str(@id) if exists (select * from deleted) ...more >>



search a value string in entire database
Posted by culam at 2/16/2006 4:33:27 PM
Is there a way to search entire database for a value "HTML" that stored on any given columns? Thanks, Culam ...more >>

Function to find character in string
Posted by Kayda at 2/16/2006 4:13:03 PM
Hi: I was looking through BOL for a function that would return the numerical place where a string first occurs (similar to Crystal Report's 'instr' function): so FUNKYFUNCTION('abcdefgd','d',1) would return 4, the first occurrence of the 2nd argument: 'd'. The 3rd argument is the star...more >>

Comparing 2 dbs for differences in column definitions
Posted by MittyKom at 2/16/2006 3:23:28 PM
Hi All I have 2 dbs, one for prodcution and the other one for development environment. They are meant to be the same. Is there a script/way to compare the dbs for any difference in column datatypes, length. This query has what i want to compare: select table_name, column_name, ...more >>

Storing an HTML page
Posted by tshad at 2/16/2006 3:03:08 PM
I am trying to store an html page in a table that I want to email from my Stored procedure, but have run into a couple of problems. I originally stored it as a Text field (to take care of the 8000 varchar limit), but I apparently can't use Text as a local variable to read the data into. ...more >>

Who has the highest bid?
Posted by Mayte at 2/16/2006 2:58:15 PM
Hi I have a table with items and bidders Bob Mike Sally Lamp 10 30 40 Chair 20 50 90 Sofa 19 42 73 Bed 10 19 400 I need a query that will show who had the highest bid for each item Thanks!!!!!...more >>

Creating Indexes on Views
Posted by pmud at 2/16/2006 2:34:31 PM
Hi, I have a view which uses 2 other views.I need to create an index on this view. But one of the two other views has Union statements. Is there any way that an index can be created on this final view ( which is made of the other 2 views)? Thanks -- pmud...more >>

Count Occurances in a column
Posted by laurenq uantrell at 2/16/2006 2:11:22 PM
Is there a way to count the number of times a character or string appears in a column in a table row/column? Example, tblTable has column StringData varchar(1000) StringData contains the value "Mary Had A Little Lamb Lamb and Then It Died" I want to know how many times "Lamb" appears in t...more >>

Attach and ODBC Database in Enterprise Manger (I think)
Posted by Michael Kintner at 2/16/2006 2:04:20 PM
I have created an SQL database and would like to attach an ODBC database so I can query its data along with data from the SQL database. How can I attached this table in the Enterprise manager? Or maybe my thinking is wrong and can't be done this way, so how do i do it? Sotred Procedures? ...more >>

Select Incremental..
Posted by jrmann1999 NO[at]SPAM gmail.com at 2/16/2006 1:46:10 PM
I have a Join that's creating identical rows except for an incremental column. I want to only return the row with the highest incremental number, how can I accomplish this? DB structure is like EP_KEY(INT), PAT_KEY(INT), PAT_NAME(VARCHAR), EPISODE(INT) The EP_KEY and PAT_KEY are the prim...more >>

SQL 2005 T-SQL Reference
Posted by The Cornjerker at 2/16/2006 1:39:49 PM
I have a book that came with SQL Server 7.0 called the "Microsoft SQL Server Transact-SQL and Utilities Reference, Volume 1." It basically lists the T-SQL statements with common examples for each. Nothing else, no programming techniques, no tutorial, etc. I use it extensively because I've nev...more >>

Execute Package Task Not Working
Posted by Andre at 2/16/2006 1:25:26 PM
I am trying to run two execute package tasks. I want the second task NOT to execute if the first one fails, but I cant seem to get this working. I have put the workflow in place and check fail package on first error in every place I can think of, yet the second package always executes regard...more >>

Updating Table with data from another table
Posted by StaarTech at 2/16/2006 1:15:34 PM
Hi All: I am a newbie at SQL, and I have a two-part question, that I am hoping you can help me with. Please bear with me. Original Issue: We have a non-MS-SQL database that exports data into many text files on a daily basis. We then use DTS jobs to import(append) the text files into MS ...more >>

SELECT query help
Posted by DC Gringo at 2/16/2006 12:27:46 PM
I have a SELECT query SELECT date_registered, COUNT(*) AS registrations FROM individuals GROUP BY date_registered ORDER BY date_registered ASC The resultset shows something like this: date_registered, registrations ----------------------------- 1/1/2005, 5 1/2/2005, 8...more >>

Timeout expired
Posted by SQLCodder at 2/16/2006 12:20:27 PM
I'm having trouble finding the cause of the following error message: [Error#: -2147217871 Description: Timeout expired (Source: Microsoft OLE DB Provider for SQL Server)] The error is occuring when trying to execute a simple update query: UPDATE merchant_billing SET billing_last_billing_d...more >>

GetDate not working if passed
Posted by tshad at 2/16/2006 12:01:15 PM
I am calling a SP that is expecting a datetime. If I pass '02/15/06/, it works fine. If I do it like: ****************************************************** Declare @DateToSend VarChar(20) Select @DateToSend = GetDate() Exec COM_INSERT_MESSAGE_TO_QUEUE_SP 1,@DateToSend ***********...more >>

Syntax to read/pull data in one server from another server?
Posted by Rich at 2/16/2006 11:58:28 AM
Hello, I have a production server and a development server (which I just installed last night), called serv1 and serv1\dev, respectively. I am trying to read data from a table in a DB on serv1 but from serv1\dev. I have linked serv1 to serv1\dev from Enterprise Manager and am impersonatin...more >>

Using aliases in SELECT DISTINCT clause and ORDER BY
Posted by Juan Darío Tempesta at 2/16/2006 11:41:34 AM
Hello, I'm having a problem when using aliases for columns in the select list and using the DISTINCT keyword. This is a simplified version of the real problem. CREATE TABLE #Authors ( [AuthorId] INT, [Name] VARCHAR(50) ) CREATE TABLE #Books ( [BookId] INT, [AuthorId] INT, [Na...more >>

SQL table information help
Posted by Raymond at 2/16/2006 11:27:15 AM
Hi all, Could any one show me how I can get the following information on SQL server on any one table? - how often are new records inserted into the table - how often are new records modified in the table - how often are records deleted from the table -- Raymond Yap ...more >>

Incrementing field value by one
Posted by Kayda at 2/16/2006 11:18:42 AM
Hi: I have a field in a table that is NULL for all records. I want to set it to increment by 1 so if I have 30 records, the values in this field will be 1 for the first record, 2 for the next record etc. How do I do this with one UPDATE statement? Thanks, Kayda ...more >>

Extra xml node
Posted by Hyper at 2/16/2006 11:11:27 AM
This is in sql 2005 I have a query that is returning a set of rows each with one xml field row1 -<apple></apple> row3 -<orange></orange> row2-<grape></grape> I want the output to look like this <fruits> <apple></apple> <orange></orange> <grape></grape> </fruits> However when I use FO...more >>

Multiple select statements in one query?
Posted by Preacher Man at 2/16/2006 10:31:06 AM
How can I run a select statement on data from a previous select statement within the same query? In VFP I could select the data into a cursor and then run the second select statement on the cursor. What is the best way to get this to run properly? Thanks. ...more >>

Sql 2k error
Posted by mecn at 2/16/2006 9:52:14 AM
hi, we are running some process and got this error. execute encryptcardnum Error:Internal Query Processor Error: The query processor could not produce a query plan. Contact your primary support provider for more information. Any ideas? Thanks ...more >>

what's the secure way to post the jobs on the etranet?
Posted by asdf at 2/16/2006 9:39:47 AM
Hi, I have the scenario where I have one database and need to post jobs on the intranet and then the same jobs on the extranet. I wonder what is the most feasible and secure way of doing it without buying second license of MS SQL to duplicate the data. So far I am leaning towards Web Servic...more >>

To each row and each column a query
Posted by Roby Eisenbraun Martins at 2/16/2006 9:02:38 AM
Hi, I'm trying to create a query that generates a INSERT script to each row and each column. ID | NAME | Description (logid, fieldid, rowid,fieldname,value) --------------------------- 1 | John | Friend -> INSER...more >>

How to compare strings for equality in Transact SQL
Posted by Bill at 2/16/2006 8:53:56 AM
I just learned that if a VARCHAR column contains 'ABC ' (three letters and a space) then SELECT * FROM ATABLE WHERE THECOLUMN = 'ABC' will return the record since SQL Server incorrectly pads the shorter value with spaces to the length of the longer before comparing them. Is there a way to c...more >>

Binary column
Posted by Arne at 2/16/2006 8:44:30 AM
We have a binary column that stores web passwords. What is the proper way to access this column? The sql below is blowing up! UPDATE AppServices.dbo.DBUsers SET Password = 'MyPassword' WHERE UserId ='MyLogin'...more >>

Cant SAVE a view
Posted by pmud at 2/16/2006 8:24:03 AM
HI, Whats wring with the followng views? I can view the results if i run the view without saving; but when try to save the view, I get error . View1: SELECT COUNT(*) FROM dbo.Cingular_AllMin MINUS SELECT MDN FROM ...more >>

Unique index on joined view for fulltext index
Posted by iontichy at 2/16/2006 8:11:51 AM
Hello, i've created a view with two joined tables. Now i've tried to create a unique clustered index on an id column. This is not possible, because the id is not unique for one of the joined tables. But i need this unique index for creating a fulltext index on this table. Is there a solution fo...more >>

Row values to string
Posted by Roby Eisenbraun Martins at 2/16/2006 8:09:03 AM
Hi, How can I create a string containing all values from a row in a table(SELECT). sample: ID | NAME ------------ 1 | John -> "1,John" 2 | Alexander -> "2,Alexander" Thank you, Roby Eisenbraun Martins ...more >>

trying to calculate a complicated average in a query
Posted by jason at 2/16/2006 7:55:13 AM
so let's say there is a table like so: create table users ( userid uniqueidentifier primary key not null, name varchar(50) not null, datecreated datetime default current_timestamp not null) and another table like so: create table orders ( orderid uniqueidentifier primary key not nul...more >>

Identifying unused columns in multiple databases
Posted by Debbie at 2/16/2006 7:38:06 AM
Hi - we have a situation where we have 23 identical databases on servers across the country. We know that there are fields within this db that no one is using and would like to be able to identify all of them so they can be removed across the board. (There are multiple tables and columns) We ...more >>

Please suggest an index
Posted by Dave at 2/16/2006 7:29:39 AM
Could you guys give me some feedback on the below query and suggest the best possible query assuming this is the only query that will be ran against these tables? The destination has 200 million records and the staging table has 30 million records. col1_int has 1500 unique values col2_in...more >>

Temporary tables: Simple question
Posted by pmud at 2/16/2006 7:16:29 AM
Hi, I want to create a temporary table and load it with data. Where do i write code for this. In Query Analyzer? But I dont want to load it with data only once. Everytime, the base tables from which the temporary table is created is loaded with data, this insert into the temp table should b...more >>

Query producing duplicate results
Posted by dba123 at 2/16/2006 7:15:40 AM
I swear I had this fixed but when I looked again this morning, I noticed that this query is producing dup records in the results. Something is not right with my query here: SELECT DISTINCT m.customer, c.name, c.customer, (SELECT Top 1 fd.Fee1 FROM FeeScheduleDe...more >>

trigger Performance question
Posted by Roby Eisenbraun Martins at 2/16/2006 5:30:03 AM
Hi, I'm Roby Eisenbraun Martins. I'm a C++, VB, C# and ASP .NET. I would like to know is there is a difference in performance between creating three triggers insert, update and delete or create one trigger treating all three cases at once. Thank you, Roby Eisenbraun Mart...more >>

MSSQL Mistake
Posted by juokaz at 2/16/2006 5:25:33 AM
I have piece of code- SET @UserID = @@ROWCOUNT and it's said that there is mistake, where it is? -- juokaz ------------------------------------------------------------------------ Posted via http://www.codecomments.com -------------------------------------------------------------------...more >>

Collation
Posted by Jaco at 2/16/2006 4:51:30 AM
Hi, What is the difference between SQL_Latin1_General_CP1_CI_AS and Latin1_General_CI_AS ? Thanks ...more >>

Trigger UPDATE details
Posted by Roby Eisenbraun Martins at 2/16/2006 4:38:51 AM
Hi, I'm Roby Eisenbraun Martins. I'm a C++, VB, C# and ASP.NET developer. How can I identify the table changed fields when the trigger UPDATE is fired? Thank you, Roby Eisenbraun Martins ...more >>

Why does doing update in chunks works faster than doing the whole?
Posted by Sydney Lotterby at 2/16/2006 12:00:26 AM
SQL2K w/all sps; Win2K3 Enterprise clustered server; 3 GHz dual CPUs; 4 gb RAM; 200+gb HD free; low traffic; Tables below: GoFwdImages ~ 490,000 rows; rectype ~ 20 rows; instloc = 1.6M rows All these tables have the necessary indexes on them to make the JOINs efficient. The script bel...more >>

Truncate Time or change it.
Posted by Islamegy® at 2/16/2006 12:00:00 AM
Time part of datetime column is not important to me so I have need a way to truncate time or reset it to 00:00:00. This really make diffrent when i try search by date.. Any help please?? ...more >>

Trigger on INSERT,
Posted by Veasna Much at 2/16/2006 12:00:00 AM
Dear sir/madam, I have a problem with trigger. I want to create a trigger on insert data to table TBL_1, and when that trigger fire there is an insert to TBL_2 by using some data that just doing an insert in TBL_1. Is there any posibility to get the data that we've just insert in TBL_1...more >>

convert
Posted by Win at 2/16/2006 12:00:00 AM
why do the results of the following sql are 0 select convert(int, 0.9) select cast(0.9 as int) ...more >>

update one table with records from anoter table in a select
Posted by Robert Bravery at 2/16/2006 12:00:00 AM
HI all, This might seem trivial to all the gurus here, but me, still a lot to learn it seems a far off. Anyway, I want to update, or insert rows into a second tables based on samerows of another table select * from claimdeductables where claimid = (select claimid from inserted) I need to up...more >>

Query Problem
Posted by at 2/16/2006 12:00:00 AM
Dear All, I have a problem about creating a view to concat all the row field together. For example I have a table with 2 columns ColA, ColB 1 , A 1 , B 2 , A 2 , B 2 , C I want to make a view using group by and the excepted view should return ColA, ColB 1 , A-B ...more >>

Designing Database Diagramm
Posted by fantasimus via SQLMonster.com at 2/16/2006 12:00:00 AM
Hi, i am looking for a tool to design den model of a database. i took a look at powerdesigner, embacadero.. which one do you prefer to design the model. i am using SQL SERVER 2005. -- Message posted via SQLMonster.com http://www.sqlmonster.com/Uwe/Forums.aspx/sql-server-programming/200...more >>

line break
Posted by ichor at 2/16/2006 12:00:00 AM
hi how do i add line break in a select statement i want select 'name' + @name + 'line break here' + 'age' + @age ...more >>


DevelopmentNow Blog