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 2005 > threads for tuesday february 8

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

Using Access as a frontend to a sql server 2000 DB
Posted by JD at 2/8/2005 10:45:16 PM
I am trying to set up Access as a frontend to a sql server 2000 database, what I have done is converted an access database to sql server, and I am trying to set up the front end so that the client can still update the database the way they use to do. However, I am running into a wee problem, ...more >>

trying to get a report aout of ths data
Posted by DaveF at 2/8/2005 10:15:46 PM
Out of the 3 tables below. I need to get a tabular report like this First Name Last Name Email = Can you receive HTML email Address = State Zip Tom Thompson...more >>

Concatenation of a number to a decimal column
Posted by Steve at 2/8/2005 9:02:39 PM
Hello Is it possible to concatenate a number to a decimal field? I want to concatenate the two digit system month to a decimal field (within a query) but am struggling. Thank you. ...more >>

Too Many Processes?
Posted by Jeff Haumesser at 2/8/2005 8:28:32 PM
Hi, I have a VB .NET Application accessing a SQL Server 2000. This application uses stored procedures extensively to access the data. My question concerns the processes on the server. I've been observing 15 - 30 sleeping processes running just after starting my application. Many of thes...more >>

100% CPU Util on Simple Update Query
Posted by Joel H at 2/8/2005 7:51:02 PM
We just moved a database from SQL7 to 2000.I ran sp_updatestats after updating. One table has about 4000 rows, a single column primary key of type t_Ticker which is char 10. A query wants to update several items in one row. A sample is UPDATE tblTable set CharColumn='12345'. Yet even that...more >>

Orphans
Posted by Steve Prescott at 2/8/2005 7:06:38 PM
Hi, In simple terms, in SQL2K, I have 2 header tables A and B and a junction table AB. All of keys are defined with the Cascade Delete constraint. Table A has a one-to-many relationship with table B. My problem is that if a row in table A is deleted, the rows that reference it in AB are delet...more >>

Paging with Stored Procedures
Posted by Star at 2/8/2005 6:55:01 PM
I have been browsing the newsgroups trying to find a good solution for this problem. I have a resultset and I need to show that information in pages. I also need to have this sorted by a specific column (Date for example) I found the following solution written by Don Arsenault that works v...more >>

VB Script from stored proc
Posted by Robert Richards via SQLMonster.com at 2/8/2005 6:45:10 PM
Is their a way to use vbscript code within a stored procedure? -- Message posted via http://www.sqlmonster.com...more >>



