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 > september 2004

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

Stack out of space problem
Posted by Akash uday at 9/30/2004 11:54:36 PM
Dear Experts, I have posted this problem few minutes back i have added few more things in this so this is updated version of my last post so pls do not reffer my previous post. I am facing one problem on my client loactions Please advise me . At our client we have SQL 2000 and client app...more >>


Merge select result rows into two fieds
Posted by Serio_l at 9/30/2004 6:53:03 PM
Hi, I have a select that give me this result: EJ. SELECT Codigo + ' ' + 'CANT:' + ' ' + CAST(SUM(Quantity) AS VARCHAR)+ CHAR(9) + 'PEDIMENTO:' + ' ' + Pedimento + ' ' + 'FECHA:' + CAST((SELECT DAY(FIA)) AS VARCHAR) + '/' + CAST((SELECT MONTH(FIA)) AS VARCHAR) + '/' + CAST((SELECT YEAR(FI...more >>

Backup Error Message.....
Posted by Ankur Smith at 9/30/2004 5:45:00 PM
When I run my backup job I am getting the following error message. Executed as user: NT AUTHORITY\SYSTEM. sqlmaint.exe failed. [SQLSTATE 42000] (Error 22029). The step failed. I am running SQL Server 2000. Plase advice. Ankush ...more >>

Pregunta_sobre_envío_de_Mail_usando_CDOSYS
Posted by Luis Cejas at 9/30/2004 5:37:54 PM
Hola grupo, Tengo un SP en T-SQL que env=EDa Mail por medio de CDOSYS, ALTER PROCEDURE dbo.Send_Mail_Function--************* Create the = CDO.Message Object *******************EXEC @hr =3D sp_OACreate = 'CDO.Message', @iMsg OUT--***************Configuring the Message Object = **************...more >>

Pigeon Holes for plans
Posted by Bob Myles at 9/30/2004 5:37:05 PM
I posted this in ACCESS.Reports, but I think it belongs here: Using Access 2000 database project with Sql Server 2000 Back end. Issue: A drafting firm has 60 boxes divided into 36 - 2" squares - 6 across and 6 down for storing architectural / engineering plans. The Access Project tracks th...more >>

how to change dts owner name
Posted by JJ Wang at 9/30/2004 5:12:12 PM
hi, does anyone know how to change a dts packeage's owner name on sql 2000? we have individuals that creates dts packages on production servers, and we would like to change the dts owner name from the individual accounts into server's own account name. many thanks! JJ...more >>

Arithmetic overflow error converting expression to data type smalldatetim
Posted by Robert Taylor at 9/30/2004 5:01:13 PM
I am trying to import some data into a smalldatetime field type but receive the following error: Arithmetic overflow error converting expression to data type smalldatetime. It works fine if left as datetime, but smalldatetime causes the grief. Any suggestions as to how to find the offe...more >>

SQL and COM: Property returns Object Interface
Posted by Jeff Hedlund at 9/30/2004 4:57:34 PM
Hello, I am trying to use the sp_OAMethod on an ActiveX object property that returns an interface for an object. When I try to use a method on the object, I get the following "ODSOLE Extended Procedure" error: "The callee (server [not server application]) is not available and dis...more >>



xeon processor and sql server licensing
Posted by Martin at 9/30/2004 4:40:06 PM
Hi, I have noticed that my xion server is a hyper threaded server. Therefore in "Task manager" I see 2 CPU's when actually my server only has a single CPU. I think this is because the machine has registered two threads to handle the CPU. anyway, my question is does SQL server (if lic...more >>

Trapping errors ...
Posted by Bob Castleman at 9/30/2004 4:36:06 PM
I need to write a script that creates a bunch of indexes. Essentially it will do CREATE INDEX foo ON ... CREATE INDEX bar ON ... CREATE INDEX deedle ON ... CREATE INDEX dum ON .. until they are all created. The actual code used is not so linear, but it boils down to this. The probl...more >>

Compare Insert vs Update
Posted by Drew at 9/30/2004 4:06:09 PM
On compairing Insert vs Update, which statement causes more overhead to the DB. If i have a Table(col1 int primary key) And there are a million rows in it. Now if i do a insert and update which statement causes more overhead to the DB. ...more >>

DTS....
Posted by Justin Drennan at 9/30/2004 3:46:42 PM
I have a package....I right click, schedule it...and it fails - 'System cannot find file specified' Any ideas? ...more >>

order by
Posted by JT at 9/30/2004 3:14:29 PM
i read that using the order by clause in sql could cause a performance hit because order by uses the tempdb. is this accurate?? i have an asp/sql server system - would it be better to do my ordering on the asp side (recordset object) or within sql server using the order by clause?? any tho...more >>

How to reduce the size of SQL Server log file....
Posted by Ankur Smith at 9/30/2004 2:29:15 PM
How to shrink the size of log file in SQL Server (I am talking of SQL Server log and not the database log). Currently my backup is failing and not sure why it is failing. Since the SQL Server Log file size is very huge and not possible to see in the enterprise manager. Is there any way I can shr...more >>

GO vs semicolon
Posted by Simon at 9/30/2004 1:53:57 PM
I have a situation where I have some scripts that are loaded via a Visual BASIC exe that's written by a 3rd party. These scripts contain INSERTs, UPDATEs, etc I had initially separated each DDL statement with a GO but the performance was horrendous. I removed the GOs and the 3rd party sta...more >>

syntax, help!
Posted by treesy at 9/30/2004 1:43:26 PM
Hello,I have a table (T)like the following: I Syn 1 AB 2 BC 3 DB 4 ACD 5 DBC What I want to do is replacing A with 1, B with 2, C with 3, D with 4, so I wrote like this: SELECT i as 'index', 'trans'= case when patinde...more >>

Convert @@ERROR to fully qualified System Message?
Posted by FlashMerlot at 9/30/2004 1:41:03 PM
Using TSQL Declare @MyErrInt as int SELECT @MyErrInt = @@ERROR will capture the error number How do I convert the error number into the actual system error message for storage in a varchar ... WITH all proper % and * substutions having occurred? For example: Cannot update i...more >>

Info
Posted by Justin Drennan at 9/30/2004 1:23:38 PM
Is there a way to allow BCP to export to a file, and include the 'first row has column names' ? ...more >>

Return one row on a one to many join?
Posted by Carl Unternahrer at 9/30/2004 1:22:19 PM
First a disclamer that I didn't design these tables and I can not change them (3rd party). Second the table info. Parcel table has one record for each parcel. Address table has many records per parcel. Address table looks like... Parcel RecordNumber Type (Mailing/Deed/Contract) Address...more >>

sysdepends problem
Posted by Michael Culley at 9/30/2004 1:16:37 PM
I've got an addin that generates vb6 code to create or update an sqlserver database. It relies on the sysdepends table to determine the order in which everything should be created. I've found out that sysdepends is an incredibly unreliable beast. To get around that I recompile each view, stored ...more >>

nested stored procs
Posted by Richard Wilde at 9/30/2004 12:42:10 PM
I have a stored procedure A which performs a few inserts and outputs an select @@identity as id I have a stored procedure B which calls stores procedure A However I want to suppress the ouput of stored procedure A inside stored procedure B. I tried using set nocount on but this only ...more >>

triggers
Posted by seeker53 at 9/30/2004 12:30:22 PM
I need to check a date field for a consumer on insert and if it is the day is already entered for same consumer I need a alert to be given to the scheduler telling them that two appointments on the same day for a consumer is not allowed. This needs to be on a trigger after insert and also...more >>

Procedures - Cache it !!
Posted by Drew at 9/30/2004 12:17:46 PM
One of the main use of Stored Procedures is, it is a precompiled code which is stored in cache memory and as a result faster query execution. My question is suppose if i have (say) 100 Procedures, are all these stored procedures stored in Cache memory? Thanks ...more >>

Updating tables across databases using triggers...hangs server
Posted by Charlie at 9/30/2004 12:10:29 PM
Hi: In a trigger, I'm updating a table in another database. I reference the table using correct syntax, but it appears to hang server- any ideas? Thanks, Charlie ...more >>

Find last day of this month
Posted by Jaimee at 9/30/2004 12:09:56 PM
Given a certain date, how do I find the last date of that particular month? Also, is there a simpler way of getting the first day of the month besides this? select ltrim(datepart(mm,getdate()))+'/1/'+ltrim(datepart (yy,getdate())) Thanks so much!...more >>

How do I store these values
Posted by Aaron Prohaska at 9/30/2004 11:51:08 AM
I'm trying to store values like what I have listed below and am not sure what design I should use. I initial thought is to store then exactly as they are below by separating each value with some sort of delimiter, but I'm not sure if this is really best. RecordID SomeColumn 1 75 2 75/11...more >>

Row Number when Selecting Records in Select Query
Posted by SP at 9/30/2004 11:21:25 AM
Hi I encountered problem, i want to select records with its row number ( or serial no) but i don't know sql server provides it or not as in oracle rowid and rownum is available. is in sql such thing is available or not. Thanks in advance ...more >>

Row Number when Selecting Records in Select Query
Posted by SP at 9/30/2004 11:20:47 AM
Hi I encountered on problem, i want to select records with its row number ( or serial no) but i don't know sql server provides it or not as in oracle rowid and rownum is available. is in sql such thing is available or not. Thanks in advance ...more >>

Row Number when Selecting Records in Select Query
Posted by SP at 9/30/2004 11:16:59 AM
Hi I encountered on problem, i want to select records with its row number ( or serial no) but i don't know sql server provides it or not as in oracle rowid and rownum is available. is in sql such thing is available or not. Thanks in advance ...more >>

Why does EM script clustered indexes different ways?
Posted by Ian Boyd at 9/30/2004 11:09:07 AM
Here's a DDL snippet of two tables that need to be kept in sync. i.e. Training and Live Training: CREATE TABLE Variances ( SessionGUID uniqueidentifier NOT NULL ) CREATE UNIQUE CLUSTERED INDEX [IX_Variances_SessionGUID] ON [dbo].[Variances]([SessionGUID]) Live: CREATE TABLE Var...more >>

Using 'Use' in a stored procedure
Posted by musclpete at 9/30/2004 11:07:01 AM
We are using Great Plains to do our accounting. I'm creating a custom aging report and want to do the calculations as a stored proc. Every company is a separate database in SqlServer. Also, there are upgrade issues with GP involving custom stored proc's on that companies database so I'd like t...more >>

"Use" in a stored proc
Posted by musclpete at 9/30/2004 11:03:11 AM
We are using Great Plains to do our accounting. I'm creating a custom aging report and want to do the calculations as a stored proc. Every company is a separate database in SqlServer. Also, there are upgrade issues with GP involving custom stored proc's on that companies database so I'd like t...more >>

Storing documents
Posted by simon at 9/30/2004 11:02:30 AM
I have one question? I can't decide what is better way, to store the word documents(or some other) into the SQL database or store them on the hard disc? If user in my application use search option, it should be able to search for the specific word in the documents. I know, I can search for ...more >>

accessing a user defined function on a linked server
Posted by atila1502 NO[at]SPAM yahoo.com at 9/30/2004 11:00:00 AM
I found this article on Microsoft newsgroups today. I have a problem accessing a user defined function on a linked server. I can run a query like "select * from LinkedServerName.DBName.dbo.TableName" which returns result, but when I try to run "select LinkedServerName.DBName.dbo.FunctionNam...more >>

Replace Characters in a field named "Data"
Posted by kmotion at 9/30/2004 10:45:03 AM
I need to replace some underscores in descriptions with spaces, but am having issues because the field name is "data" and I am receiving errors. I cannot change the field name (this is a 3rd party product), so any suggestions on how to replace the underscores with spaces while working around ...more >>

Bulk insert into Customers table
Posted by Micromanaged at 9/30/2004 10:42:53 AM
Successfully ran DTS tool and imported spreadsheet of customers into SQL Server 2k database table called "sheet1$". Changed the type and length values of the columns on table "sheet1$" to match identical to type and length values of columns on table "customers". Executed the SQL Statement...more >>

Accessing UDF on a linked server
Posted by Janis at 9/30/2004 10:13:05 AM
Hi all, I have a problem accessing a user defined function on a linked server. I can run a query like "select * from LinkedServerName.DBName.dbo.TableName" which returns result, but when I try to run "select LinkedServerName.DBName.dbo.FunctionName(FieldNameOnLocalServer) from TableNameOnLo...more >>

Query with line number
Posted by Guy Colsoul at 9/30/2004 10:09:34 AM
I try to perform a single query in a single table (sqlserver 2000), but i need to know the line number. I've tried this, but it gives an error. Any idea ? Thanks in advance, Kind regards, Guy declare @i int select @i=isNull(@i,0)+1,c_nom from cli ...more >>

How do I get all identities from batch insert?
Posted by Andrew Jocelyn at 9/30/2004 10:09:02 AM
Hi How do I get a list of identities from a batch insert i.e. CREATE TABLE #maintable (ID int IDENTITY, Name) INSERT INTO #maintable (ID, Name) SELECT (Name) FROM #importtable 'Name' column may not be unique in the #maintable, there may already be entries so I only want the IDs creat...more >>

Transaction issue in table trigger.
Posted by Wade at 9/30/2004 9:52:19 AM
Hi, I am using MSSQL 2000 and table triggers to enforce business rules. I am having a strange error when the condition in the trigger is not met. I get the following error: The ROLLBACK TRANSACTION request has no corresponding BEGIN TRANSACTION. In my trigger, I execute the followin...more >>

update on issue
Posted by shaw at 9/30/2004 9:17:52 AM
when i use the following it adds records that only have the username and dbuserstamp filled in. So I think the issue is the "insert into" but I do not know what to change that to. CREATE TRIGGER [auditOn] ON [dbo].[tblEmployee] FOR UPDATE AS insert into tblEmployee (dbuserstamp, UserN...more >>

Insert Statement error
Posted by Lontae Jones at 9/30/2004 8:53:05 AM
String or binary data would be truncated. The statement has been terminated. How do I get this to run anyway around this. Insert Into Agent ([Agent], [AgentLoc], [AppointmentDate], [BusinessName], [BusinessPhone1], [BusinessPhone2], [BusinessType], [CommercialProp], [Co...more >>

Ignoring Messages
Posted by CMC at 9/30/2004 8:33:01 AM
I am using SQL Server 2000. I have a stored procedure that inserts data into a table. The table contains a unique index. Now the stored proc takes a comma delimited string of numbers and loops thru them to insert them into a table. I call this SP from VB 6.0. The string may contain values...more >>

suser_sname trigger (audit records)
Posted by shaw at 9/30/2004 8:28:23 AM
I am trying to add auditing to each table in the db. I would like to add the suser_sname and a date stamp to each record that is updated and/or inserted. My trigger is not working and it leaves the table uneditable. Any assistance as to where I am going wrong is appreciated. trigger 1 ...more >>

INTERSECT not supported on SQL Server???
Posted by Mark Harris at 9/30/2004 8:23:07 AM
Hi all I've only come accross this recently, but is it true that INTERSECT isn't supported in SQL Server? The Intersect function is doesn't seem to want to work with the 2 queries i'm trying to compare (if it is, indeed, even supposed to do this!) and i cant use techiniques using NOT IN or ...more >>

join using like returns no row (SQL Server 7)
Posted by AndrewG at 9/30/2004 8:15:04 AM
I have a query joining two tables: select a.* from a, b where a.col1 like b.col1 and b.col2 = 1 It returns nothing. If I remove the "and b.col2 = 1" then I get data returned. I cannot find any reference to this in docs or on web. Has anyone seen similar? Anyone have a workaround? ...more >>

Faking a full-text search
Posted by Scott Lyon at 9/30/2004 8:03:41 AM
I've been tasked with implementing a stored procedure that does a full-text search on a column called Part_Description. This column is user-entered, and as such there could be a BUNCH of different ways to represent the same thing. I need a stored procedure that will return a list of anything that...more >>

fetching entire row in cursor
Posted by tarek at 9/30/2004 7:33:06 AM
hello i need to fetch to cursor and return entire row to put it in variable not in multiple variable (like %rowtype in oracle) how can i do that in sql server thank you...more >>

How to check if triggers and constraints are enabled/disabled?
Posted by Esko at 9/30/2004 7:33:01 AM
Hello, I can disable and enable triggers and constraints with sql-statements shown below. ALTER TABLE mytable NOCHECK CONSTRAINT ALL ALTER TABLE mytable DISABLE TRIGGER ALL ALTER TABLE mytable CHECK CONSTRAINT ALL ALTER TABLE mytable ENABLE TRIGGER ALL How can I check if t...more >>

Run Query in a loop?
Posted by Yaheya Quazi at 9/30/2004 6:59:26 AM
Hi I have a table that has three columns in it. What I want to do is write a stored procedure that will read this table and plug in the column values from it to another update query where clause. For example Table 1 has White blue red yellow green black I want to write a query that...more >>


DevelopmentNow Blog