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 > august 2003 > threads for wednesday august 20

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

execute command to express rule
Posted by yskwon at 8/20/2003 11:08:41 PM
Hi All. I find sql command. example, javascript eval('1+2+3') the same function from Ms-sql Thanks for any help ...more >>


result of that procedure will be different from 1?
Posted by Frank Dulk at 8/20/2003 11:06:52 PM
When is it that the result of that procedure will be different from 1? ...more >>

Trying to test if Now is between to smalldatetime fields?
Posted by jack at 8/20/2003 10:53:23 PM
Hello, I have a TimeBegin and TimeEnd and want to be able to select a table that Now() is between the two dates (in Smalldatetime). Thanks, Jack ...more >>

connect problem
Posted by bharath at 8/20/2003 9:55:22 PM
Hi all, I am getting the below error - when i connect to sql over a c++ program. SERVER: FATAL CONNECT ERROR: E rrorNum = -1073724002, Severity = 16, State = 2: Could not load ListenOn Net-Lib rary 'SSMSSH70' ERVER: FATAL CONNECT ERROR: E rrorNum = -1073724002, Severity = 16, State ...more >>

blob data type
Posted by andrew NO[at]SPAM balazboxing.com at 8/20/2003 9:52:23 PM
I have managed to get an attached file from Outlook into a SQL2K table. I want to be able to use it as an OLE-type file. I would like it to have an icon and be double-clickable in a form. The file type is a .fax (a tif). Is this possible using the FileToBlob or any other method? Thank you...more >>

Using Trigger to populate another table
Posted by jungewum NO[at]SPAM yahoo.com.au at 8/20/2003 9:51:51 PM
Hi all, I have two tables tbl_A and tbl_B. Table Definitions: tbl_A (field_1, field_2, field_3) tbl_B (field_1, field_2) I would like to populate tbl_B when a record is inserted into tbl_A. Note that tbl_A.field_1 = tbl_B.field_1 and tbl_A.field_2 = tbl_B.field_2 . How do I write a trigge...more >>

Final request for help!
Posted by Karen Caldow at 8/20/2003 8:29:39 PM
Dear All, I have simply had enough! Can anyone help? I have posted a similar question about 3 times (not that I am criticising the site) but the solutions have never worked properly. It is my lack of understanding that is the problem. I am trying to send the data from a POST form to a stored...more >>

SQL cursor and ado recordset
Posted by Barak Reeves at 8/20/2003 7:20:14 PM
Hi All! I seem to have a problem returning resultset from a sproc to an ado recordset. The error I get is that the recordset is closed and thus I cannot request a field value. What am I missing? The sproc is debugged and my connection is working. 'SPROC code CREATE PROCEDURE dbo.sp_mets_...more >>



How to use a variable in my SQL code?
Posted by Greg_Del_Pilar at 8/20/2003 7:01:22 PM
Hi! I want to be able to do the following in my stored procedure: declare @v_tablename varchar(30) set @v_tablename = 'dbo.[MyTable]' select * form @v_tablename Is it possible to do this inside SQL Query Analyzer? Thanks for your input. Greg ...more >>

