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
August 2008
all groups > sql server programming > august 2006 > threads for monday august 28

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

SELECT TOP XX PERCENT
Posted by don larry at 8/28/2006 7:51:26 PM
Greetings, Very simply, I don't wanna SELECT TOP 20 percent of a resultset, nor do i wanna to SELECT TOP 40 percent, but I want to SELECT records BETWEEN TOP 20 and TOP 40 percent....possible without having to loop? SQL 2000 Platform Thanks in Advance, Don *** Sent via Developersdex ...more >>


WHERE Clause Question
Posted by Jon Spivey at 8/28/2006 5:32:52 PM
Hi, Using SQL Server 2000 on Win2003 I've got a table like this Models ModelID int identity pk Model varchar(50) In a stored procedure I need to retrieve the modelid given a model. The problem is that sometimes the input to the sp will match an existing model but the words will be in a...more >>

Help w/CASE syntax
Posted by Cindy Mikeworth at 8/28/2006 4:59:40 PM
Can anyone tell me what is wrong with the following syntax? CASE {Invoicing Transaction Amounts History:Item Number} WHEN like 'GP%' THEN {Invoicing Transaction Amounts History:Extended Price} ELSE 0 END ...more >>

select *
Posted by Hammou at 8/28/2006 4:39:16 PM
Hello, I have three tables : a, b and c. In each one, i have three same columns let say col1,col2,col3. I want to concatenante the tree tables : SELECT a.*,b.*,c.* into d FROM a,b,c where a.col1=b.col1 and a.col2=b.col2 and a.col3=b.col3 and a.col1=c.col1 and a.col2=c.col2 and a.col3=c.col3...more >>

Performance and Index
Posted by Arjen at 8/28/2006 3:49:47 PM
Hi, In my stored procedures I make selections based on a 'combined' key. I.e.: WHERE [Postcode] = @PostCode AND [No] = @No 1) When there are less [No]'s is it then smart to select first the [No] and then [PostCode]? I.e.: WHERE [No] = @No AND [Postcode] = @PostCode 2) How do I make th...more >>

XML Data Type - Illegal Characters
Posted by Amos Soma at 8/28/2006 2:08:16 PM
In my SQL app, I am converting a varchar(max) type, passed to a stored procedure, to an XML data type in the stored proc. I've noticed that if the contents of the varchar(max) string contains illegal XML characters (such as '&'), the conversion will fail. This doesn't surprise me, and I wou...more >>

Using subquery in select statement
Posted by LOLO at 8/28/2006 1:38:02 PM
I am looking at reusing the results of a first query in a second select statement. I have a first table "ACTIVE_FIELDS" in which I maintain the columns I want to query. Table name ACTIVE_FIELDS ----------------------------------------- Field - Status ----------------------------------...more >>

DAO, SQL Server 2005, and VB6
Posted by Marcus at 8/28/2006 1:26:52 PM
I have some legacy VB6 code that uses DAO (Microsoft DAO 3.6) to access an access 2000 database. In this app, Access is used soley for data storage - there is no UI component. I have converted the database to SQL Server 2005. Can I use DAO to access the new SQL Server database, or must I change ...more >>



Can I use WRITETEXT/UPDATETEXT in a Set operation
Posted by kevin at 8/28/2006 12:43:01 PM
using sql server 2k I think I already know the answer, but ... Is there anyway to use WRITETEXT or UPDATETEXT in a set operation like the following which, of course, doesn't work. update dbo.mytbl set txtcol = WRITETEXT dbo.mytbl.txtcol TEXTPTR(txtcol) 'some new text for colID' + cast(...more >>

Row-level security
Posted by Jack at 8/28/2006 12:09:24 PM
Hi, I'm using SQL Server 2000 and I want to implement row-level security. I have two groups. Group 1 may access all rows but group 2 may only access certain rows. I created a view for each group. In my application, what's a good way to know which view to use based on the user? Should I try ...more >>

DateTime Conversion
Posted by Paul at 8/28/2006 12:00:02 PM
I have a datetime field which could be... '2006-08-18 01:00:00' or '2006-08-18 03:12:45' or '2006-08-18 14:67:23' Does anyone know of a SQL Server datetime function or combination of SQL Server datetime functions which I could run which would always convert any of the above functions ...more >>

Need help on checking indexes on tables
Posted by Learner at 8/28/2006 11:53:16 AM
Hello, How do I check the whole information on a table about the indexes. For instance we have Vehicle and Manufacturer tables and want to make sure that the ManufacutereID FK in Vehicle in tied to ManufacturerID (PK of Manufacturer) or to some other table that has ManufacturerID. is tha...more >>

I'm losing my tildes over here!
Posted by Mike C# at 8/28/2006 11:36:19 AM
Hi all, Looks like I inherited a little collation problem, and it's causing me headaches. This is a little involved, so please bear with me: Most of the CHAR and VARCHAR columns in the tables of this database are set to SQL_Latin1_General_CP1_CI_AS collation. A few are set to SQL_Latin...more >>

How to get the running full sql statement
Posted by nkw at 8/28/2006 10:34:01 AM
I highlighted partial sql statement and ran it. However, I forgot which part I highlighted. Anyway to show the full sql statement I executed? The activity monitor just shows partial sql statement....more >>

Server: Msg 311, Cannot use text, ntext, or image columns in the 'inserted' and 'deleted' tables
Posted by samirtpatel NO[at]SPAM gmail.com at 8/28/2006 10:01:01 AM
Hi, I am running sql server 2000 (8.00.2039 (sp4)) on XP Professional. when I try to create the trigger on one of the table I am getting following error. Server: Msg 311, Level 16, State 1, Procedure drugm_udpate, Line 16 Cannot use text, ntext, or image columns in the 'inserted' and 'dele...more >>

