Groups | Blog | Home


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 > october 2006 > threads for tuesday october 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 31

ArrayList.Sort on UDTs
Posted by Andy in S. Jersey at 10/10/2006 11:27:01 PM
I have a UDT I created and would like ArrayList.Sort to work on an ArrayList that includes my UDT. I have implemented the IComparable interface, and have the code shown below in the UDT. public int CompareTo(object o) { if (!(o is IntervalUDT)) ...more >>


Optional Parameter in Stored Procedure
Posted by Manish Sukhija at 10/10/2006 10:46:02 PM
Hi Guys, How can i make optional parameter in my stored procedure, suppose i'm passong 5 parameter in my SP in which 2 could be blank/Space, so what should i do. Please snd me some example Thanks In advance ...more >>

Query by Percentage
Posted by Fred Chateau at 10/10/2006 10:00:52 PM
I have a table with 70,000 records that I need to split into two separate text files. Neither file can contain more than 50,000 records. The first part seems easy: SELECT Top(50) PERCENT ... How do I retrieve the bottom 50%? -- Regards, Fred Chateau fchateauAtComcastDotNet ...more >>

SELECT criteria on LEFT OUTER JOIN columns
Posted by Karch at 10/10/2006 9:58:35 PM
I have four tables: Company, Branch, Address, Contact. The following query works fine for retrieving my information: SELECT Branch.BranchID, Branch.CompanyID, Company.CompanyName, Company.IsListed, Address.AddressID, Contact.ContactID FROM tbl_Branch AS Branch INNER JOI...more >>

bug in exec sp_help_jobschedule?
Posted by Keith G Hicks at 10/10/2006 8:20:36 PM
When I create a job schedule and run this in QA: exec sp_help_jobschedule @job_id = '{36E92706-9701-45DF-B5FA-8162C5D3B36F}', @include_description = 1 I get a different description than if I look at the description in EM. Here's what I'm getting in QA: Every 11 months(s) on the third we...more >>

Create Assembly on Windows 2000
Posted by DennisEh at 10/10/2006 5:50:03 PM
When I run the following on a Win2K machine, I get errors as follows. If I run the same thing on Windows XP or Windows 2003, it works fine. What is going on, and how do I get around this? Thanks! EXEC dbo.sp_executesql @statement = N' CREATE FUNCTION [dbo].[MyFunc](@inputVar [n...more >>

SQLDMO SqlServer.Databases
Posted by Marius_C at 10/10/2006 5:26:41 PM
Hi, I am using the SQLDMO SQLServer.Databases.Item("db name") to access a database on a server in our company network. It takes over 2 minutes to get a response (too slow !!!); the server is a MSDE, and contains 20 databases in one instance. Thanks, Marius. ...more >>

Current connection user credentials
Posted by Pere Susial at 10/10/2006 5:09:47 PM
How can I know the current connection user credentials (SQL Server login name) from my stored procedure? ...more >>



Windows Service, MS SQL 2005 and late binding
Posted by Arjan at 10/10/2006 5:01:56 PM
Hello, I am trying to develop a Windows Service that is able to connect to a MS SQL Server 2005 database through late binding. However I am not able to find any information about this. I hope that someone around here can help me with this or at least point me to something useful. I am using...more >>

Conversion of text to int
Posted by Jack at 10/10/2006 4:27:02 PM
Hi, I got a table where few of the fields are text. I need to make those int. From Design View I am trying to do the conversion. However, I am getting the message: Conversion from text to int is not supported on the connected database. Does that mean that I cannot do this conversion. If not,...more >>

Problem creating recursive Stored Procedure
Posted by Chris Asaipillai at 10/10/2006 4:17:54 PM
I have a table called Dbo.Categories which contains information on content pages of a website. The key fields within this are Category_ID and is self related to itself via BaseCategory_ID as follows: Catergory_ID BaseCategory_ID Description 1229 0 ...more >>

While loop?
Posted by Dirk at 10/10/2006 4:14:02 PM
So I am just starting to learn how to use Database. I need the help of a SQL guru! I have these three tables: CREATE TABLE SB3_ScheduleChange ( emp_num EmpNumType:nvarchar(7) NOT NULL PRIMARY KEY, Monday char(35) NULL, Tuesday char(35) NULL, Wednesday char(35) NULL, Thursday ...more >>

How to write this query? - 2
Posted by modhak NO[at]SPAM gmail.com at 10/10/2006 4:09:44 PM
Hi All I have 2 tables. use MKumar_DB; CREATE TABLE dbo.tokens ( id int identity primary key, appid int, token varchar(60) ); insert into dbo.tokens(appid,token) values (1,'a'); insert into dbo.tokens(appid,token) values (1,'b'); insert into dbo.tokens(appid,token) values (1,'c'); ...more >>

2005; beginner: using triggers
Posted by RAM at 10/10/2006 3:40:03 PM
Hello, I have started learning SQL Server 2005. I have a question to experienced programmmers. In my database, I want to have such functionality: when some records in a table X are inserted/updateted/deleted I want to perform some modifications in a table Y. The modifications must be perform...more >>

INSERT INTO SELECT performance ???
Posted by brianpmccullough at 10/10/2006 3:33:01 PM
Hello, I am trying to copy about 300,000 rows of data from one table to another. I am currently using a simple INSERT INTO SELECT FROM statement. The target table already exists (so I cannot use SELECT INTO). I am seeing pretty poor performance during this copy (more than 3 minutes). Th...more >>

Replace negative sign with Alpha Character
Posted by Patrick at 10/10/2006 3:33:01 PM
I am currently creating a fix width export file to text. This file will be imported via an interface that requires negative signs to be dropped and replaced with an alpha character at the end of the string. The decimal point also needs to be removed, but I have completed that through a repla...more >>

AS400
Posted by Patrick at 10/10/2006 3:27:01 PM
I am creating a Fix Width export file to text, and this text file will be imported into another interface. This interface is AS400 and it requires that the negative sign be dropped and a alpha character will be placed at the end of the file. I must also remove the decimal point (I have a repl...more >>

Different result from Group By and Where
Posted by Vito Corleone at 10/10/2006 3:12:02 PM
Hi folks, 1. select A.employeeID, B.EmployeeName, C.DepartmentName, D.Paystatus from employee A, EmployDetails B, Department C where A.employeeID = B.EmployeeID and B.DepartmentID = C.DepartmentID and B.PayStatusDesc = D.PayStatusDesc and ...more >>

How to write this query?
Posted by modhak NO[at]SPAM gmail.com at 10/10/2006 1:45:30 PM
Hi All 9Sorry my original post did not show up, so I am reposting) I use SQL Server 2005. Table intent: For a given appid and testid there can be many tokens associated. I have a table like this CREATE TABLE dbo.run ( seqid int identity primary key, appid int, testid int, toke...more >>

SQL to create scritps for jobs?
Posted by Test Test at 10/10/2006 1:37:11 PM
Is that possible to write a SQL (or AtiveX) that script all the "enabled" sql server jobs in the db, store them in a file(s)? I like to set up an automated process to do this task and promote it to a different db server. Thanks for your help! *** Sent via Developersdex http://www.devel...more >>

Query Help
Posted by modhak NO[at]SPAM gmail.com at 10/10/2006 1:34:08 PM
Hi All I use SQL Server 2005. Table intent: For a given appid and testid there can be many tokens associated. I have a table like this CREATE TABLE dbo.run ( seqid int identity primary key, appid int, testid int, tokenid int ); I have a list of tokenid's (ex: 5,3,4 there can ...more >>

Defrag/Reindex Table
Posted by DBA at 10/10/2006 1:26:02 PM
Ok maybe I am asking too much. But is there a simple way to run a script that will defrag/reindex a whole table...more >>

Input parameters Case Sensitive
Posted by Mike Kansky at 10/10/2006 1:12:02 PM
I have a stored procedure: create proc GetData(@clientid int) as select * from clients where clientid=@ClientID go This generates an error that @ClientID is not declared. Why is T-SQL case sensitive? How to turn it off? How to make the compiler case incensitive? Thank you....more >>

Need help with a Query
Posted by Pat at 10/10/2006 12:41:43 PM
Hi Friends, SQL 2000 I need a help with a query. I have the table : invoiceid . invoicecode - invoicevalue - dinsert -------------------------------------------------------------------- 1 2 45 10/10/2006 14:31 2 2 ...more >>

case sensitive in stored procedure
Posted by Anthony Ricciardi at 10/10/2006 12:40:02 PM
I am running sql server express. The input parameters need to be the same case as when they are used in the procedure. I would like to turn this feature off. I know this is possible. Please help. :(...more >>

Send CR-LF via xp_sendmail to MS Outlook
Posted by alyciac NO[at]SPAM aol.com at 10/10/2006 12:17:23 PM
Hello! We have a stored procedure that sends people reminders via xp_sendmail for courses they have registered for. We select several columns out of the database (all are varchar, and are sized up to 1000 char). We are building the message body as: @msg = 'You are registered for ' + char(13) ...more >>

select query in stored proc
Posted by raju75 NO[at]SPAM gmail.com at 10/10/2006 11:46:46 AM
Hi All, I think what am trying to do is quite basic. I have 3 paramaters@value1, @value2,@value3 being passed into a stored proc and each of these parameters can be blank. If one of them is blank and the rest of them have some valid values, then I should just exclude the column check for th...more >>

ArrayList.Add
Posted by Andy in S. Jersey at 10/10/2006 11:04:02 AM
I am using ArrayList in the following fashion Collapsed.Add(IntervalArray1) Collapsed.Add(IntervalArray2) I get a jagged array as the result. Is there any easy way to just have the second set (IntervalArray2) simply added and not create another dimension. The way it is working is I ...more >>

Replacement for ISAPI in SQL Server 2005
Posted by herman404 at 10/10/2006 9:46:44 AM
Hi everyone, I have some code that we need to migrate to SQL Server 2005 from 2000, and I have a webpage that upon viewing, fires a query to the SQL server using ISS and ISAPI. The result set is formatted for display using XSLT. But since ISAPI is deprecated in SQL 2005, I was wondering how to m...more >>

disabling trigger in an update query
Posted by tin at 10/10/2006 9:10:02 AM
hi, i have a trigger defined on a table for update, insert and delete. is there a way to disable the trigger for a paritcular query temporarily just for that query?? or any thing to get around it? please advice. thanks!...more >>

SQL Query Analyzer ==> Results in Text
Posted by wnfisba at 10/10/2006 9:02:01 AM
I changed the Results in Grid to Results in Text and now whenever I get out of SQL Query Analyzer and get back in, it seems to be defaulting to Results in Text even if I change it to Results in Grid. How does this get changed??? Thanks in advance. wnfisba...more >>

Only use part of a where clause if value is null?
Posted by Assimalyst at 10/10/2006 9:00:23 AM
HI i am attempting to produce an sql stored procedure that will allow searching with a variety of parameters: @pkiBarcodeNumber int, @szFirstName varchar(24), @szSurname varchar(40), @szDateOfBirth varchar(8), @szPostcode varchar(8) AS SELECT pkiBarcodeNumber, szFirstName, szSurnam...more >>

Log Shipping Q
Posted by CLM at 10/10/2006 8:52:02 AM
I set up log shipping on some test databases in SS 2000 and it's worked great. I used the wizard to do the initial backup and set up of the standby databases on the secondary server. I did run into one problem, though: the Sql Server logins on the standby databases did not make it over su...more >>

Query with exec inside (not works).
Posted by Tomas Martinez at 10/10/2006 7:47:02 AM
Hi, I'm creating a query like this: set @query = 'SELECT DISTINCT TheID, TheName, TheType from TheTable WHERE TheCondition1 = TheCondition2 ' set @query = @query + ' and '''+@ComputerID+'''= exec sp_Computer myParameterComputerID' But it doesn't work, it seems like SQL cannot execute ...more >>

how to detect a read has been done on a row
Posted by benc at 10/10/2006 7:06:02 AM
I need to be able to detect that a row has been read so that a request to update the row is disallowed. Because of the complexity of the update, it is best to totally disallow update if someone is already viewing the data. To increment a counter when a read is done, and decrement it when the ...more >>

Super-Type / Sub-Type Table Inserts
Posted by Marek Sukiennik at 10/10/2006 6:55:02 AM
Sorry if this is trivial but ... If you have a source table A with 10 columns . you also have 3 target tables B, C & D with D being a subtype of C and C in turn being a sub-type of B then .. how would you write and insert statement to get the records from A into the correct places in B, C ...more >>

Joining on "between x and y"
Posted by Alain at 10/10/2006 6:53:51 AM
Hi, I have these tables: Sales (SaleId, ProductId, QTY) Bandwidth (ProductId, RangeFrom, RangeTo, Price) A RangeTo field is included in the Bandwidth table cause an "open end" is possible; 1-10, 11-20, 21> Now i would like to get a table like: SalesView(SaleId, ProductId, Qty, Price...more >>

VBScript to run a stored proc with ADO
Posted by MrBean at 10/10/2006 6:44:05 AM
Hello, I'm having an issue running a stored procedure in a vbscript using ADO .... I keep getting "operation is not allowed when the object is closed" on my first line of testing my connection. The sproc I'm trying to run can be found here: http://www.sqlservercentral.com/scripts/viewscript...more >>

find values in comma separated value
Posted by Ganesh at 10/10/2006 6:10:02 AM
Hi There, I try to find transact value in deletedlog like this select * from transact where cast(transact as varchar(20)) in (select DetailTableValue from deletedlog) In the deletedlog detailTableValue fields has following records 4703246,4703247 4526657,4526658,4526659 4536298 95861...more >>

Fallback value
Posted by Senna at 10/10/2006 6:05:02 AM
Hi Look at this sql (http://code.doria.se/code.aspx?c=e41e8421-0ec1-4226-bb0c-f34046d3516a), my question is in the comment. Thanks...more >>

sql statement Help
Posted by newshop NO[at]SPAM gmail.com at 10/10/2006 5:48:06 AM
let say I have following records in table called tblMessage: Name Id MsgType MsgId MsgStatus ====== === ========== ======== ============ John 100 Enquiry 1 New Andy 101 Complaint 2 New Simon 102 Enqu...more >>

Can I back up a remote db to a local drive?
Posted by cowznofsky at 10/10/2006 5:26:03 AM
When I go into the backup dialog, I can browse the server's file system for a place to put a backup file. Is there a way to backup a database to my local machine? ...more >>

Mixing numbers and letters in Check constraint
Posted by Kungen at 10/10/2006 2:51:45 AM
Hello! I'm having difficulties creating a certain Check Constraint. I want to be able to write in my column any number from '1' to '100' or the sign '?' or nothing at all (not NULL, but a value that consists of nothing written). Nothing needs to be calculated, the numbers are only characters he...more >>

uniqueidentifier as primary key
Posted by Michael C at 10/10/2006 12:00:00 AM
I've done some tests using a uniqueidentifier as a primary key. I created 3 tables (called A,B and C)with 1000, 100 thousand and 10 million records. The structure was pretty simple, table C had a foreign key pointing to B and B had a foreign key pointing to A. I did a select statement getting ...more >>

Problem with Select Another Data Using TOP()
Posted by sun919 via SQLMonster.com at 10/10/2006 12:00:00 AM
Hi there , I have a problem regarding using TOP() i am not sure which query to use .. I ve try IN, EXISTS and still give me error Basically I want to retrieve Data that is in ICD10 Table, but I query select top(5) from another table and using count()to sort the order and group. The query se...more >>

Q: SQL Statement...
Posted by Visual Systems AB (Martin Arvidsson) at 10/10/2006 12:00:00 AM
Hi! Got a question regarding updating a database table. This is the query i am using Update Customers set CustomerSetID = (Select xdb.CustomersSetID from xdb where xdb.id = Customers.ID) When executing the query, CustomerSetID is correctly uppdated if the record exists in the xdb ta...more >>

Unicode International language how are numbers stored
Posted by SJ at 10/10/2006 12:00:00 AM
Hi all, I have an english app that i am looking at using overseas. say, china, russia etc. If I understand correctly, if my varchar fields become Nvarchar then the foreign languages can use them. but now for numbers: However i am unsure of what happens in a foreign country if the user ...more >>

2005, beginner: my first trigger
Posted by RAM at 10/10/2006 12:00:00 AM
Hello. (Sorry for my English...) I have started learning SQL Server 2005. I created database for stock managament application. I have Documents with Positions, Materials in Groups; maximum stock levels are kept in GroupsInStocks table, and I have TotalQuantity of MaterialsInStocks. I would ...more >>

URGENT xp_cmsshell asp page and xml
Posted by tolgay at 10/10/2006 12:00:00 AM
Hi, I would like to call an asp page in sql ( probably with xp_cmshell) and read xml response ( from the asp page returns xml format) and update a table. Would you give an example for this. Thanks ...more >>


DevelopmentNow Blog