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 > january 2004 > threads for tuesday january 27

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

rounding floats
Posted by C. Bouquemann at 1/27/2004 11:51:04 PM
i have an interesting problem when i use an insert command in a stored procedure to insert data to a temp table, sql server rounds the value even it is not decimal for example, my procedure creates a value of 15499999998 into a variable called @ASum when i debug the procedure, the value does not...more >>


Order by conditional?
Posted by Duncan Welch at 1/27/2004 11:14:17 PM
Hi there, I've got a stored procedure that needs to order by a column that is passed to it. I also want it to order the data by parameter. Without dynamically building the SQL statement, is there any way to put a parameter in for the order by ASC/DESC? I need something like: SELECT * FRO...more >>

help! - MSDE Problem
Posted by Timothy V at 1/27/2004 11:04:21 PM
Hi, I'm an ASP.NET developer and i'm currently using MSDE2000. I'm working on a Win2003 OS and I'm having trouble accessing the sql server using "Integrated Security=SSPI;". It comes up with the error, "Login failed for user 'NT AUTHORITY\NETWORK SERVICE'.". My question is, what is the SQL co...more >>

Simple Set statement this is very simple question
Posted by CSharp ( ILM ) at 1/27/2004 9:57:08 PM
Hello, I have: Declare @ErrorHolder int Declare @Rowcount Set @ErrorHolder = @@Error set @Rowcount = @@rowcount Why do I get @Rowcount =1 here if I comment out 'Set @ErrorHolder = @@Error' then I get 0 ( zero ) What does Set @ErrorHolder = @@Error effect @@rowcount at all...more >>

Error in job?
Posted by \ at 1/27/2004 9:44:43 PM
Hi, Im running a DTS package that works nicely from design view, but when running as a job it fails for some reason (it fails right away, the same second as the job is launched)... This is the first task in the Job: '********************************************************************** ' V...more >>

Excel sheet to MS SQL table
Posted by Raanan Avidor at 1/27/2004 8:37:51 PM
Hi. I need to import a sheet from an Excel file into a table in a database in a MS SQL server. the text in some cells in the Excel sheet in broken into a few lines, when using the import data wizard the data is copied into the table, but the line break vanishes and words are stuck together,...more >>

Slow conversion between two databases
Posted by T. Wintershoven at 1/27/2004 8:19:07 PM
Hello all, I'm working on a small programm (VB) which converts data between two databases, both on a sql server. Everything works fine but it goes very..very slow I have to convert 9500 records and about 600 record are handled in one minute. This means it takes 16 minutes to convert all 9500...more >>

puzzling issue with inserted, updated and IF UPDATE(column) in an update trigger
Posted by Joe Clarke at 1/27/2004 7:26:51 PM
Here is my situation: I have a "master" table that has the following PK Visit decimal(5,2) Test integer I have a "detail" table with this PK Subject integer Visit decimal(5,2) Test integer I cannot have enforced referential integrity between these tables, but...more >>