Populating a 'long' table.
Posted by Steve at 8/20/2003 6:46:14 PM
Hi All, I have the following table: CREATE TABLE [dbo].[tblLongVolatility_ME] ( [ID] [int] NOT NULL , [GIF] [varchar] (3) COLLATE Latin1_General_CI_AS NULL , [DateID] [int] NULL , [Identifier] [varchar] (50) COLLATE Latin1_General_CI_AS NULL , [Pivot] [varchar] (50) COLLATE Latin1_Ge...more >>

Possible to access SQL data via NON SQL methods
Posted by ray NO[at]SPAM rays-web.com at 8/20/2003 6:14:02 PM
Hi, Is it at all possible to access MS SQL data via NON SQL (the query language) methods? I.e. is it possible to get access to low level indexes (b-tree??) and add / delete methods? Basically I don't think I can ... but what I'm hoping for is a means of emulating COBOL file handling ...more >>

how to get the number of users signed up on each day for the current month?
Posted by John Davis at 8/20/2003 6:00:34 PM
I have a table with shows an user's name, and sign up data and time. What is the SQL query that shows the number of users that signed up on each day for the current month?? Thanks, John ...more >>

Server: Msg 8525, ...Distributed transaction...
Posted by Art Corum at 8/20/2003 5:36:55 PM
I have a trigger that updates some remote servers via dynamic sql (sp_executesql) and linked servers. I get the following error: Server: Msg 8525, Level 16, State 1, Line 3 Distributed transaction completed. Either enlist this session in a new transaction or the NULL transaction. [OLE/DB ...more >>

how to get the error message in a stored proc
Posted by Helmut Wöss at 8/20/2003 5:33:16 PM
Hi, have a stored proc where i check @@error for some actions. Now when something goes wrong i want to write this in a log. So how can i get the full error message which is shown for example in the query analyzer under "messages" ? thanks, Helmut ...more >>

unicode to dbcs
Posted by bharath at 8/20/2003 4:59:52 PM
Hi, How do I convert unicode to dbcs characters in sqlserver? Please help as this is needed urgently....more >>

Big HAIRY emergency
Posted by Bob Castleman at 8/20/2003 4:28:47 PM
Should be very easy to fix, but I can't remember how to do it. A customer on MSDE has hit the 2 gig limit on thier database size but the database has 1.5+ gigs of unused space in it. I can't for the life of me remember how to get it to release the usused space. Ahhhhh! Bob Castleman Succ...more >>

Capturing the plain-text output of a stored procedure
Posted by Dimitris at 8/20/2003 4:20:18 PM
I'm using ADO.NET to call a stored procedure that runs the "BACKUP" command on selected databases. Is there any way I can capture the text output of the stored proc and return it to ADO.NET for displaying in my application? When I run the stored procedure from SQL Query Analyzer, I get an outpu...more >>

Heterogenous queries ERROR 7405
Posted by Patrick at 8/20/2003 3:41:58 PM
HI Friends, I am trying to use declare @s int select @s = nextval from openquery(xdev,'select ca.ca_tc_s.nextval from dual') inside my store procedure where xdev is a linked server for OLE Oracle provider. I am getting error Heterogenous queries require the ANSI_NULLS and ANSI_WARNING...more >>

writing an upgrade script using conditional information
Posted by Jeff Kish at 8/20/2003 3:23:31 PM
Greetings. Can someone give me some pointers or a pointer to some pointers here? I need to write a script that will do some conditional stuff that I don't know if it is possible in tsql. It would do like the following: if table.column exists and table.column.length < 60 alter table set...more >>

anyone help me with sp_setapprole
Posted by Lars Grøtteland at 8/20/2003 3:17:06 PM
Could anyone help me to sp_setapprole How is it used. Do I have SQL in Mixed Mode? Could anyone give me a little example of how is it done. Both sp_setapprole and sp_addapprole -- - Lars ...more >>

using a sql statement to do a string replace
Posted by bj daniels at 8/20/2003 3:09:01 PM
I am not certain which group to post this to - sorry if this is the wrong group: I have a table that holds the location of various media and such (mostly images). One field is the Media name, the other is the URL in the form http://myServer.gunnery.org/media/pic1 for example. we are about to...more >>

BCP help
Posted by Alex at 8/20/2003 2:49:43 PM
All I have is a DAT file to use. I am wondering if it is possible to use BCP to import this DAT file's contents into a database table. I am trying to use a command statement similar to what is shown below. bcp MyDatabase.dbo.color in data\color.dat -S MyServer -U sa -P blah Basically, ...more >>

INSERT programming question
Posted by Chris Strug at 8/20/2003 2:47:39 PM
Hi, I have two databases on SQL Server 2000 named TLCTest and TLC. I wish to copy the contents of a table named "Container" in TLCTest to a table also named "Container" in TLC. I think that the best way to do this is through an SQL INSERT statement. However I can't seem to get the syntax...more >>

how to transform text for decimal of (4,2)
Posted by Slim at 8/20/2003 2:43:02 PM
esfod=case when os_odesfl is not null then cast(os_odesfl as decimal) else 0 end as it would be that transformation. for instance the text is +2.50 I want that is 2,50 that as decimal ...more >>

VB EVAL Function Conversion
Posted by spamtrap NO[at]SPAM abed-nego.com at 8/20/2003 2:20:41 PM
I have the following table: CREATE TABLE sample ( line_no VARCHAR(5) formula VARCHAR(300) ) the formula fields contains a string like 'Line(04010)+Line(04020)' or 'Line(04010)*.35' The Line function does a seek on a different table and returns a 'Double' amount I want ...more >>

Http post in a Trigger allways get fatal errors
Posted by Steven Xu at 8/20/2003 2:13:07 PM
Hi all, I want to http get from sql2000 table trigger. here is what i did: create procedure http_get( @sUrl varchar(200), @response varchar(8000) out) As Declare @obj int ,@hr int ,@status int ,@msg varchar(255) exec @hr = sp_OACreate 'MSXML2.ServerXMLHttp', @obj OUT ...more >>

xp_startmail error
Posted by M Murschell at 8/20/2003 1:51:15 PM
I want to log in to a different account than what is set up in SQL Server Agent. I've tried many things like this but none work. exec xp_startmail 'audit','999999' The error I am getting is this. Server: Msg 18025, Level 16, State 1, Line 0 xp_startmail: failed with mail error 0x800401...more >>

Does the Query Analyzer have a visual query builder
Posted by Jim at 8/20/2003 1:46:33 PM
Does the Query Analyzer have a visual query builder like Enterprise Manager? Jim james_peppercorn@storagetek.com...more >>

Openquery Select Statement Returning Only 1 Record
Posted by Marcus at 8/20/2003 1:37:20 PM
Although what I'm trying to do is more complicated than this, the following sums up the problem. I have a linked server which is an accountancy software package. This contains the tables INVOICE and INVOICE_ITEM. INVOICE consists of fields INVOICE_NUMBER, INVOICE_DATE, ACCOUNT_REFERENC...more >>

SQL Question: Update using correlated subquery?
Posted by John Smith at 8/20/2003 1:25:54 PM
Using the query below, I want to update *every* record in Table1 with a corresponding value in Table2. If there is no corresponding record in Table2 I want Table1.Column2 set to NULL. Will this work? UPDATE Table1 SET Column2 = ( SELECT Column2 FROM Table2 WHERE Table2.Column1=Table1...more >>

Updating millions of records
Posted by Miles Dennis at 8/20/2003 12:56:00 PM
We are currently using SQL server for some data analysis, and have tables containing > 100 million records. We need to run some update statements that alter the majority of these records, but the performance is being hit by the creation of vast transaction logs. Is there anyway of turning off...more >>

Creating Random Numbers or Characters
Posted by Cyont at 8/20/2003 12:42:46 PM
Hi, Can MS SQL server create random numbers (or characters) as default records? When a user create a username, I would like to have a randomized password automatically created. Please let me know if there is a way to do that. Cyont ...more >>

huge deletion
Posted by Eddie at 8/20/2003 12:12:08 PM
We have vldb, which has 10 tables that need to be purged on daily bases (1 million records per table). This process HAS TO BE partly overlapped with regular working hours and it should be implemented as a daily job... How can we do this and at the same time avoid locking as much as posible? User...more >>

Posting from SQL to ASP.NET web page
Posted by Paul at 8/20/2003 12:10:03 PM
Hi all. Can anyone point me to some example code or a precompiled extended stored procedure that I can use so that an SQL trigger can call a web page ? Thanks ...more >>

Adding variables to SQL statements from URL parameters
Posted by michaelstrange NO[at]SPAM ercwc.org at 8/20/2003 12:03:27 PM
I'm trying to set up a page that reads parameters (3 of them) passed by a form: Example: http://www.aamprogram.org/resources/useful_links_search2.aspx?category=cat_art&audience=aud_students&level=lvl_elementary&Submit=Search The user makes their choice from three drop down menus (http://w...more >>

i need to get a field from a record
Posted by Trint Smith at 8/20/2003 10:44:50 AM
The following code finds an image from a record: sqlCmd.CommandText = "SELECT ImageID FROM TBL_Seller WHERE SellerID = '" & Session("SellerID") & "'" dreader = sqlCmd.ExecuteReader While dreader.Read() ImageID = dreader("ImageID") ImageID2 = String.C...more >>

Is there a way to reaf a single 'bit' within a field in SQL
Posted by mark blackall at 8/20/2003 9:51:54 AM
I have a program that needs to look at (read only) whether a particular bit is set in a field in an sql database. I guess there is a way to do this but I can't find it amongst the 1000 pages of my manual! Any help gratefully received. Mark ...more >>

SQL Output to a file
Posted by Emma at 8/20/2003 9:44:57 AM
How can I send the result of SQL statement to a file using Query Analyzer? Thanks...more >>

Limiting the currency field
Posted by Jane at 8/20/2003 9:42:56 AM
Hi, In a DB I have set a field to 'money'. When returning all rows, the field shows up to 4 decimal places. How to limit it to 2 decimal places? The design table doesn't give me a choice. TIA, Jane ...more >>

READ ONLY StoredProcedure
Posted by Dishan at 8/20/2003 9:42:24 AM
Hi, How to create read only sp Dishan ...more >>

Using GETDATE() within a user defined function
Posted by Efrain Flores at 8/20/2003 9:06:46 AM
Hi.... I am creating the following function: CREATE FUNCTION date_return (@dateval datetime) RETURNS datetime AS BEGIN declare @newdate as datetime if (@dateval is null) set @newdate=getdate() else set @newdate=@dateval return @newdate END ...more >>

Excel to SQL Server
Posted by Neo Chou at 8/20/2003 9:06:45 AM
Greetings! I want to load data from Excel file to SQL Server. I can't use "Import/Export", so I added a linked server in SQL Server. One of the columns in Sheet1 (Excel File) is something like: 13 13 13D 13E .... But when I execute the following query in Query Analyzer: select *...more >>

SQL question
Posted by Joel Russell at 8/20/2003 8:45:11 AM
All, I am having problems with a query. I've tried using outer join and intersection but with no avail. Any help would be appreciate it. Thanks. Joel. Sample Data Table A ID Amount 1000 500 1001 500 1002 500 1003 550 Table B ID C...more >>

Use of GETDATE() in Stored procedure logic
Posted by Jakob Persson at 8/20/2003 8:39:11 AM
Hi I have a customer who uses something like: .....OR CALCDUEDATE < GetDate() + 7..... in a sproc. I think I have read something about functions that doesn't return the same output using the same input (they have a name I cannot remember) and that they should be avoided in logic be...more >>

Bytes Per Row
Posted by Loeri at 8/20/2003 8:33:42 AM
I am tryiing to create a simple formula that allows me to calculate bytes per row... using say Northwind.Employees as an example. Loeri...more >>

table data type in Stored Proc
Posted by Evan Bonnett at 8/20/2003 7:42:15 AM
Does some one have a snippet that shows how to declare and define a table data type? Is it possible to use a table data type to aggregate the result sets returned by a stored proc and then select * from the table? Thanks!...more >>

bulk insert error: 'Operating system error code 5(Access is denied.)'
Posted by Trint Smith at 8/20/2003 7:28:50 AM
the 'exception' when this command is ran: sqlstr = "BULK INSERT [Mink].[dbo].[TBL_Client_stage0]" + _ " FROM '\\nas01\r$\Program1.txt' WITH (CHECK_CONSTRAINTS, FIELDTERMINATOR = '\t', KEEPNULLS, MAXERRORS =100)" sqlInsertCommand2.CommandText = sqlstr sqlIns...more >>

Junction Table Question
Posted by AlexD at 8/20/2003 7:01:33 AM
Are there any advantages/disadvantages of adding an identity column in a junction table that resolves a many- to-many relationship? Thanks Alex...more >>

rank w/ reset on group by
Posted by Kevin at 8/20/2003 6:58:34 AM
looking for anything but a cursor solution. temp tables, identity columns, OK. DDL: create table t1 (colA int, colB char(1)) DML: insert t1 values (1,'A') insert t1 values (1,'B') insert t1 values (1,'C') insert t1 values (2,'A') insert t1 values (2,'D') insert t1 values (3,'A') inse...more >>

Stored procedures recompiling
Posted by Randy Patterson at 8/20/2003 6:24:32 AM
We have a situation where the application programmer is saying that every time a particular stored procedure is used, it is recompiled, even if three people are using it at the same time. We are both assuming that it would be compiled once and kept in cache for a while. Any help apprec...more >>

unicode to dbcs
Posted by bharath at 8/20/2003 5:32:46 AM
Hi, Recently I was able to convert DBCS to unicode charset ( varchar to nvarchar) successfully. Now I am not able to convert Unicode charset to DBCS charset. Could somebody help me out with the code for the same?...more >>

guru advice needed on temporary table problem
Posted by maxhodges NO[at]SPAM hotmail.com at 8/20/2003 3:27:15 AM
I often need to join tables in my SQL Server DB with tables in a linked Oracle server. I use OPENQUERY to do this. The problem is that OPENQUERY don't support parameters, so I find it hard to add a WHERE clause--for a specific date for example. I need a where clause or else I'll pull hundreds of...more >>

Comma Delimted Results
Posted by David at 8/20/2003 3:09:46 AM
Hi All I am attempting to run a SQL Statement to return the result from a table as comma delimited result. The SQL to demonstrate what I am trying to do is below: create table test1 (col1 INT, col2 datetime, col3 char(20), col4 varchar(20)) insert into test1 values(2, '1 Aug 2003', ...more >>

Create Trigger
Posted by lkozhush at 8/20/2003 3:05:17 AM
Hello There, I am currently working on a Trigger that is visibly correct however i can not seem to understand why i get an error message when i try and save a record <Maximum stored procedure nesting level exceeded (limit 32).> This is the syntax for the Trigger cre...more >>

XML Parsing error in SP3a
Posted by Andrew Todd at 8/20/2003 2:38:06 AM
When trying to run an OPENXML query on SQL Server 2000 SP31, with MDAC 2.8 we get the following error on one server, but not the other, which does not have sp3a installed: XML parsing error: System error: 265926. The stored procedure is below: CREATE PROCEDURE [dbo].[ModuleUp...more >>

Finding trigger in Enterprise manager
Posted by Amit at 8/20/2003 2:37:39 AM
Hi, i had created a trigger few days back on one of the tables. How do i find out the text associated with the trigger and to which table it is associated. I tried using enterprise manager,but it does not have triggers as one of the nodes in the tree view. One option is I use ms vi...more >>

problem
Posted by u489685058 NO[at]SPAM spawnkill.ip-mobilphone.net at 8/20/2003 2:05:21 AM
it won't quite work. student exam grade 1 math 90 1 chem 89 1 phys 88 1 his 88 1 Geo 85 2 math 89 2 chem 84 2 phys 83 2 Geo 81 3 Lit 80 3 GYM 79 3 highest: 1 ma...more >>

Finding Last Modifed Date of a Stored Procedure
Posted by M.Ganapathi at 8/20/2003 1:25:37 AM
How to find Last Modifed Date of a Stored Procedure in SQL Server?...more >>

How to get the data from Two servers
Posted by Niitmalad at 8/20/2003 12:46:59 AM
Dear Freinds I have server A with database ABC and Server X with database XYZ I want to take the data from both ther server how i can do the same please suggest. Thanks for your guidence in advance. Best regards NiitMalad ...more >>

passing a parameter for a trigger?
Posted by Frank Dulk at 8/20/2003 12:25:30 AM
Does some form exist of passing a parameter for a trigger? ...more >>


DevelopmentNow Blog