MOD
Posted by CLM at 8/28/2006 9:26:01 AM
I can't remember or find the function that returns a MOD value. Can someone let me know what it is? Thx....more >>

Control Characters
Posted by CLM at 8/28/2006 9:25:02 AM
I've got flat files (for Sql Server 2000) that have control characters in them. I need to bcp and DTS them into various tables but the control characters are screwing it up. How can I filter them out?...more >>

Pulling data from Access database into Intranet?
Posted by Stewart at 8/28/2006 8:42:49 AM
Hi there, I have an Access database, which contains the details of company staff and services. The plan is to extract data from this database onto our forthcoming Intranet (no inserting, updating or deleting at this point). The Intranet itself has been created in ASP.NET, using Microsoft Vi...more >>

stored procedure table dependency
Posted by SalamElias at 8/28/2006 8:25:01 AM
At which moment SQL creates a dependency with tables ? is it whenevr you reference the table in the SP (insert or update or delete statm.......) or it is something else I have a table where I see some SP when I do Show dependencies but not others. thanks for your help...more >>

Need help with SQL Statement
Posted by cider123 NO[at]SPAM hotmail.com at 8/28/2006 8:12:27 AM
I'm trying to figure out how to return just 'Job Requests' that have failed. This gives me just the jobs that fail: SELECT Site FROM JobQueue WHERE Success = 0 However, if another job from the same Site comes in and it's successful then an entry will exist in this table for Success = 1. ...more >>

sql server collation
Posted by polder_udo at 8/28/2006 7:44:54 AM
hello can somebody please tell me what selection i have to make in order to have a collation "SQL_Latin1_General_CP1_CI_AS" as a default servercollation while installing SQL server? someone installed our produciton server and "forgot" what he selected while installing the server. Now i have...more >>

working with triggers
Posted by Srirangam Queen at 8/28/2006 5:49:01 AM
i'm having 2 master table named soft-skills,Fields in which we have to enter the valid data that too manually.If i add the soft skills to soft skill table then the value has to be added to the Field table too,i'm using triggers to do the procedure. but thetre is one problem prevailing while i...more >>

File writing in SQL
Posted by Joy at 8/28/2006 4:45:02 AM
Hi, I am faced with a situation where i need to write the output of a stored procedure to a text file. Well, i am writing a procedure that generates the script for triggers, i want these scripts to be written to a text file. Please suggest how do we do this and if possible also give an examp...more >>

Quotation probelm
Posted by ammar_fake NO[at]SPAM vip.hr at 8/28/2006 2:34:41 AM
This doesen't work: EXEC(' SELECT * FROM OPENQUERY(ORA1, '' SELECT * FROM ORA_TAB1 WHERE PERSNAME LIKE "%' + @var + '%" '' ) ') (@var is the SQL Variable) because "%' + @var + '%" is already encapsulated within quotation. So my question is - how to I get...more >>

Database Error Handling in C#
Posted by Suhas Vengilat at 8/28/2006 1:58:01 AM
Hi All, I have a couple of stored procedures written in SQL 2000. Given below one sp. ***************************************************** ALTER PROCEDURE [dbo].[usp_PC_AcTypeMInsert] ( @AcTypeName varchar(50), @GLCode varchar(50), @ErrorCode int output ) AS SET NOCOUNT OFF; BEGI...more >>

Need help with JOIN condition
Posted by Scott A. Keen at 8/28/2006 12:27:27 AM
Hi, I need some help with writing the T-SQL script to select parent records which do not have a child record with a certain condition. In my example below, I need to write script to select all the Companies which do not have a VP. In my example, I need the SQL to return records "Widgets" and "ABC...more >>

Evaluate() or similar function in sql server 2000 or sql server 2005 ?
Posted by Luqman at 8/28/2006 12:18:41 AM
I have a field where different formulas are saved in a varchar field. for example: 143*23*33 Qty*Rate/100 Qty*Amount/100 Is there any function in Sql Server 2000 or Sql Server 2005 which can calculate this string. Best Regards, Luqman ...more >>

Assigning a row number to each row (for pagination and browse)
Posted by Man-wai Chang at 8/28/2006 12:00:00 AM
I have a table like this (uniqcode is the primary key): uniqcode name -------- ---- 1 bb 2 aa 3 aa 4 dd 5 cc How could I create the following table out of the above one? row_num name uniqcode ------- ---- -------- 1 aa ...more >>

Problem creating a http endpoint
Posted by k at 8/28/2006 12:00:00 AM
Hi all, I'm trying to create my first http endpoint using the code below. CREATE ENDPOINT EndTask STATE=STARTED AS HTTP ( SITE= 'MARIA2/SQLSERVER2005', PATH='/sql', AUTHENTICATION = (INTEGRATED), PORTS= (CLEAR) ) FOR SOAP ( WEBMETHOD 'GetAllEndPoints' ( NAME= '[MARIA2/SQLSERVER200...more >>

subQueries with update and alias
Posted by Totto at 8/28/2006 12:00:00 AM
Hi, How do I set an alias when using SubQueris with an update. i.e. update test as t set t.Val1 = @Total*(Select Factor from #Temp1 as t2 where t.Cell = t2.Cell) where t.id = @id The alias t is not valid. How is this done? Thanks Totto ...more >>

Performance problems
Posted by TLehtinen at 8/28/2006 12:00:00 AM
Hello! I have performance problems with one of my tables and Do not know what to do to make it faster. Tabel is like this (table holds about 2 000 000 records): CREATE TABLE [dbo].[Sivunlataukset_kuukausittain] ( [id] [int] IDENTITY (1, 1) NOT FOR REPLICATION NOT NULL , [pvmaika] [datet...more >>


DevelopmentNow Blog