Totals Grouped by Month with three tables in the mix!
Posted by Colin Basterfield at 1/27/2004 7:09:11 PM
Hi, I have a table called EXTRA_TYPE which has TYPE_ID DESCRIPTION column. There are four rows in there currently: 1|VIDEO, 2|PHOTO, 3|WALKWAY, 4|BOUTIQUE. I have a related table which is called EXTRA_PRICE, which sets up the prices for these types, this table has PRICE_ID TYPE_ID (...more >>

Cursor: Local or global?
Posted by Miroo_news at 1/27/2004 6:50:08 PM
I'm using fast forward cursors in my stored procs. They are used only by these stored procs, so I'd like to use local cursors. Do have they the same level of (in)efficiency as global ones? Maybe locale cursors are slower? I couldn't find any information about that. With global cursors it hap...more >>

Comma Separated list
Posted by Thomas at 1/27/2004 6:50:04 PM
Hi, I have a table Parties: ID Title Name 107202 President FRANCES FRALEY 107202 Vice President FRANCES FRALEY 107202 Treasurer FRANCES FRALEY 107202 Secretary FRANCES FRALEY 4 rows...more >>

Save change script
Posted by Alexander at 1/27/2004 6:41:43 PM
Using SQL Server Enterprise Manager I can change field type, press button Save change script and get script for change this column. My question is: HOW Enterprise Manager get this script ? Used DLL call / stored procedure or something else? Is any way to get the same script in my code (VB) ?...more >>

Help w/ SQL Statement
Posted by Greg at 1/27/2004 6:31:38 PM
I'm not sure if this is possible or not but I've been unsuccessful so far. I have a table with several thousand URLs along with their title. Some are from the same domain and others are not. What I would like to do is limit the query to returning a maximum of two from the same domain, instead o...more >>

Dates in SQL Server
Posted by Yannis Makarounis at 1/27/2004 5:58:25 PM
I run a query having a date constant in the Where part. The date is given in the form 'yyyy-mm-dd hh:nn:ss' which I believe is the correct way to pass dates irrespective of any regional settings. My problem is that in a certain SQL Server installation I get the message "[Microsoft][ODBC SQL Serve...more >>

Help Formating a date in sql
Posted by Paul Say at 1/27/2004 5:16:40 PM
How do I format a date in a query so that it will return in the following format ddmmyy eg 05/01/2004 as 050104 Thankyou Paul ...more >>

Install SQL 2000 Desktop Engine Problem
Posted by Derek at 1/27/2004 5:15:57 PM
Hi, When I install MS SQL 2000 Desktop Engine on a win2K computer, I got an error message: "The instance name specified is invalid." and then cannot proceed. Why ? Please advise how to solve the problem. Regards, Derek ...more >>

Encrypted Stored Procedures
Posted by ggeshev at 1/27/2004 5:14:59 PM
If a stored procedure or a trigger is created encrypted in the database, shall I expect slower execution when called? ...more >>

Test for linked server in T-SQL
Posted by Jon Gray at 1/27/2004 5:12:06 PM
I want to test for whether an Excel spreadsheet is already linked before I link it. The only proc I can find is sp_helpserver but I don't know how to retrieve the result set in T-SQL to check whether the server I'm looking for is in the list. How's it done?...more >>

invoking user-defined function
Posted by Alwin at 1/27/2004 5:11:06 PM
Hello When I try to invoke a udf function I get an error('fnX' is not a recognized function name). If I qualify with owner name, ie. dbo.fnX(), it works fine Is it necessary to qualify function names during invocation Thanks in advance Alwin S....more >>

Are '{' & '}' keywords in SQL?
Posted by Laser Lu at 1/27/2004 4:44:18 PM
I wonder if braces ('{' & '}') are preserved keywords in SQL? -- Best regards, Laser Lu ...more >>

why is EM's default column data type char(10)?
Posted by Bob at 1/27/2004 4:33:41 PM
Does everybody else use char a lot? I very seldom use char and would much prefer it to default to something else. Is there a setting I can change? Bob ...more >>

Parent Child Insert question...
Posted by Lesley Dean (CapeSoft) at 1/27/2004 4:20:34 PM
Hi all, I feel like an idiot asking this question, but what is the best way to ensure relational integrity when inserting into 2 tables (parent-child relationship) from a webpage. I am needing to do this for SQL Server 7 which does not support Scope_Identity(). How do I ensure that I can retri...more >>

REQ: Peer Review: Remove time part from datatime field UDF.
Posted by Rick at 1/27/2004 4:20:05 PM
IF EXISTS (SELECT * FROM sysobjects WHERE name = N'trimTime') DROP FUNCTION trimTime GO CREATE FUNCTION trimTime (@d DATETIME) RETURNS DATETIME AS BEGIN /* We could simply do this... SELECT @myDate = CAST(CONVERT(CHAR(10), @d, 102) AS DATETIME); However Tod H Sals sug...more >>

Is there Object-Oriented Database Management System?
Posted by Laser Lu at 1/27/2004 4:02:04 PM
Is there any Object-Oriented Database Management System available by now? -- Best regards, Laser Lu ...more >>

How to fight transactional log grows.
Posted by George Ter-Saakov at 1/27/2004 3:59:22 PM
I have a project which requires creating and deleting thousands of temporary records. For example deleting 600 thousand records take about a minute. It's ok but the biggest problem is that transaction log grows at unbelievable rate. I do not need those operations to be transactional. I can no...more >>

ADP + updatable view
Posted by Joachim at 1/27/2004 3:21:09 PM
HI: I have an updatable view in Enterprise Manager. I create a simple ADP project and the form based on the view is not updatable. Is asking for a unique table. No problem. Provided one in a rush. Now only those fields are updatable on the form. Any help. Moving from Access 2000 to SQL ...more >>

How do I pass a NULL using Query Analyzer
Posted by Top Gun at 1/27/2004 3:19:35 PM
I'm trying to execute a stored procedure in query analyzer and pass null values for some of the parameters. What is the syntax for this? ...more >>

Calculating the exact amount of months between two dates
Posted by Emmanuel Gravino at 1/27/2004 3:03:28 PM
Hi, I would like to calculate the exact amount of months between two dates. I know there is the DATEDIFF function, but this returns the number of month bundaries crossed from the start date to the end date. i.e. if i do DATEDIFF( m, '2003-11-29', '2003-12-01' ) it will return 1 month when i...more >>

SELCT query help
Posted by MM at 1/27/2004 2:29:55 PM
Could someone help me with a query? I have a table with the following fields: 1. Timestamp, datetime 2. ItemName, varchar 3. Value, float Where the primary key is Timestamp and ItemName. EX: 1/1/2004 12:00:00, 'ITEM_A', 10.0 1/1/2004 12:00:00, 'ITEM_B', 15.0 1/1/2004 12:00:20, 'ITEM...more >>

PPmt Function
Posted by marc at 1/27/2004 2:29:39 PM
Hi, In Visual Studio.NET there is a PPmt function in the VisualBasic Namespace I would like to use the PPmt function in SQL. Is this possible? Thanks! ...more >>

Query Help
Posted by Stephanie Neveu at 1/27/2004 1:45:22 PM
Does any one know how to write a query to get the following information: THANKS CAN I GET A COUNT ON THE CALENDAR. FOR INSTANCE IF THE EMPOYEE IS ON THEIR THIRD DAY OF BEING OFF IT WOULD SAY 3/6 AND THE NEXT DAY WOULD SAY 4/6. Thanks in advance for any help Stephanie ...more >>

Weird SQL Statement?
Posted by Jeffrey A. Voigt at 1/27/2004 1:24:37 PM
Has anyone seen the following statement used in a SQL query before? 0 IS NOT NULL ? It is being used like so SELECT Something FROM Table t WHERE 0 IS NOT NULL OR ( SELECT Something Else From Table t2 ...more >>

SQL SELECT Help for newbie
Posted by Heath at 1/27/2004 1:20:02 PM
Hi all, I have a table named ROUTE. In the table there are four columns: SNAME, TName, FOOTAGE & TYPE. TYPE is a text field and can have 1 to 13 different codes. What I have been tiring to do is sum everything in footage that = Sname, TNAME, and type. My problem is I need to find two differ...more >>

Email Processing
Posted by Paul at 1/27/2004 1:11:10 PM
Receiving an error message trying to process email in my InFolder. Using Outlook 2002 SQL 2000 SP3 [Microsoft][ODBC SQL Server Driver][SQL Server]xp_readmail: failed with mail error 0x8004010f Best I have found was this is suppose to be fixed with SP1 any ideas anyone? Here is the code: ...more >>

Update Triggers
Posted by khaled Eid at 1/27/2004 1:03:20 PM
Hi, I am useing SQL 2000 sp 3a. The below update trigger on a table do not fire when a record is updated. Any Clue [ CREATE TRIGGER Update_Trans ON [tbl_Transaction] FOR UPDATE AS declare @ID int select @ID =tr.AttendID from [tbl_Transaction] as tr DELETE FROM tbl_Attend WH...more >>

Put all triggers to sleep
Posted by Mike Kanski at 1/27/2004 12:54:39 PM
I need to write a procedure that will disable all the triggers in the database. And then i need to write another procedure to re-enable them all. Any suggestions? Thanks. ...more >>

SQL QUESTION
Posted by Paul at 1/27/2004 12:53:31 PM
I have a table TEMPTABLE (companynumber, seqnum, text) Contains COMPANYNUMBER SEQNUM TEXT NEWSEQNUM 1 10 HELLO 1 1 20 ...more >>

Help with joins
Posted by Joe Harmon at 1/27/2004 12:46:06 PM
I am pulling my hair out at what I consider to be a fairly simple problem. I have three tables. Leads, click_count and advertisers. I would like to query both the Leads table to figure out how many leads we have received by AID. The advertisers table contains the Description and AID. I would als...more >>

Data refresh
Posted by Mo at 1/27/2004 12:33:02 PM
Hi, I have a database with lots of foreign keys. I need to refresh data from production to our dev system. These are the steps i need to perform a) Truncate table b) Load data using a DTS package But when I try to truncate table, it complains about foreign keys. Delete is not an optio...more >>

Finding Integer Query
Posted by Ben at 1/27/2004 12:19:37 PM
I am looking for a way to pull out integers from my data. These integers contain 01 or 01 at the beginning of the intger and our 5 digits long. (i.e. 010999). What can I use to pull out the numbers with 01 and 02. Can I use LEN and assign length to a variable. Thanks, -ben m ...more >>

quotes on @query in stored procedure
Posted by kda at 1/27/2004 12:16:09 PM
I have now been working on this for about 1 hour, figuring out how to put the quotes in my stored procedure to create a sql statement to call xp_sendmail with. I think I have tried everything, but if any one has any other ideas please let me know!! The problem is with @CheckGroupQuery, every thin...more >>

Dynamic SQL
Posted by Mo at 1/27/2004 11:23:32 AM
Hi, I've a bunch of SQL stmts. declare @dbname char(12), @exchrate float, @sq_code char(3) I would like to dynamically generate and execute this sql stmt. /*update @dbname.dbo.curr set exchrate=@exchrate where code=@sq_code */ I tried EXEC ('UPDATE ' +@DbName+ '....more >>

Stored Proc Edit
Posted by Tunji at 1/27/2004 11:23:28 AM
Hello all: Is there a way to find out the last time a stored precedure gets editted? Just the way the "Create Date" shows up in Enterprise Manager. thanks for your anticipated response. Tunji ...more >>

Stored Proc edit!
Posted by Tunji at 1/27/2004 11:22:07 AM
Hello all: Is there a way to find out the last time a stored precedure gets editted? Just the way the "Create Date" shows up in Enterprise Manager. thanks for your anticipated response. Tunji ...more >>

How to handle NULL values in SP?
Posted by Bent S. Lund at 1/27/2004 11:16:13 AM
Hi, my procedure cannot return null values as the application retrieving the data will throw an exeption. I therefor use the IsNull-function, but it does not solve the problem completely - some values are returned as null regardless. When I debug the procedure - @BundleLength can be retur...more >>

VB (ADO) calling stored procedures in SQL server 2000
Posted by Bruce Gilbert at 1/27/2004 10:57:49 AM
dum = strSessionCustCode cn.Open "DSN=SECWAT;UID=sa;PWD=sa;DATABASE=Master;SERVER=sql2000" stemp = "EXEC Custbycode 'dum'" Customer.Open stemp, cn, adOpenDynamic, adLockPessimistic, adCmdText The above code tries to execute the stored procedure "Custbycode" and passes the arguement dum cont...more >>

Error W/ stored procedure
Posted by Aaron Barkel at 1/27/2004 10:56:31 AM
I am attempting to create a stored procedure with the following code: CREATE PROCEDURE "hvp_ValidateAcctID" @ID AS INTEGER AS If Exists(SELECT * FROM Acct WHERE Acct_ID = @ID) RETURN 1 Else RETURN 0 GO The net result is that I want to return a 1 if the acct_id exists, otherw...more >>

Maximum number of tables/joins in query
Posted by Nash Hoogawter at 1/27/2004 10:51:08 AM
Hi all, What are the limitations for the number of joins or tables in a SELECT query in SQL Server 7 and 2000. Thanks in advance. Cheers, Nash Hoogwater ...more >>

Data in image columns truncated to 64kB when used DMO Bulkcopy
Posted by Christian Stein at 1/27/2004 10:45:12 AM
Hi, I use the exportdata method under the DMO: Dim oServer As SQLDMO.SQLServerClass Dim oDatabase As SQLDMO._Database Dim oBCP As SQLDMO.BulkCopyClass oServer = New SQLDMO.SQLServerClass() oBCP = New SQLDMO.BulkCopyClass() oServer.EnableBcp = True oServer.LoginSecure = True oServer.Conn...more >>

Server no longer accessible
Posted by amil at 1/27/2004 10:11:49 AM
Hi all, I am running SQL Server 2K Personal Ed on a Win2K pro. I also have the Novell client on my machine. My machine is also a member of a Windows Domain. I use the Windows Domain user profile and Novell user profile to access my machine. My local instance of the SQL Server is started us...more >>

Date function?!?
Posted by JMNUSS at 1/27/2004 10:07:46 AM
SS 7.0 Is there a "Date" function that will enable me to return every our of the day (i.e 00:00:00 01:00:00 02:00:00....) without having to create a temp table to store all 24 values? TIA, Jordan ...more >>

own AutoNumber table and autonumber SP skipping numbers
Posted by Charlie Grosvenor at 1/27/2004 9:56:06 AM
H I have implemented my own autonumber system, as for various reasons an sql server identity field is not appropriate. I have been testing this by having 5 connections to the sql server just calling the SP and generating numbers and inserting them into a table. It seems that every 10000 records...more >>

Scripting ALTER TABLE and ALTER SP in EM?
Posted by Lars Grøtteland at 1/27/2004 9:54:31 AM
Good day! I have several databases in one SQL Server, and having problem maintaining these - so that they are equal. Not the data, but the tables, views and SP. Are there any way in SQL Enterprize manager or any other programs that is generating a sql script based on alter table, and alter v...more >>

Obtaining Orignal SQL statement inside of trigger
Posted by Robert Taylor at 1/27/2004 9:53:03 AM
I need to debug a closed app and obtain the sql code this app uses to access my database. In the past I have written triggers to raise errors with key values that I knew would be in the inserted record to help give me more information. But this is limited at best. Is there a way to see the e...more >>

This Recordset is not updateable....ggrrrrrrr....
Posted by Steveo at 1/27/2004 9:27:22 AM
SQL Server 2000 SP3 (Windows 2000 SP4 + MDAC 2.8) Access 2000 SP3 (Windows 2000 SP4 + MDAC 2.8) Help! I have a Form within an Access Data Project, with a sproc as its record source. The form has the unique table property set to a sql server table which I would like to update, ALL tables ...more >>

Unknown error: 8007007F
Posted by After Hours at 1/27/2004 9:15:12 AM
When I try to access any table on any server using Enterprise Manager I get this message. Unknown error: 8007007F This is all of a sudden. My Server is running but I cannot access any data? Please can Someone Help. ...more >>

=NULL / IS NULL
Posted by Scott Rymer at 1/27/2004 9:01:24 AM
I have a table that has a nullable column which gets used a lot in my program. I am finding myself using an aweful lot of "IF @Variable IS NULL .... ELSE ..." syntax in my stored procedures, triggers, etc. Is there a way around having to use this syntax every time I need to do a "WHERE Variabl...more >>

DB Library Error
Posted by C.Dimitrov at 1/27/2004 9:01:09 AM
Hi Code was working fine on diefferent machines, but suddenly on one of the machines from time to time it gives this erro 01/27/04 03:58:40 DB-LIBRARY error Attempt to initiate a new SQL Server operation with results pending 01/27/04 03:58:40 DB-LIBRARY error Attempt to bind to a non-existe...more >>

Truncation of the email subject line
Posted by Carrol at 1/27/2004 8:46:09 AM
Hi! I need urgent HELP I have successfully set up my SQL Mail to send auto emails. The problem now is, the message in my subject line gets truncated. Is there anyway I can resolve this. Appreciate any help Thanks Carro ...more >>

fully qualified table names for select statment?
Posted by Adria at 1/27/2004 8:36:20 AM
This is probably a very simple question, but I will ask anyway ... Why is it necessary to have a fully qualified table name in a select statement issued by a login ID that doesn't own the table? For example, I have a database (sampledb01) with a table named customers. The table was cr...more >>

Insert Query
Posted by Nick at 1/27/2004 5:52:05 AM
Hi, How can I write a query for following problem. I have a table Inventaris with Year, ProductId and Number Another Table Product with ProductId,Name,..... I want to fill Table Inventaris with all the records from Products and Inventaris.Year = 2003 (I do it in access) Insert INTO I...more >>

Date Time format to Date format
Posted by skchbs NO[at]SPAM yahoo.com at 1/27/2004 5:46:12 AM
Hi All, I havea field logtime with datetime datatype. I would like to remove the time part and then group by date, however whether i remove the time part or not, i get the same results. I m givng the code below to convert the date, can anyone plz help? many thanks select convert(datetime,Conver...more >>

Setting default value of field...having problems
Posted by Joey Martin at 1/27/2004 5:02:38 AM
I need to set the default value of a field. Pretty simple task. But there is quite a bit of text to use. Doing this in Enterprise Manager is only allowing me to enter some text. Is there a query that will allow me to update the default value of a field? My field type is TEXT so I know I h...more >>

SELECT * not returning any rows, but SELECT COL_NAME does!
Posted by rowlandhills NO[at]SPAM hotmail.com at 1/27/2004 3:01:15 AM
I have a table which is returning inconsistent results when I query it! In query analyzer: If I do "SELECT * FROM TABLE_NAME" I get no rows returned. If I do "SELECT COL1, COL2 FROM TABLE_NAME" I get 4 rows returned. In Enterprise manager: If I do "return all rows" I get 4 rows retur...more >>

Joining tables from different databases
Posted by Paul Falla at 1/27/2004 2:47:30 AM
As the subject says, we are looking to join two tables from different databases. We have two different databases which reside on the same server. In databse 1 we have a number of tables which are used solely as lookup tables. Database 2 has recently been created, and we would like to use ...more >>

UPDATE Statement
Posted by Manoj at 1/27/2004 1:41:48 AM
Which statement will be more optimized, and will utilize minimum servers resources IF EXISTS(SELECT * FROM ABC where some condition) UPDATE ABC ......where some condition ELSE INSERT INTO ABC OR UPDATE ABC.....where some condition IF @ROWCOUNT = 0 INSERT INTO ABC ........more >>

Import from Execl file
Posted by Jonathan Blitz at 1/27/2004 1:15:39 AM
I run the command: SELECT * FROM openrowset ('Microsoft.Jet.OLEDB.4.0','Excel 8.0;Database=C:\commission manager phase ii data\dealer data.xls',[ticking$])Rowset_3 where (0=1) What I need to know is where it looks for the file? Does it look on the local computer or on the server? When I...more >>


DevelopmentNow Blog