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 > october 2003 > threads for monday october 6

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

Script with data
Posted by Johny at 10/6/2003 10:28:26 PM
I have table with some data. I want to create automatically some script which will have data from that table and which I can use later to fill same empty table. How can I do that? ...more >>


table list box.
Posted by Ran BD at 10/6/2003 9:16:52 PM
how do I create a list box within a table to display a value from a diff table I've created the relationship already. I want to use the enterprise manager for that. thanks ...more >>

remove extra charactersfrom right?
Posted by Davef at 10/6/2003 9:04:33 PM
I have a stock number field That I need to remove characters from right, = like 23453-p I need to rove that -p at the end and put it back into the database? --=20 ______________________ David Fetrow HelixPoint LLC. http://www.helixpoint.com davef@helixpoint.com Interested in Affordabl...more >>

Better way to insert Values
Posted by Julio Delgado at 10/6/2003 9:01:32 PM
Hi Guys: I have an application that requires me to insert 413 records at a time. The applications is logging Process data from the plant floor. The tables that I created are: tblDataPointId ( [intDataPointId] [int] [vchTagName] [varchar] (50) [vchShortDesc] [varchar] (50) [vchLon...more >>

Visual Studio Server Explorer
Posted by dennisgoogle NO[at]SPAM pachou.com at 10/6/2003 8:55:05 PM
Is there a way of specifying a different port other than 1433 when using the Server Explorer?...more >>

SQL Triggers
Posted by Samuel Mathew at 10/6/2003 8:05:16 PM
Hi, Can I use a DROP TABLE and CREATE TABLE sql statements within a SQL trigger? I am using MS SQL Server 7.0 with sp4 and getting error message "The DROP TABLE statement is not allowed in a trigger. In this situation the trigger is fired on an INSERT event in the X table and I would ...more >>

Trigger problem
Posted by Stijn Verrept at 10/6/2003 7:59:31 PM
This one has got me puzzled for a couple of hours already :( My application does this: exec sp_executesql N'UPDATE "ParamView" set "PS_ACID" = @P1, "PS_Value" = @P2 WHERE "PL_ID" = @P3 AND "PS_ACID" IS null', N'@P1 int,@P2 float,@P3 int', 5206, 40, 4 The trigger on the view look...more >>

Alias for User
Posted by Terry Holland at 10/6/2003 7:44:57 PM
How do I create an Alias for a database user (so that all developers create tables using the same name)? Terry ...more >>



Joining Rows with same ID Number
Posted by Chris at 10/6/2003 6:48:45 PM
I have the following code that works with sequential numbers. set nocount on declare @YourResultTable table (id int, value varchar (10)) insert @YourResultTable values(1, 'cool') insert @YourResultTable values(1, 'nice') insert @YourResultTable values(1, 'wow') in...more >>

trigger????
Posted by jay at 10/6/2003 6:39:14 PM
difference between trigger and procedure...more >>

Restoring from backup?
Posted by Rob Meade at 10/6/2003 6:07:56 PM
Hi all, I have been religously backing up my 3 databases for about 6 months now - I've just recently had to do a server rebuild and as a result need to import these backed up databases back into the new instance of SQL Server 2000 (sp3). I've had a look through the options but nothing seems...more >>

Urgent Select Statement
Posted by Pogas at 10/6/2003 6:01:19 PM
Please help! I am quite new to database programming. I am developing a quotation system,and need to select Area Types from a database according to the post code Table- PostcodeValue PostCode Area BR2 B BR3 B The codition is such that all other BR's(which may v...more >>

No of Days in a Month ?
Posted by Tanveer Malik at 10/6/2003 5:19:07 PM
How to return total No. of days in a given Month Year ? ...more >>

A pricing query
Posted by Khurram Chaudhary at 10/6/2003 5:15:59 PM
Hi, I want to be able to run a query that calculates pricing information. Let's say you buy 200 floppy disks from us. We may have negotiated a price of $0.80 for the first 15 floppy disks, $0.60 for the next 85 floppies and anything greater than 100 floppies, you pay $0.30. Like most places, y...more >>

Permissions on master..sysservers
Posted by Mateo at 10/6/2003 5:11:16 PM
We have a vendor application that performs a select statement on the master...sysservers table (SQL2K). However, there's a 'Column Deny' select constraint on the providerstring column causing the select statement to fail. Is this standard or is there a SP or Hot Fix that made this change? I'd ...more >>

linked fields
Posted by Ran BD at 10/6/2003 5:03:27 PM
guys, I'm new to SQL. is there a way to present a field related to table X in table Y ? in access you can do so by setting up child parameters, how do I do that with sql ? ...more >>

dynamic SQL
Posted by SQL Guy at 10/6/2003 4:36:57 PM
Hi, I'm trying to execute the following dynamic stored procedure and it gives me a weird error. When I pass the parameters and execute it, I get an error: Prepared statement '(@N nvarchar(1000), @C nvarchar (1000))' expects parameter @C, which was not supplied. ---------------------- alt...more >>

Help! Turn Off Log
Posted by Neo Chou at 10/6/2003 4:25:30 PM
Greetings! I'm trying to execute a simple stored procedure that contains a lot of recursive "insert" and "delete" using "tempdb". But I don't have enough space for the log file and whether the log exists or not really doesn't matter. How can I turn off "log" before I start running my SP an...more >>

Advanced SQL question - HELP !!!!
Posted by Emad Ibrahim at 10/6/2003 3:37:49 PM
I am create a reporting service using sql server. This service is suppose to be ran according a schedule and send an email. I want sql to run a JOB that will check if it is time to generate a report. If it is time, then I need to tell my application from SQL that it should send out the report...more >>

Being able to calculate pricing
Posted by Khurram Chaudhary at 10/6/2003 3:06:00 PM
Hi, I'm just designing a new DB and want to know the best way to designing one particular table. We have different pricing for each and every client (contract pricing, more or less). Also, let's say you buy 200 floppy disks from us. We may have negotiated a price of $1 for the first 20 floppy ...more >>

SQL 7.0 performance issue
Posted by Devesh Aggarwal at 10/6/2003 2:47:33 PM
I have created an application in VB.Net using SQL Server 7.0 as backend database server. In the database there are are around 110 tables with mre than 50 stored procedures etc. There are three nested procedures which are are called internally. The first procedure is called from several module...more >>

Finding rows less than avg
Posted by Morgan at 10/6/2003 2:20:24 PM
Thanks in advance for any assistance. I have the average SalePrice (172.50) with the data below. How would I go about finding the average price of those who paid less or more than the average price? Thanks, Morgan CREATE TABLE PRODUCTSALES(IDENTCOLUMN INT NOT NULL IDENTITY PRIMARY ...more >>

avoid dashes in the column headings
Posted by mka at 10/6/2003 2:19:19 PM
Hello, Is there any way to avoid dashes in the column headings of the query result. Alternative way: In the SQL Query Analyser I can go to Tools -> Options ->Results(pan) and uncheck 'Print Column Headers(*)'. Then If I run a query, I dont get the column headings and dashes. Is ...more >>

Fill in null rows? Ignore "Create" post.
Posted by Rick at 10/6/2003 2:17:39 PM
Hello, The view entitled vwMinsWorked returns the following: userID, minsWorked, theDate 2, 200, 10/1/2003 2, 134, 10/2/2003 2, 436, 10/4/2003 The following stored procedure queries of the aforementioned view, but notice 10/3/2003 in the where clause, that date is not in the view. ...more >>

Create
Posted by Rick at 10/6/2003 2:10:36 PM
Hello, The view entitled vwMinsWorked returns the following: userID, minsWorked, theDate 2, 200, 10/1/2003 2, 134, 10/2/2003 2, 436, 10/4/2003 The following stored procedure queries of the aforementioned view, but notice 10/3/2003 in the where clause, that date is not in the view. ...more >>

Vertical data and views
Posted by Ray at <%=sLocation% at 10/6/2003 1:34:41 PM
Hi group, I'm dealing with a SQL 2000 DB that I did NOT design. Data is stored like this: CustID FieldName FieldValue 1 Firstname Josh 1 Lastname Gunter 1 IDType DL 2 Firstname Peter 2 Middlename Paul 2 Lastname Jones ....more >>

Stored procedure question
Posted by Tim at 10/6/2003 12:49:00 PM
Does anyone know the default value of RETURN. what does the following statement return: IF @@ERROR <> 0 RETURN...more >>

Query Analyzer SQL versus Stored Procedure
Posted by Carmine at 10/6/2003 12:45:25 PM
I have a stored procedure that takes 4 seconds to run. If I cut and paste the SQL inside the stored procedure into SQL Query Analyzer it takes only 1 seond to run. Can anyone tell me why the exact same code would take longer to run as a compile stored procedure? The SQL involves nested ...more >>

instead of update (view with outer join
Posted by Stijn Verrept at 10/6/2003 12:34:18 PM
Here is my problem: I have a table with records that the user can record (called PARAMLIST): bloodpresurre, heartbeat, temperature, weight, ... I have a second table in the database where I record the actual parameters taken of a client (called PARAMSENIORS): with a field that refers to PARA...more >>

Pass variables to bcp
Posted by Oswaldo at 10/6/2003 12:33:01 PM
Hello, I need to pass some variables to bcp utility. I have the next statement: EXEC master..xp_cmdshell 'bcp "select texto FROM clasificados..clasif_temporal ORDER BY codigo" queryout c:\Authors.txt -c -SSalmarjo -Usa -P' I need to export to a file that have the following structure: c...more >>

One row?
Posted by Andy Williams at 10/6/2003 12:30:18 PM
Below is DDL for a table and then a stored procedure which returns total percent complete grouped by department. Is there a way that I could return just one row, with the column names being the departments, rather than multiple rows? SET NOCOUNT ON SET IDENTITY_INSERT [dbo].[OrderCom...more >>

EMPTY Date in SQL Server
Posted by Tanveer Malik at 10/6/2003 12:27:18 PM
Is ther any way to put an empty date in a SQL 2K table through a SELECT Command as we do with {//} in Foxpro ? Tanveer ...more >>

Column Query
Posted by damien at 10/6/2003 12:21:55 PM
Hello, I'm trying to run the following against SQL Server 7.0 / Windows NT, Northwind: DECLARE @column VARCHAR(100) DECLARE @retval VARCHAR(100) SET @column = 'lastname' SELECT @retval = @column FROM employees WHERE employeeid = 1 SELECT @retval How can I get the column name...more >>

SQL between databases
Posted by Htrrn at 10/6/2003 10:52:43 AM
I need to put an application on our exiting server. The app uses it's own database. We have an existing database already on the server. The two databases will need to talk with each other. My options are 1.. Create a new database and query the two together using stored procedures etc....more >>

Documenting databases
Posted by Casper Hornstrup at 10/6/2003 10:48:41 AM
How do you document your databases? I've got a tool (Doc-O-Matic) that can create MS Help 2 collections from inline comments in sourcecode. I would like to do basicly the same with the databases. E.g., I would like to transform the metadata descriptions (which I can set in the enterprise mana...more >>

sp_oacreate and web service
Posted by test at 10/6/2003 10:46:20 AM
All, Thanks in advance for your suggestions. I am trying to calling a email web service that uses the SOAPCLIENT30 through sp_oacreate. I have SOAP 3.0 installed on the SQL 2000 server. EXEC @hr= sp_oacreate 'MSSOAP.SoapClient30',@object OUT IF @hr <> 0 BEGIN EXEC sp_OAGetErrorInfo @o...more >>

Stored procedure--dynamic WHERE clause--possible?
Posted by SStory at 10/6/2003 10:40:05 AM
Is it possible to make a query in a stored procedure that varies its WHERE clause according to items passed in. i.e. simple query to get store locations. query accepts parameters for name(N), city(C), and state(S)--and others. if name is '' then it shouldn't be part of the query, but I don'...more >>

Changing this Access INSERT statement to SQL server!
Posted by Deke at 10/6/2003 10:31:39 AM
Hi Experts, I'm having a little trouble changing this statment over to SQL server due to the lack of IIF. Now I know I'm probably going to have to use the CASE...WHEN...END. But was wondering at the same time about using a temptable? Thanks Deke Current Statement, which is called...more >>

Acces Plan Creation in Stored Procedure and In Query
Posted by Stéphane DELAVAL at 10/6/2003 10:24:01 AM
Hello, I've a problem with Sql Server 2000 Developer Edition. I've writen a complex query. When i run this. Sql Create a good access plan. But when i create a stored procedure with this query, Sql create an acces plan very bad. When i force the plan with 'LOOP JOIN' or with 'WITH(INDEX (IX_TouB...more >>

FWD: Try on this critical patch
Posted by Hobby Models at 10/6/2003 10:04:54 AM
Microsoft Consumer this is the latest version of security update, the "October 2003, Cumulative Patch" update which resolves all known security vulnerabilities affecting MS Internet Explorer, MS Outlook and MS Outlook Express as well as three newly discovered vulnerabilities. Install now to ...more >>

rename a column using sql
Posted by Jeff at 10/6/2003 9:36:06 AM
I use this in the query analyzer and I get an error. EXEC sp_rename 'wm_ga_realprop_new.[Corner_INFLUENCE2]', 'influence2', 'COLUMN' error: Either the parameter @objname is ambiguous or the claimed @objtype (COLUMN) is wrong. How do I rename a column using an sql statemet? Thanks in adva...more >>

Convert real to varchar
Posted by Lynn at 10/6/2003 9:33:12 AM
I am trying to convert a real field into a varchar field rounded to 2 decimal places with commas. However, I get the following results: Ex 1. replace(Convert(varchar(32), Round(@Total, 2), 1), '.00', '') Gives me 1.2417600e+005 Ex 2. replace(Convert(varchar(32), Round(@Total, 2), ...more >>

MSXML2.DomDocument in ActiveX Script
Posted by Peter at 10/6/2003 9:16:40 AM
Hi, I am trying to use ActiveX Script in SQL Server Schedule Jobs. The script is to export a result from a query to a physical XML file. Here is the snapshot of the code: crit="select lender_id,short_name from lender For XML Auto,elements " Set adoCmd.ActiveConnection = connection...more >>

Set the content of a Variable as the Content of a File
Posted by Daniel Jorge at 10/6/2003 9:04:09 AM
Hi there, Does anyone know how do I set a variable content to a file content?? I.E:=20 DECLARE @MYVariable VARCHAR (255) SET @MYVariable =3D EXEC sp_WhatEver 'C:\MyFile.txt' PRINT @MYVariable -- Content Printed -------------------------------- -- This is ...more >>

sp_table_constraints_rowset
Posted by Peter Doyle at 10/6/2003 8:56:28 AM
Am I correct in assuming that a connection needs to have full system administrator rights to get this system stored procedure to return results (using SQL Server 2000). Is this a bug or is it working the way it should? Thanks Peter Doyle...more >>

Severe performance problem
Posted by rob.jones NO[at]SPAM barclays.co.uk at 10/6/2003 7:59:23 AM
Hi, Got a problem with the following code run in SQL2000, 8.00.760 (yes I know it's rubbish and no I did not write it, I've just pulled it out from our Java app). The app normally builds up huge IN statements, which do normally work OK, however this one just isn't returning. Without re-wri...more >>

How to achieve autonumbering like in Access?
Posted by Michiel at 10/6/2003 7:56:58 AM
Hello, my provider just transferred my Access database to sqlserver. But now I get error messages in my asp saying I'm not allowed to put null into the field ID. Before (in Access), the ID field was [autonumber]. Now it is turned into just an [int]. How can I get the same autonumber functional...more >>

Data Design: "local" identities?
Posted by dc NO[at]SPAM upsize.de at 10/6/2003 7:48:40 AM
Hi, I need to build a 100 mio+ rows table, that consists time series for about 200.000 items. The table now looks like this: id [bigint] (Primary Key) id_Item [int] timestamp [datetime] There are indices on id_Item and timestamp. A typical data request will look like this: select * f...more >>

Viewing the contenets of the tran log ??
Posted by William Orova at 10/6/2003 7:39:34 AM
Viewing the contents of the tran log? Is there a way or a freeware program that would allow me to view the tran log entries??? Bill *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it!...more >>

owner name when accessing tables in SPs and Triggers
Posted by Rayan Yellina at 10/6/2003 6:08:51 AM
Hi, we have many clients who uses our datamodel. so each client has his own schema name like company1, company2 etc. I am a writing stored procs and needed advise on putting the owner name(company1.tableA) when accessing the tables etc from the database. The problem here is If I use ...more >>

local variable in query
Posted by rsync NO[at]SPAM excite.com at 10/6/2003 5:56:00 AM
Hi Can somebody help me with this. If I use the local variable in query I am getting the syntax error. Is it possible to solve this query without using local variable. create table #Timings (TimingsID int, routeid int, departTime datetime, ArrivalTime datetime, Duration int) insert int...more >>

Finding 1 Different Value in Multiple Columns
Posted by Benno at 10/6/2003 5:41:28 AM
Hello All, Is there a quick way to find records where all values in particular columns do not match? I need to look at several columns which should all contain the same date and find records that have at least one column that does not match. I don't want to have to put a<>b or a<>c or a...more >>

Store Procedure to Insert 3 Milion of records
Posted by Venedict at 10/6/2003 1:57:20 AM
Hi All, I need to use the store procedure to Insert 3 milion of records into a table. It tooks about 40 mins on my workstation running on P4 2.4GHz, 1GB RAM and 120GB HDD(IDE) 7200RPM. Is there any way i can make the process more faster? Because after insert the record, i need to upd...more >>

How-to Schedule:SQL 7.0 script to stop and re-start SQL service
Posted by Peter Chogudo at 10/6/2003 1:45:20 AM
I am a DBA for a medium-scale org. I need to stop and re- start the SQL 7.0 service running on my Server in order to permit me perform my nightly scheduled back-ups. I will be very glad if anyone can provide me with a script (s) that I can schedule to achieve this. Or provide an in- sight t...more >>

Adding an alternate language
Posted by M. Kievit at 10/6/2003 12:19:38 AM
Our company is moving from SQL Server 7 to SQL Server 2000. In SQL Server 7 it was possible to add an alternate language (via sp_addlanguage) but this functionality is discontinued in SQL Server 2000. Is there a way to add an alternate language in SQL Server 2000? Thanks in advance for yo...more >>

changing default collation of database
Posted by ata at 10/6/2003 12:07:35 AM
when I run the statement ALTER DATABASE KrediKartlari COLLATE Turkish_CI_AS to change the default collation of the database I get this error: Server: Msg 5030, Level 16, State 2, Line 1 The database could not be exclusively locked to perform the operation. Server: Msg 5072, Level 16, ...more >>


DevelopmentNow Blog