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 > january 2004 > threads for wednesday january 21

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

Auto shrink?
Posted by Lasse Edsvik at 1/21/2004 11:34:10 PM
Hello when i rightclick db, choose properties and go to the options-tab. there are an "Auto shrink"-option there. what does it do? auto shrink logfile? /Lasse ...more >>


Get Databasesize?
Posted by Lasse Edsvik at 1/21/2004 11:30:10 PM
Hello I was wondering if there is a proc that returns db and/or log size? /Lasse ...more >>

Build proc
Posted by Kenneth at 1/21/2004 11:13:53 PM
Is there away to build a stored proc from tabel records If i have a table with records col0 col1 col2 1 ab df 2 cf fg I want to make a insert proc automatic with the values from the table insert into table (col0, col1, col2) values(1, 'ab', ...more >>

Date conversion (code help)
Posted by Edward at 1/21/2004 10:54:15 PM
All, I've the following problem. I converted data from an AS400 where the date field has the following format '1040121', where the one is just there for Y2K and then YYMMDD. I want to convert this to a date field by using a function, like datec(DateFld), which gives the following result DD/MM/...more >>

Sum a store procedure results?
Posted by phantasma NO[at]SPAM terra.com.br at 1/21/2004 10:43:44 PM
Hi, I have a store procedure whith result me a price passing a consumer id. exec ip_price 730 |price | ---------- |254,58 | and i have a table whith a list of consumers |id |name | ------------- |1 |Ted | |2 |Bruce | |3 |John | How to make a price sum from all...more >>

sysdtspackages DTS Packages
Posted by Greg O at 1/21/2004 10:22:22 PM
Hi, I am looking for any information on how to decode the packagedata column from the sysdtspackages table. I want to be able to add DTS documentation into AGS SQL Scribe Documentation Builder. So before I started I was wondering if anyone knows how to read the information from the binary...more >>

Intresting Query
Posted by KGRK at 1/21/2004 10:21:05 PM
LOGTABLE sessionid Userid Actionid DateTime Sample records Aab 1 1 20-jan-2004 11:00 Aac 1 1 20-jan-2004 11:10 Aad 2 1 20-jan-2004 11:15 Aab 1 2 20-jan-2004 11:20 Aac 1 2 20-jan-2004 11:25 Aad 2 2 20-jan-2004 11:30 Action Master ActionID ActionName Sample Records ...more >>

populating table2 from table1
Posted by biju george at 1/21/2004 10:06:37 PM
Hi Guys, I want to have a table that lists selected fields (with same data) from another table in a database. For example: table Tab1 ( Tab_id integer; Tab_name text; Tab_Remarks text; ); table Tab2 ( Tab_id integer; Tab_name text; ); Now I want ...more >>



DISTINCT question
Posted by Jon Spivey at 1/21/2004 9:56:53 PM
Hi, SQL Server 2000/ Windows Server 2003/ IIS6 I have 2 tables Titles ISBN Title BookPrice Results ISBN Price PercentSaving ResultDate I want to pull up the 3 books with the highest percentsaving in the last 24 hours. The closest I've got is this SELECT DISTINCT TOP 3 T.ISBN, ...more >>

Execution Plan Oddities
Posted by David Morgan at 1/21/2004 9:48:48 PM
Hello I am experiencing a problem with my ASP & SQL Server Application. Periodically the SQL Server stops accepting connections and this error is logged: Error: 17883, Severity: 1, State: 0 Process 58:0 (d44) UMS Context 0x3898ACD0 appears to be non-yielding on Scheduler 0 I was advised...more >>

Table Synchronization
Posted by subhash at 1/21/2004 8:46:05 PM
I need to synchronize a table in my local machine to a table in my production server through intranet, can anybody suggest a good method for doing this i need to transfer only changes to the local table after the last synchrnizatio subhash...more >>

Sp/trigger last changed date
Posted by Dolphin at 1/21/2004 8:30:35 PM
Is there any way getting sp/triggers last changed date? ...more >>

Access with SQL
Posted by Ernie Adsett at 1/21/2004 7:55:27 PM
We would like to have SQL connect with an Access database over a WAN. Is the best way to use MSDE and allow SQL to connect directly to the Access database or to convert this database every so often to SQL? Thanks! Ernie Adsett ...more >>

Network Question
Posted by Ernie Adsett at 1/21/2004 7:25:10 PM
We are developing with SQL 7 Developer Edition and planning to install MSDE with the VB application. We received the following question from the IT dept. of our client: "Does your version of SQLServer database work well across a frame relay wide area network?" Should there be any problem...more >>

ASP / SQL Query - Conditional SELECT Statement
Posted by Guy Hocking at 1/21/2004 6:01:57 PM
Hi there, I have a problem in my ASP/SQL Server application i am developing, i hope you guys can help. I have a ASP form with list boxes populated by SQL tables. When a user selects a value in a list box and submits the form the value is put into a session variable and the relevant page is ...more >>

again - datetime
Posted by Mike Schwarz at 1/21/2004 5:59:21 PM
sorry, again me its not 01.01.1899 its 30.12.1899..... so, i think i want to do the query against the datetimefield somehow like select * from calls where datepart(hh,calltime)+":"+datepart(mm,calltime) as calltime = '14:30' but how would it be a correct and fast query then? ...more >>

Max values and aggregates
Posted by David White at 1/21/2004 5:58:06 PM
Hello, I have following table structure (no ID's, not my doing) REGION PRODUCT AMOUNT HOLLAND MILK 7 HOLLAND BUTTER 2 HOLLAND EGGS 6 ENGLAND MILK ...more >>

which service pack
Posted by Paul S at 1/21/2004 5:04:19 PM
Is there a sp that returns the loaded service pack? ...more >>

SELECT @v = @v + column from table
Posted by Tiberius at 1/21/2004 4:56:59 PM
I have this query: declare @v varchar(200) set @v = '' select @v = @v + a_column from a_table It should concatenate the rows into one variable. It works well on all servers, but I have found a server on which @v has the value of the last row. For example: a_column AA ...more >>

What's wrong with this trigger?
Posted by Robert Taylor at 1/21/2004 4:43:47 PM
I'm trying to create an update trigger on a given field "systemid" that will automatically update another table in another db when the field is updated. But each time the trigger executes, it tells me I don't have a BEGIN TRANSACTION to match my ROLLBACK. What's wrong with how I've written thi...more >>

SP to Create View as any owner
Posted by Michael Tissington at 1/21/2004 4:27:56 PM
I'm having trouble with permissions. I'm trying to create a SP that any user can call to create a View and have the owner be dbo. When I try to execute the SP as a regular user I'm told that I don't have permissions to create objects owned by dbo. What minimum permissions do I need to set...more >>

whats wrong
Posted by Mike Schwarz at 1/21/2004 3:24:04 PM
hi i have the following query in a asp file (vb scripting) callTimeFrom = "cast('01.01.1900 13:30:00.000' as datetime)" callTimeTo = "cast('01.01.1900 14:00:00.000' as datetime)" SELECT convert(char(12),calldate,104) as calldate,convert(char(8),calltime,8) as callTime, destination,destin...more >>

Accessing Jet data using OPENROWSET on a remote sever
Posted by Mark Neilson at 1/21/2004 3:02:30 PM
Whenever I execute the following statement on a remote server (using osql): SELECT a.* FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0','\\sohadata2\apps\Corporate Databases\AMPU Databases\Sample.rsm';'admin';'',USER_TASK_INFO) AS a I get the error message: Server: Msg 7399, Level 16, State 1, L...more >>

When i will use SQL profiler/Trace
Posted by Paul at 1/21/2004 2:58:12 PM
Im new. Trace - Wat does it mean? Any 1 Please tell me about Profiles / Tracer in sql 2000. When it will be useful. For wat purpose they are using. Paul ...more >>

using CONTAINS with views
Posted by Roland Osterode at 1/21/2004 2:51:03 PM
hello i have to perform searches with the contains parameter not on a table but on a view. When i do this i get an error "no full text index available". can someone tell me how to use contains with views thanks ro ...more >>

slow data movement
Posted by Duncan Welch at 1/21/2004 2:51:03 PM
Hi, I'm using oSQL to run a stored proc that copies a subset of data from a table in one database, to a table in another by iterating through the initial recordset with a cursor, and performing some basic data checks and manipulation. I've run it on one machine, and it's doing roughly 1000 ...more >>

Truncate Function in Sql Server
Posted by Marco Roberto at 1/21/2004 2:21:33 PM
Hi, does anybody know how to build the truncate function (like Excel) in Transact Sql? I mean: Value = 10.545,25654 Precision = 2 Result = 10.545,25 Regards, Marco ...more >>

ORDINAL_POSITION skips a number
Posted by John at 1/21/2004 2:18:26 PM
When I run sp_columns on a table the ORDINAL_POSITION values are not contiguous. They are ordered correctly but some numbers are skipped. Is this normal? Does this happen when the structure of the table is changed at some point it's life-time? Thanks...more >>

executing a command
Posted by Bernie V at 1/21/2004 2:11:14 PM
Hi group, I want to excute an sql command and want the result of the query in a label. this is my command: SqlCommand oCmd = new SqlCommand("SELECT Question FROM Poll_Main WHERE StartDate <= { fn CURDATE() }) AND (EndDate >= { fn CURDATE() })",oCon); what do I have to do to have the resul...more >>

how to convert an integer field to "int identity not for replication not null"
Posted by Zeng at 1/21/2004 2:05:14 PM
Hello, How to convert an integer field to "int identity not for replication not null" w/o going through a temporary table? Thanks! ...more >>

How can i find 5th Highest Salary
Posted by Stephen at 1/21/2004 2:04:29 PM
Hi, Im new to SQL. Please let me know how can i get 5th Highest Salary for an employee = Table. Here is my table. CREATE TABLE [dbo].[Salary] ( [EmpID] [int] IDENTITY (1, 1) NOT NULL , [EmpName] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL , [Salary] [int] NULL=2...more >>

dropping all indexes in all user tables
Posted by Zeng at 1/21/2004 1:43:22 PM
Hello, Is there a quick way to drop all indexes in all user tables w/o knowing the names of the indexes? Thanks! ...more >>

Weird stored procedure problems
Posted by Konstantin Loguinov at 1/21/2004 1:11:19 PM
Ok, I've been battling this for a day now and it doesn't look like I'll be able to solve this without help. I'm using SQL Server 2000 with IIS 5.0. How come this stored procedure returns the result when I do response.write rs(0) in my asp page CREATE PROCEDURE dbo.Info_S_NewApps @EndDate ...more >>

Drop Trigger Syntax Error
Posted by Greg at 1/21/2004 1:08:47 PM
I received the following error when executing the following tsql statement with Query Analyzer. EXEC DROP TRIGGER 'tI_HGH_Log' Error: Incorrect syntax near the keyword 'drop' Please help me resolve this error. Thank You, Greg...more >>

How do I pass in comma-delimited value list to a stored procedure
Posted by Greg at 1/21/2004 12:17:15 PM
Hello, I have a stored procedure that accepts 1 parameter that I want to be able to hold multiple values that can then be processed in the WHERE clause using the IN operator (VALUE IN (@Param)) Does anybody know how this can be done? When I try it, SQL does what I'd expect it to do an...more >>

image type in select or view
Posted by tex at 1/21/2004 12:16:18 PM
Hi, I have tables with 10 000 000 rows and I use image type for data. When I select more then 10 000 rows (by index) I have the result after 10 minits. when I use the same select wihout image column select stop after 10 sec. When I connect 2 tables (create view by index) it is 40 minits. Does S...more >>

Length vs DATALENGTH
Posted by Nikhil at 1/21/2004 12:11:07 PM
Hi, Could any one please guide me as per wht is the difference between Len and DATALENGTH functions and what values they return in MS SQL 6.5 and in MS SQL 2000. Also are there any parameters(server level or database level or anything) that affect the behaviour of these functions in MS SQL 6.5 an...more >>

multiple rows in single cell / field of record
Posted by SeriousQuakeLoser at 1/21/2004 12:03:07 PM
multiple rows in single cell / field of record We are exporting data to text, however, there is a row delimeter within cell and it carries into the text. This of course is messing up the text file which needs to be tab delimited with one {cr}{LF} per record. Any ideas as to how to ident...more >>

Stored Procedure Arguments
Posted by Kevin Munro at 1/21/2004 11:59:14 AM
Hello, can you pass the result of a query into a stored procedure as an argument? e.g. exec usp_test (select top 1 ident from fred),0,(select top top 1 ident from john) instead of exec usp_test 100,0,200 I get a syntax error. Thanks, Kevin. ...more >>

File Link
Posted by Tony Schlak at 1/21/2004 11:19:31 AM
I would like to have SQL store file locations of pictures. This would allow me to link someones info to a picture of them w/out having SQL stor the pic. How do i do this? Thanks, Tony ...more >>

Custom sort order
Posted by Venkatesh at 1/21/2004 10:46:43 AM
I currently have a query that returns the following result: limit_amt -------------------- 10000 100000 5000 50000 Excluded N/A All values are of type varchar. Is there a way to make the Char values(Excluded and N/A) appear first ? ie. limit_amt ----------...more >>

Update Date Field
Posted by Han Nguyen at 1/21/2004 10:26:37 AM
Hi all, I have a date field which I want to extract the last 2 digit year, then check to see if the year is between 91 and 99 then add 19 infront of t - for instant, if the year is 95 then make it 1995 if the year is between 00 and 09 then add 20 infront of it - for instant, if the year ...more >>

SQL2000 Limitaions
Posted by Joe at 1/21/2004 10:09:13 AM
Is there a limitation to the number records in a table or view? I have a table in a 2.5 gig database that has almost 400,000 rows in it. And there is also a view that pulls every record in this table plus a few other columns from other tables. When I do a select from the view it runs and...more >>

Strange behaviour in SQL Server 2000?
Posted by Mark Baldwin at 1/21/2004 10:02:48 AM
I have the following TSQL in a stored procedure... SELECT @cmd= "CREATE UNIQUE CLUSTERED INDEX uqcidx_cuscode_code ON "+@pName+"(cuscode,code)" EXEC(@cmd) SELECT @error=@@ERROR When run, the CREATE INDEX statement fails with... "CREATE UNIQUE INDEX terminated because a duplicate key w...more >>

Form Record Source = sproc, how pass parameter
Posted by Steveo at 1/21/2004 9:56:11 AM
Hi, I had a form which had its record source set using the on open event in an Access Form to 'select * from MyView where Fielda = combo box on other form'. Fine, no problems, can edit data etc. But then I assigned a sub select: 'select * from MyView where fielda = combo AND fieldb in ...more >>

Returning results from day before
Posted by Brad M. at 1/21/2004 9:49:16 AM
Does anyone know how I can return a query result using the previous day as the where clause? For example, I want to generate a Work Schedule for today, but on a subreport I want to see all the jobs that were cancelled from the day before. Any takers??? Thanks, Brad ...more >>

Alias help ?
Posted by Matt Lemon at 1/21/2004 9:46:20 AM
Hi, I have a trigger as follows : UPDATE sql.legal.dbo.test_matter SET sql.legal.dbo.test_matter.mclosedt = inserted.mclosedt FROM inserted WHERE inserted.matter_id = sql.legal.dbo.test_matter.matter_id but when I try to run the script to create it I get the following message : Th...more >>

Changing PK
Posted by Brad M. at 1/21/2004 8:58:35 AM
Hello, Is it possible to change the Primary Key defined on a table that is used in merge replication? Any help/suggestions greatly appreciated! Best Regards, Brad ...more >>

Design Advice - (Pricing break table and query to retrieve value)
Posted by Molalla Attenborough at 1/21/2004 8:52:01 AM
Problem: Products that have price changes associated with volume purchases. I need to set up a table structure that allows me to easily do a lookup of the price for a specific quantity. For instance, ProductA may have the following prices and price break points: QTY PRICE 1 $10....more >>

Query help
Posted by Todd at 1/21/2004 8:48:06 AM
Hopefully, someone can help me with this query. Let's say I have a couple tables (tblProduct, tblConditions) that look like this: tblProduct ProductID Condition Location Quantity 1 New BLDG1 10 1 New BLDG2 1 1 Worn BLDG1 ...more >>

Returning format data separate in commas
Posted by Fernando M. Lopes at 1/21/2004 8:21:19 AM
Hello ALL, I have this problem. I need to SELECT ProductName FROM Products and format the return products names separate in commas. Anybody knows how can I do that? Thanks in advance. Fernando Lopes PS: Sorry my English ...more >>

Access to SQL server
Posted by tomtiv NO[at]SPAM rogers.com at 1/21/2004 8:11:37 AM
Hey All, I am trying to port an DB from MS Access to SQL Server, btu i am having trouble moving some of my queries over. Can anyone shed any light on this situation? The error is "Incorrect Syntax near the keyword 'inner', i'm pretty sure that the problem is the IIF statement, but i don't kn...more >>

Space in .paths of DMO backup
Posted by Bill at 1/21/2004 8:11:10 AM
I am using sql-dmo to backup a sql database. I'm trying to find how to deal with a path that includes a space. Everything works fine if the path does not have a space. In case you are not familiar with Distributed Management Objects (DMO) I have include a short example below. Please note the spa...more >>

Date conversion problem in SQL Server
Posted by Han Nguyen at 1/21/2004 8:07:08 AM
I have a Paradox table which has a date field with 2 digit year. I want to import this table into SQL Server and convert any year greater than 94 to 1994, 1995...; and any year smaller than 94 to 2000, 2001, 2002, 2003. I did try to change SQL Server 2 digit year setting to between 1994 and 20...more >>

Query
Posted by K-Lo at 1/21/2004 7:51:09 AM
Still trying to understand this...the DLL is below followed by 5 queries with notes next to them that tell what trouble I'm having with each query. Steve Kass has suggested the last solution as being the best for this problem. I don't understand the solution. An explanation or, preferably, a ref...more >>

IDENTITY_INSERT @Tablename OFF
Posted by kandebrinker NO[at]SPAM yahoo.com at 1/21/2004 7:24:10 AM
Hello I am trying to set the IDENTITY_INSERT @tablename of a table to on, run my insert statement and then set the IDENTITY_INSERT @tablename property to off. Here is what I have: set@tablename = 'some table' set IDENTITY_INSERT @tablename ON insert statement set IDENTITY_INSERT @ta...more >>

SQL Script to create and/or rollback db creation
Posted by Lisa Pearlson at 1/21/2004 6:05:24 AM
Hi, I have a simple SQL script that creates a database and some tables, and is called via ODBC from within my C++ application. That's also why return codes are SELECT '<message>'. The <dbname> is first replaced by the actual Database name, before this script is executed: If something goes ...more >>

Updating a table under certain condition only
Posted by Marie-Eve Racicot at 1/21/2004 5:51:09 AM
Hi, I have a script SQL in which I'm adding a column to a table and then populating that new column. My problem is that I want that part of the script to be executed only once. Therefore, Im' checking first if the column exist and if so, I assume that it is populated. For a reason I don't g...more >>

Views on another server
Posted by Sharad at 1/21/2004 3:30:00 AM
Dear Friends I have two server Company and BPO. The Company server is main server and the BPO server is server for the users who work on BPO. I do not want to give direct access to Company server for BPO users hence i have created the Database MainSQL in BPO server I want to create ...more >>

xp_readmail
Posted by subhash at 1/21/2004 12:46:07 AM
Hai, How can i read all the mails in my outlook 2000 inbox using xp_readmail. I am able to read only one mail. but when i am looping with xp_findnextmsg to read all the messages, the loop is not terminating and system is hanging my sample code is given below DECLARE @status2 int declare @st...more >>

USE with parameter in Stored Procedure without dynamic SQL?
Posted by Hartmut Schroth at 1/21/2004 12:40:58 AM
Hi, I haveto put the USE- Clause in a stored proc together with a parameter for the database. Problem: I have to put the USE clause in dynamic SQL (get an error, when I just write USE @DBName). But if I put the USE clause into EXEC('USE [' + @DBName + ']') it is of course not ef...more >>

Updating a table
Posted by gray at 1/21/2004 12:33:51 AM
I have a trigger on Insert that exec a sp_sendmail. When this sp_sendmail fails the values are not inserted into the table, can I enable it to put the data in the table even if the sp_sendmail fails??...more >>

exec a stored procedure
Posted by anonymous NO[at]SPAM discussions.microsoft.com at 1/21/2004 12:29:23 AM
I want to exec a stored procedure from a trigger that passes values to the stored procedure, how do I do this ? ...more >>


DevelopmentNow Blog