How do I call a stored procedure using perl DBI and evaluate the output
Posted by Evelyn Schwartz via SQLMonster.com at 2/8/2005 6:40:26 PM
I'm trying to run sp_dbcmptlevel @dbname='master' from within a perl script. What I've tried: my $sth=$oa->prepare(qq[sp_dbcmptlevel @dbname='master']); $sth->execute(); while (@row = $sth->fetchrow_array) { #do something; } $sth->finish(); my $output; my $sth=$oa->prepare(qq[? =...more >>

How to determine programatically what datafiles are associated with a database
Posted by Evelyn Schwartz via SQLMonster.com at 2/8/2005 6:34:26 PM
I'm writing a data collection script to gather database and data file information. This information will be used for reporting and analysis. I want to be able to tell what data files are associated with each of the databases. sysfiles doesn't include the database name and sysaltfiles doesn't ...more >>

xp_sendmail issue
Posted by DonBosco at 2/8/2005 6:09:22 PM
Hello, I have SQL 2000 with service pack 3a: When I use xp_sendmail with a file attached, it doesn't save to the specified file system folder, SQL 7 does. Here is the query: set quoted_identifier off Declare @StringMonth varchar(5) , @TableNm varchar(30) , @SQL varchar...more >>

Object reference not set to an instance of an object.
Posted by Nab at 2/8/2005 5:35:02 PM
Can someone please tell me why i get the above error when i run the is code designed for a web service. Connection is established at design time, eaConn, to sql server database whose table is called myParam: Imports System.Web.Services imports System.Data Imports System.Data.SqlClient Impo...more >>

xp_getfiledetails size value
Posted by Robert Richards via SQLMonster.com at 2/8/2005 5:16:36 PM
I am running xp_getfiledetails and am getting an unexpected return, and was hoping for an explanation. I run exec master..xp_getfiledetails 'e:\backups\cms user messaging\ CMSUserMessaging20050206.BAK' and the size returned is -1951854081 Bytes. When I navigate to the file itself the size i...more >>

insert into linked server
Posted by Jose at 2/8/2005 4:52:58 PM
Hi, As Aaron suggested I tried to use an insert into statement to update a table in a linked server, but when i do insert into SERVER2.database2.dbo.rtable select field1,field2 from localtable query analyzer says that the provider does not contain rtable... i can see the table in the ent...more >>

varchar and text
Posted by Agoston Bejo at 2/8/2005 4:48:46 PM
Hi! I know that varchar is only able to store string data up to 8000 bytes, whereas text up to 2 Gig or so. Somebody told me that you cannot search in text-type fields, i.e. you cannot use LIKE '%abc%' and things like that. I tried it (on SQL Server 7), inserted some short text, and LIKE worked...more >>

ADO error handling when connecting to SQL Server 2000
Posted by George Peshterski at 2/8/2005 4:34:08 PM
I use Delphi to connect to SQL Server 2000 using the ADO components. I'm executing stored procedure that makes some calls to another stored procs. In one of the sub called stored procs foreign key is violated and error message is generated ('INSERT statement conflicted with COLUMN FOREIGN KEY...more >>

IIF(ISNULL(dbo.SalesAnalyse.Verzenddatum), 'unknown', DATEPART(yyyy.SalesAnalyse.Verzenddatum))
Posted by Judith van der Niet at 2/8/2005 4:26:59 PM
Hello, I think i am missing something. This code give's an error.... Can someone tell me what it is?? IIF(ISNULL(dbo.SalesAnalyse.Verzenddatum), 'unknown', DATEPART(yyyy.SalesAnalyse.Verzenddatum)) tnx in advance.. eric ...more >>

3 tables query
Posted by Carlos at 2/8/2005 3:55:20 PM
I hable that has a ProOnwerID and ProFinOwner, when I create the following view I get NULL in my ProOwner and FinOwner.. If I delte de Fin Owner the ProOwer shows up.. Any Idea why ?.... is it because I have two ID for Clients en same table ? SELECT dbo.projects.*, dbo.employee.Em...more >>

sysprocesses and Visual Basic Program
Posted by E Sullivan at 2/8/2005 3:01:11 PM
Hi, I'm trying to get the nt_username from sysprocesses put in a table by a trigger. Unfortunately, when I call the stored proc to update the table (which fires the trigger), the nt_username is not being put in the sysprocesses table. I'm using the spid to get that record in sysprocesses. Is ...more >>

unique varchar index
Posted by Random at 2/8/2005 2:38:03 PM
I'm looking for a way to generate at least a seemingly random value that I can use for issuance of temporary passwords and passcodes (numbers and letters, not too long). I'd like to do this in the database instead of an outside algorithm. Any ideas? ...more >>

Saving EXEC Result to a Variable ?
Posted by Luqman at 2/8/2005 2:31:07 PM
How can I save the EXEC Result to a Variable. For example: declare @myString as varchar(50) declare @myValue as decimal(12,2) set @myString='Select ' + '10-5' EXEC (@myString) Print @myalue <--- Should print 5 ...more >>

How can I Add 02.45 hour to my Date
Posted by Murat BUDAK at 2/8/2005 2:15:10 PM
StartDate is actually 02:15 as datetime so why I cannot add 02:15hour to now. Set @StartDate = '1899-12-30 02:15:00.000' Select GetDate() now, GetDate() + @StartDate as added -- Result is 2005-02-08 14:11:07.860 ----- 2005-02-06 16:26:07.860 Thanks Murat BUDAK ...more >>

Stored Proc Issues
Posted by Justin at 2/8/2005 2:14:36 PM
I insert data into a temporary table, alter the table structure, then do an update. However when doing this in a stored proc, I get the error that the altered columns do not exist. If I run the stored proc section by section it works perfectly, however in its entirity it does not run?!?! any idea...more >>

Duplicate Values Problem
Posted by Raul at 2/8/2005 2:11:04 PM
I trying to insert values from a temporary table into a permanent table. The problem is the temporary table has duplicate UpdateTime values (issues with the database used to populate the temporary table) and the UpdateTime is a primary key in the permanent table. Is there a way I can remov...more >>

select top 10 from table ordered by date descending how to make faster?
Posted by Daniel at 2/8/2005 2:02:42 PM
i constantly select the top 10 rows of a table ordered by date descending order, is there any way to make this query faster? perhaps some kind of index that keeps the table stored in descending order by the date column? ...more >>

SELECT in WHERE clause
Posted by B.J. at 2/8/2005 1:47:06 PM
Hi, I need to do something like this : SELECT * INTO #ResultsDetails FROM M WHERE [ID], IDExtra IN (SELECT ID, IDExtra FROM #Results) i.e. in WHERE clause I need search for ID and IDExtra which are results from query : SELECT ID, IDExtra FROM #Results Thanks...more >>

Better way to build a stored proc for an INSERT...
Posted by Kevin NO[at]SPAM test.com at 2/8/2005 1:31:53 PM
I've built a stored procedure where I'm inserting a row into two tables. Both tables have a number of columns - and so I have to pass a rather larger number of parameters to the stored proc. Like follows INSERT INTO MyTable1 (MyCol1, MyCol2, ... MyCol25) VALUES (@cParm1, @cParm2, .... @...more >>

Databse Design problem
Posted by Cymryr at 2/8/2005 1:23:33 PM
Hello all, I have a database design problem I have a hierarchy that includes 5 levels and each level have a table EX : TABLE_L1 L1_ID INT AUTO L1_CODE nvarchar(50) L1_NAME nvarchar(255) TABLE_L2 L2_ID INT AUTO L1_ID INT L2_CODE nvarchar(50) L2_NAM...more >>

Index Tuning Wizard Problems
Posted by CB at 2/8/2005 1:18:02 PM
Hi I am having a problem using the index tuning wizard. I will capture an SQL Batch using Profiler (SQLProfilerTuning Template). I will then use the index tuning wizard on this, but it moans with the following error "The workload does not contain any events or queries that can be tuned agains...more >>

SUM and OUTER JOIN confusion
Posted by Jan Doggen at 2/8/2005 1:12:46 PM
Hello, I'm doing something wrong with SUM and OUTER JOINS. Table Hours contains Hours_Proj_ID : project ID Hours_Task_ID : task ID Hours_User_ID : user ID Hours_Minutes : time registration Table PTAllow tells me who can use which project/task (fields PT_Proj_ID, PT_Task_ID and PT...more >>

DTS Programming Question -- how to remove custom transformations
Posted by Andy S. at 2/8/2005 12:52:04 PM
In SQL Server Books Online, there is a great programming example where you can modify the properties of a data pump task to add new transformations. My question is how do you remove them when done? Those transformations stay saved so you cannot recreate them later. Here is the code I am usin...more >>

ARITHABORT error when update from asp page
Posted by VNN at 2/8/2005 12:51:54 PM
Hi all, I get the following error when I try to update the table from asp page: Error Type: Microsoft OLE DB Provider for SQL Server (0x80040E14) UPDATE failed because the following SET options have incorrect settings: 'ARITHABORT' I try the same update statement in query analyzer and it...more >>

uploading binary data to database
Posted by Richard at 2/8/2005 12:21:05 PM
Hi all, I have one question to upload data to the database. The way I use is the C++ extension for ADO. I create an interface class and bind the interface class with a CADORecordBinding class. And then I use this class to upload binary data to database. I compiled and run the application an...more >>

USE Command With Dynamic Database Names Fails to Change Database
Posted by Dale Jackson at 2/8/2005 11:37:02 AM
I am trying to create a new database using a variable name for the database name and then switch to the new database to create a set of tables, views and stored procedures. DECLARE @NewDB varchar(35),@SQLStr varchar(1000) SELECT @NewDB = 'MyDatabase' IF NOT EXISTS (SELECT Name FROM Mast...more >>

Multiple applications on 1 database - Namespacing ?
Posted by Beren at 2/8/2005 11:34:53 AM
Hello, I was wondering what would be the best practice to integrate multiple application-specific objects into one database. The most obvious way would be to prefix the object names for example App1_tblUsers and App2_tblUsers. Is there a better way to ultimately come to some kind of names...more >>

SQL queries getting stuck
Posted by X at 2/8/2005 11:32:57 AM
We have a SP that runs every night. It basically inserts, update data from various tables, has a bunch of SQL statements. The total records it is working with are between 6-7 million. But it randomly gets stuck at different places in the procedure. This is a random happening. Some days are good,...more >>

Cast & Convert
Posted by lp_rochon at 2/8/2005 11:05:08 AM
hi, how to cast or convert an nvarchar into a datetime ...' as in: (see WHEN 'datecreated' then Cast(d_date_created as datetime)) ----------------------------------- ALTER PROCEDURE [dbo].[SelectContactListTEST] @activeSearch bit, @activeSearch2 bit, @hiddenSearch bit, @or...more >>

Decision Statement
Posted by J. Joshi at 2/8/2005 10:41:46 AM
Hello all, I need to generate a result based on 2 fields: 1. RelationshipID & 2. MaritalStatusID The above fields are not embedded in the application as a mandatory check box so some of the values maybe empty. I need to get a list of all the members who have a RelationshipID = 2 a...more >>

how can i delete transaction log
Posted by Lal at 2/8/2005 10:12:54 AM
Hello, My Sql database server have 8 GB HDD I running a small application which is sql based. now my transaction log is more than 4 GB.data file is 55 MB only. is any possibilites to deleted old transaction logs from the transaction log file. due to this problem my server is very slow. plea...more >>

Does a trigger fire once for a set statement
Posted by Steve'o at 2/8/2005 10:05:04 AM
Does a trigger fire once for a set statement, or for every row affected? I presume that using a client like Access and doing a line by line manual adjustment, would fire a trigger for each transaction, but does a set statement (like below) fire the trigger once? eg Table_A (column_a, co...more >>

How can I tell if a file exists from within a SP?
Posted by Jorge Luzarraga Castro at 2/8/2005 9:59:29 AM
Hiya, I´m wondering how I could tell if a file exists before processing it with a bulk insert statement. TIA -- Jorge Luzarraga C Fidens S.A. 321 7610 Anx 23 "I can do it quick. I can do it cheap. I can do it well. Pick any two." ...more >>

select into and prefixes
Posted by Jose at 2/8/2005 9:53:12 AM
Hi, I'm trying to execute a select into and save the result in a database in a linked server. When i do: "select * into server2.database2.dbo.myselect from dbo.tdata" query analyzer always says that server2.database2.dbo.myselect has too many prefixes. Process has to be done in server1, what...more >>

Multiple count() from a single column
Posted by Fred Sawtelle at 2/8/2005 9:35:10 AM
I have a table, Message, which has an FK relationshp to the table UserCDV (on MessageID) and also an FK relationship to the table Document (on DocumentID). Doing a join on these tables associates a message (from Message) with a particular user (from UserCDV) and what type of document the mess...more >>

Freetext Search with Parameter
Posted by angela at 2/8/2005 9:13:45 AM
Hi All, I am trying to perform a simple search but not sure what the best way is to do it. In my stored procedure I have 3 parameters. 1. Newspapers (if param is 0 search all) 2. Companies (if param is 0 search all) 3. Keywords Is the only way to do these queries by using dynamic sql?...more >>

Web Based applications
Posted by Susan at 2/8/2005 9:10:27 AM
I have an access database in access2000. If they want to convert this to a webbased database - where do I begin to learn this process. Do I need to re-write the entire program? And where do I learn how to do this - where do I begin? Thanks...more >>

Dynamic Parameters S.P.
Posted by lp_rochon at 2/8/2005 7:43:15 AM
Using a Stored procedure, i want to sort my records according to a dynamic field... Could be sort by firstName, CompanyName, UserID... and so on... Receiving value in @orderingBy, but i can't seem to find a way to properly integrate it into my query, juse into the 'order by'.... If any could...more >>

Sort Order / Record Count
Posted by Mike Hoff at 2/8/2005 7:36:01 AM
Hello, I have a table like Name (varchar 50), IsCritical (bit), IsSerious (bit), ContactDate (datetime) I need to return a prioritized list of all names. First come all the records with IsCritical=1 in ContactDate order, then come the records with IsSerious=1 in ContactDate order then the ...more >>

Select 100 of type 1, if resultset < 100,select rest of type 2
Posted by Mike at 2/8/2005 7:25:06 AM
I want to query the dB for x number of people. To explain the problem better, let me assume x to be 100. I want to query the dB for 100 people of type 1, If I cannot get 100 then the rest should be of type 2 or type 3 or so on. How can I do that. query = select top 100 name,id,email from main...more >>

GRANT statements issue Sch-M locks....Why?
Posted by Fred at 2/8/2005 7:15:06 AM
We are experiencing blocking situations with a application that issues GRANT statements. It becomes blocked trying to take out a Sch-M lock while other long running report processes are holding Sch-S locks. I'm wondering: 1) Why is the non-DDL GRANT statement wanting to lock the schema? 2)...more >>

How to kill a process....
Posted by len at 2/8/2005 6:37:01 AM
Hi there. I've got a number of processes that are stuck on my server and are locking up a table or two and I'd like to kill them. Unfortunately, after trying to "Kill process" in SQL ENterprise manager, the processes involved are still there with the following details: Status: runnable...more >>

DateTime to Varchar
Posted by Peter Newman at 2/8/2005 6:15:03 AM
Im trying to convert a datetime value to a varchar Ive used cast( datetimevalue as varchar(10)) but am not geting the desired result. Im looking for a DD/MM/YYYY result...more >>

query is not quite right!
Posted by Robert at 2/8/2005 5:59:08 AM
Hi, I have a stored precedure which for some odd reason is not being consistant with the results. there are two main parts to the procedure, Firstly you find out the total number of payments made in a two year period. This puts the result in the temporary table URN_STEP05. This bit work...more >>

Copy current record (again)
Posted by Paul in Harrow at 2/8/2005 5:41:12 AM
Hi there, What I have is an appointments diary, what I want is to be able to move details from one record to another (when someone calls to move their appointment from one day & time to another). Tablename: AppDetails includes the following fields: Appdate smalldatetime (PK) Apptime varchar(...more >>

Function for counting distance
Posted by B.J. at 2/8/2005 5:39:02 AM
Hi, I want to create function which will return column of maximal distance. SELECT MaxDistance(X,Y) FROM Table; Is it possible ? (Something like MAX function but I will have two arguments in MaxDistance on which will be calculated distance e.g.: x-y). Thank you very much....more >>

New Cracked Software(cad,cae,cam,eda,pcb,gis,cfd,cnc...)
Posted by flex at 2/8/2005 5:35:28 AM
Hi! If you are professional ARHITECT, ENGINEER, DESIGNER, PROGRAMMER o User, and you can't buy expensive professional software - we will solve this problem. Our prices are very low. You pay only about 1%-15% of the price for the original software. Ou prices very from $20 to $150 per...more >>

refreshview removes user defined functions from sysdepends
Posted by bilbo.baggins NO[at]SPAM freesurf.ch at 2/8/2005 5:31:12 AM
When I create a procedure that references a user defined procedure it appears in sysdepends, but disapears after being refreshed. Is this expected and is there an alternative to sp_refreshview that correctly refreshes sysdepends -----------------------------------0--0--------------------------...more >>

Problem with Parallel Query Execution
Posted by Neil Ginsberg at 2/8/2005 4:55:24 AM
I have a SQL 7 db with a union query (view), and I'm getting the error, "The query processor could not start the necessary thread resources for parallel query execution." This union query has been in place for about two years now with no problems until just now, though I haven't changed anythi...more >>

TABLE-type User Defined Function Question
Posted by Damien at 2/8/2005 4:07:05 AM
I want to use a user-defined function to work with data in a field, but can't seem to be able to use it in the FROM clause. I've presented a simple dummy function (udf_initials) to demonstrate the point. Any ideas as to why this won't work, and what's the solution? The function returns ...more >>

migrating sql server 7.0 to sql server 2000
Posted by Piyush at 2/8/2005 3:17:06 AM
We need articles on moving database from sql server 7.0 to sql server 2000.... all the details Our database has got jobs also along with procedures, etc. Moreover, some custom settings or tables from master needs to be ported in sql server 2000 too. Please help! Thanking you, Piyush ...more >>

How to check for the password reset of SA
Posted by Sharad at 2/8/2005 2:21:50 AM
Dear Friends My password of the SA account is reset by some other admin and i want to check when the password was reset as this is a security breach. Can you please suggest how i can check the same. Best regards Sharad...more >>

SP & DTS
Posted by Peter Newman at 2/8/2005 2:09:02 AM
I have a simple DTS that sends a mail using XSMTP. what id like to do is get a stored proc to execute the DTS. The DTS has a few parametes i need to parm in like address varchar (60) , and QueryString varchar 4000 Can any one show me a simple example to fire this off...more >>

Free books and exam info
Posted by jeff at 2/8/2005 2:08:58 AM
Get free braindumps, real exam questions free books, notes and exam information for all certification exams. -- jeff ------------------------------------------------------------------------ Posted via http://www.codecomments.com ---------------------------------------------------------...more >>


DevelopmentNow Blog