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 > april 2006 > threads for monday april 10

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

Re: many small queries vs one large query
Posted by Ryan Hunt at 4/10/2006 10:39:58 PM
"Ryan Hunt" <ryan.hunt@highwoods.com> wrote in message news:... > Alan, your question is very vague - which may be leading to the lack of > answers. When you say you are fetching 5000 objects, do you mean records? > > What is going to be best depends on a lot. In general, yes, continually >...more >>

Help with cascading SELECT
Posted by Stuart at 4/10/2006 10:38:01 PM
Hello I have the following scenario that I need to address with which I would appreciate some help if anyone has the time: (Simply) I have an asp.net application: I have 2 tables: Table 1 is called Categories and is used to hold hierarchical data (Tiers) - these Tiers can be altered by...more >>

Creating random numbers
Posted by SqlBeginner at 4/10/2006 10:37:01 PM
Guys, I wanted to create random numbers for some strange purpose using SQL Server 2000. Even if the numbers are going to repeat its fine. [Pls note I don't want to use newid() ]. For ex: I want to pass two integer values say, 10, 30 ... now i expect randoms to be generated between these two...more >>

Trimming data field
Posted by Sam at 4/10/2006 9:28:42 PM
I have a 9 digit subaccount field in the account table. I need to modify the 9 digit subaccount field such that I take out the 6th and 7th characters from the subaccount. E.g subaccount 460506061 would become subaccount 4605061. Could someone assist with a update statement which will ...more >>

Trim functions SQL statement.
Posted by Sam at 4/10/2006 9:27:17 PM
I have a 9 digit subaccount field in the account table. I need to modify the 9 digit subaccount field such that I take out the 6th and 7th characters from the subaccount. E.g subaccount 460506061 would become subaccount 4605061. Could someone assist with a update statement which wil...more >>

Query Optimizer
Posted by Leila at 4/10/2006 8:49:13 PM
Hi, I'm very interested in query optimization and I really enjoy this job. I have read everything in BOL and also books like "Inside SQL Server 2000" and "Guru's Guide to SQL Server Architecture and Internals" and "Microsoft SQL Server 2000 Performance Optimization and Tuning Handbook". But ...more >>

DTS Package to VB
Posted by RonL at 4/10/2006 7:43:52 PM
One can save a DTS Package to a VB .bas file. Can you modify the VB code and then reload the package and execute it? I can see an option to save a package to vb but can't see an option to open a vb file as a package. Ron ...more >>

Retrieve Data from same table from different tables
Posted by Kiran at 4/10/2006 7:14:52 PM
Hi, I have databases A, B and C1, C2, C3...... now I need to browse data from same table across C1, C2, C3.. databases. the list of databases to retieve the same table data will come when I join tables from database B and database A. can anyone help me on this Thanks Kiran...more >>



Does full text indexing works on unicode field?
Posted by alvinyyt at 4/10/2006 6:51:45 PM
Hi all, Does full text indexing supports searching on a unicode field, for example, a field that stores chinese characters? Thank you in advance. ...more >>

newb: join on the server or the client?
Posted by sklett at 4/10/2006 6:29:35 PM
I've got your typical one to many relationship between 2 tables. CREATE TABLE tbl_ft_tests ( ID smallint(6) AUTO_INCREMENT NOT NULL, DateCreated datetime NOT NULL ) CREATE TABLE tbl_ft_testsegments ( SegmentID int(11) AUTO_INCREMENT NOT NULL...more >>

SQL Select Puzzle
Posted by Linn Kubler at 4/10/2006 5:53:15 PM
Hi, I'm trying to query a group of tables but am having a bit of trouble figuring out just how to accomplish what I want. Here is my query so far: SELECT distinct claim.claim_number, services.description AS 'Service', pcs.primary_service FROM claim LEFT JOIN charge_on_claim AS coc ON c...more >>

What is Parallelism
Posted by Roy Goldhammer at 4/10/2006 5:41:25 PM
Hello there On many of my quries on the execution plan i see Parallelism. What it that means? ...more >>

Problems with string value "one space"
Posted by Pavils Jurjans at 4/10/2006 4:54:11 PM
Hello, I've been discovering weird problems in my application, and after thorough research, going to lower and lower levels, until I've found the following: The setup: MSSQL table with nvarchar(255) field (Case-sensitive and accent-sensitive collation). The problems are when there is an e...more >>

Convert field
Posted by JimS at 4/10/2006 3:56:46 PM
I am having a bit of a problem. I have a date field that is comming from a different platform as a float. I need to convert these records to datetime or small datetime. Is their a Stored Procedure to do this in SQL or what is the quickest way to do this? Thanks ...more >>

Mother Celko's Monday SQL Puzlzle -2006-04-10
Posted by --CELKO-- at 4/10/2006 3:36:42 PM
Mother Celko's Monday SQL Puzzle! I am gathering material for a second edition of SQL PUZZLES & ANSWERS. The easiest way to do this is to post a puzzle and harvest answers. The solvers get fame (15 seconds, not minutes), glory and their name in the book. The first edition did a lot of SQL-86 ...more >>

Modify UDF hangs SQL Server
Posted by Peter at 4/10/2006 3:22:02 PM
I have a UDF which works fine, but as soon as I try to modify it hangs sql server. I can't run a script through query analyser to update it either....more >>

Display leading zeros
Posted by David at 4/10/2006 3:14:28 PM
I want my SQL 2005 output to display leading zeros up to a total of 6 characters. Foe example, the number 23 would display 000023, 2000 would display 002000, etc. Is there a "Fill" type of command or can I do this in a CAST function? Thanks. David ...more >>

Why NOT to buy SQL 2005...
Posted by AFN at 4/10/2006 3:06:33 PM
After 5 years since the previous SQL 2000 version, you'd think this version would be rock solid, right? I thought so. But I've found there are so many mistakes and problems that I've never seen a service pack 1 from Microsoft be issued so quickly (it is almost out)! Sadly, that service pac...more >>

Compare Triggers Values
Posted by Muhammad Bilal Shafi at 4/10/2006 2:36:02 PM
Hi. How to create a trigger before insert that if a new row is giong to be inserted in a table the trigger compares a value of a column from the table with the value of a column in the record to be inserted.... Regards Muhammad Bilal <bilal_4x@hotmail.com> *** Sent via Developersdex ht...more >>

Send Mail Task issue
Posted by ngorbunov via SQLMonster.com at 4/10/2006 2:12:46 PM
I created a dts package that creates an excel report and then uses the send mail task to email it out. I created the package under the admin login becuase the emailing failed under my own login. So here's the issue....The send mail task is successful when logging in as admin and manually execu...more >>

System to
Posted by Shawn Ferguson at 4/10/2006 1:29:17 PM
We've created a system that has been installed on various webservers with = the same SQL Server database schema (same table names). Recently, we just = changed the schema on the master copy and need to copy the schema for all = the other systems. There is data in the various systems. What is...more >>

Triggers
Posted by Muhammad Bilal at 4/10/2006 1:17:01 PM
How to create a trigger before insert that if a new row is giong to be inserted in a table the trigger compares a value of a column from the table with the value of a column in the record to be inserted.... Thankx...more >>

email alert on job failure
Posted by helpful sql at 4/10/2006 12:59:47 PM
Hi all, Is there a way to send an email alert when a sql server job fails? Thanks in advance. ...more >>

Normalizing help and naming conventions
Posted by Drew at 4/10/2006 12:34:05 PM
I have an Access Database that I am working on normalizing to SQL Server. This Access database has been revised multiple times, each time the programmer (not me!) didn't work to get the existing data to the same level as the revised program. For instance, the HairColor column has the follow...more >>

pass parameter to nested procedure?
Posted by cooltech77 at 4/10/2006 11:46:01 AM
Hi Can I do this in T-SQL?I am using SQL server 2000 create proc1(@param1 int) as --some code exec proc2(@param1) --some code Basicaly I want to pass param1 which is input to proc1 as input to proc2 which gets called within proc1 Thanks. ...more >>

Why not varchar(MAX) all the time?
Posted by clintonG at 4/10/2006 11:30:43 AM
I need help understanding varchar(MAX). I really don't see the difference if I use varchar(50) in a field that will be truncated anyway when the field contains only 40 characters. So what do I do when that field needs 51 characters? Hence why not use varchar(MAX) when one does not know what...more >>

Create stored procs in new DB from within a stored proc?
Posted by ScottL at 4/10/2006 11:21:03 AM
In our application, we dynamically create new databases using a stored procedure. Each new database must have a few required stored procedures created in it. Since SQL Server does not allow the specification of a different database context for creation of procedures or functions, the current...more >>

Aggregate returns null - sub value
Posted by randy1200 at 4/10/2006 10:30:02 AM
I have something like the following: select count(mycolumn) from mytable where... This works great. The problem is that sometimes, count(mycolumn) returns null because mycolumn contains no values. In this case, I'd really rather show the user a '0' rather than the word null. Any suggest...more >>

Help with a Join/ Update Statement.
Posted by Matthew at 4/10/2006 10:02:58 AM
I am trying to take the four tables I have and concatenate them into a single table that has everything. I would have used a join operation but the results are not consistence, especially if you have renamed a database and or have multiple files for both the data and logs in a single DB. -TI...more >>

Select statements with column indexes instead of column names
Posted by Steve Moreno at 4/10/2006 10:00:01 AM
I was wondering if anyone knew if it was possible to reference column indexes instead of column names in a Select query or stored proc. For example, if the select statement is "Select FirstName, LastName From tblNames" is it possible to do something like "Select column(0), column(1) From tblN...more >>

select * from (select ...)
Posted by ina at 4/10/2006 9:27:25 AM
Hello all, I have a problem with this query, only syntaxe SELECT * FROM (SELECT *, Date, exec_date, name FROM f_view WHERE (Date = (SELECT MAX(date) AS maxva...more >>

instead of trigger for null insert - problem
Posted by Rich at 4/10/2006 8:51:01 AM
The table below cannot have null values, so I added an instead of trigger to deal with this, but it is not working. Any suggestions appreciated what I need to do so that if null values happen to be inserted I can deal with them. create table tbl1( rowID int Identity(1,1) Primary Key, fld1 ...more >>

Need some practice
Posted by Water Cooler v2 at 4/10/2006 8:27:14 AM
Please point me to a web resource from where I can study: 1) writing complex queries such as those involving HAVING, mult-level nested queries, GROUP BY, T-SQL functions 2) Joins - a lot of practice 3) Stored Procedures, transactions, cursors and triggers - I need some heavy-duty practice...more >>

CREATE TRIGGER Only on Update of Current Record
Posted by Altemir at 4/10/2006 8:24:54 AM
I want to create a trigger in a table so that when a user changes the STATUS value to 'C', the trigger causes a new record to be appended to an existing table. I am having a problem creating the trigger's action statement to be such that it executes only when the STATUS value for a particular...more >>

replacement of *= in 2005
Posted by mavrick_101 at 4/10/2006 7:58:01 AM
Hi, We are migrating to 2005 and there are some old queries that use *= in the sql. Is it no more used? Whats the other way to get the same functionality? Thanks...more >>

What is a full-text index?
Posted by Water Cooler v2 at 4/10/2006 7:27:07 AM
What is a full-text index? Please be gentle. Sorry for not looking it up in the help or on the Web. Be kind. ...more >>

Urgent Date Problem
Posted by Phil at 4/10/2006 7:25:02 AM
Hi All, I have 2 dates that I am trying to find the number of days between, Start Date Format is 2005-11-01 00:00:00.000 (YYYYMMDD) End Date Foramt is 2005-11-010 00:00:00.000 (YYYYMMDD) Does anyone know how to do this. Thanks PD...more >>

How to filter our system objects from the list
Posted by dariusz.dziewialtowski NO[at]SPAM gmail.com at 4/10/2006 7:11:10 AM
I'm using following statement to get the list of objects in given SQL Server database (this is taken from VB6 code): lstrSQL = "select name, refdate from dbo.sysobjects where " & lstrFilter & " order by name" I apply filter to narrow the results to particular type, for example for procedure...more >>

SQL Row Comparison
Posted by Skip at 4/10/2006 6:24:24 AM
Hello all, Having trouble writing a SQL statement that does the following: Starts at the beginning of table and compares a date in the first row to a date in the second row if the difference > 5 minutes then return these two rows. This needs to be done for the entire table from beginning to e...more >>

index tepmorary table
Posted by Will at 4/10/2006 5:49:13 AM
Hi All, I'm looking at a query at the moment which builds up a large-ish (50,000 rows) temporary table, then goes about performing various updates and selects. This is taking ages as the table is too large, so full table scans are being performed on ab out 8 or 9 separate selects. I've tri...more >>

Triggers for tables on different DBs
Posted by basulasz at 4/10/2006 5:29:03 AM
Is it possible to write a trigger on different databases, or i can only write a trigger within a single db?...more >>

"Object is required" (DMO) ?
Posted by Enric at 4/10/2006 4:32:02 AM
Dear all, are you seeing something weird here? Dim oServer As SQLDMO.SQLServer2 'Dim oServer As SQLDMO.SQLServer2 For Each oServer In oApplication.ListAvailableSQLServers Debug.Print oServer.Name Next This snippet fails. Let me know where failing is any clue... -- Please post...more >>

using many database with one stored procedure
Posted by 404 found at 4/10/2006 3:15:02 AM
hello, using SQL Server 2000 i have 2 data base into the same Server (the first Analysis base, the second Reference base). i want to write a stored procedure who must read some informations from tables into Reference and write some other informations into base Analysis. this SP must be wr...more >>

SQL list max value per month
Posted by ina at 4/10/2006 2:50:21 AM
hello, I have a problem with sql code My problem I have done this query to know the max of the date: select Top 1 value, intname, TN_ID, date, date_exec from(select TN_ID, N.date, N.intname, N.date_exec, N.value from [TN] N inner join [TF] F on N.TF_id = F.TF_id inner join ( select n...more >>

Urgent: ASP.NET Role Management problem
Posted by SteveUKdev at 4/10/2006 2:38:02 AM
Hi everyone, I'm trying to implement ASP.NET 2.0 Role Management on an SQL Server 2000 DB. It worked fine on my development server, but following deployment to my test server my login dialog (using ASP.Net Login Control) fails with the following exception: Could not find stored procedure...more >>

or vs union
Posted by peppi911 NO[at]SPAM hotmail.com at 4/10/2006 2:28:39 AM
Hi, ich found that select * from a,b where a.id = b.id and a.text = 'foor' or 'bar' does take ways longer than doing 2 select statements with union. is that normal? what happens in the background using 'OR'. Are there other statemnts to gain speed by such tricks? thanks, mike ...more >>

how to know time of insertion of a row
Posted by Suparichithudu at 4/10/2006 2:26:01 AM
Hi Is there a way to know time of insertion of a row without using, timestamp,currentdate function etc. Isthere any DBCC COMMAND which gives me the date of insertion of a row. -- Thanks in Advance Regards Suparichitudu ...more >>

Get files out of SQL 2000 Server?
Posted by Joris De Groote at 4/10/2006 12:00:00 AM
Hi, I got some PDF files in an SQL 2000 Server. Now I want to be able to open these files with some programming. How can I access those files and open them? Thanks Joris ...more >>

Insert statement help
Posted by Nizham at 4/10/2006 12:00:00 AM
any one can help what is wrong on this statement insert into Test1 (FCODE, FNO) values ( SELECT 'A', Number FROM dbo.Numbers WHERE Number >=3 AND Number <= 5 and Number not in (select FNO from Test1 where FCODE = 'A') ) ...more >>

How to write a monitor to records the users access the special database?
Posted by ABC at 4/10/2006 12:00:00 AM
How to write a monitor to records the users access the special database? I want to write a monitor to records and real time controls the users access the special database. Is there any best idea? ...more >>


DevelopmentNow Blog