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 > may 2004 > threads for friday may 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

Access one server from other
Posted by Malik at 5/21/2004 9:56:02 PM
I have two SQLServers is it possible to access tables on a server from other server e. i want to access a table on one server through an SP on other server Any solution to it or any work around thanx...more >>


Access to remote database using single login
Posted by Jane at 5/21/2004 7:28:23 PM
Hi, I have a stored procedure that transfers some data to a remote database (same server). The sp is fired on user activity with an application. The issue I have is that the users access the local database via a unique login, which is not present in the remote db - and thus the sp fails when...more >>

How to rename SQL Server instance
Posted by Abhishek Srivastava at 5/21/2004 6:32:51 PM
Hello All, I had installed SQL Server on my machine. I choose nt221118 as the name of the SQL Server instance. Now because of some changes on our network, I am forced to change my machine name to nt21101. I want to rename my sql server instance name to nt21101. How can this be done? ...more >>

Need helps with newbie query
Posted by Ted Burhan at 5/21/2004 5:47:28 PM
I have a table with 2 columns tblTags =============== TagID int |PK| Value nvarchar(10) In one of my stored procedures, I'm trying to find the value of tags with id 1 & 2 I can achieve this by doing the following: DECLARE @Tag1 nvarchar(10), @Tag2 nvarchar(10) SELECT @Tag1 = Value F...more >>

problem with Orphan user?
Posted by joe at 5/21/2004 5:16:21 PM
I detached a few of databases from "Server A" and copied them over to new server "Server B" and attach them, Since these databases already have username called "joe", so I know I must create a new sqlserver LOGIN called "joe" with sa role in "Server B" in order to make it work. BUT after I crea...more >>

Another Scripting ?
Posted by Ricardo at 5/21/2004 4:49:14 PM
Given the following code snippet from a stored proc: USE master GO CREATE DATABASE Sales ON ( NAME = Sales_dat, FILENAME = 'c:\test\testdata.mdf, SIZE = 10, MAXSIZE = 50, FILEGROWTH = 5 ) LOG ON ( NAME = 'Sales_log', FILENAME = 'c:\test\testlog.ldf', SIZE = 5MB, M...more >>

SQL Variable USE.
Posted by Ricardo at 5/21/2004 4:36:00 PM
I have begun to play with SQL 2K and have a quick question. I would like to create a procedure named NewTable. In that proc, I would like to PASS into the proc the name of a table that I would like to create like so: exec NewTable 'c:\test\testtable.mdf' How far off am I on something ...more >>

Query with derived table
Posted by Edgard Riba at 5/21/2004 3:41:36 PM
I have the following table CREATE TABLE hFacts ( Item INTEGER NOT NULL, DateID DATETIME NOT NULL, Qty DECIMAL(14,5) NULL, CONSTRAINT hF_LLAVE PRIMARY KEY (Item,DateID) ) GO I want to extract the TOP quantity, and t...more >>



DELETE a TEXT or EXCEL file via Transec SQL in DTS Job
Posted by JohnT at 5/21/2004 3:28:35 PM
Hi, I have created a DTS task which I want to schedule so that it will Export data into an EXCEL file. However, I want to ovewrite the data every 1 hour i.e. I want to shcedule the job to run every 1 hour and everytime it must overight the previous data in the Excel file. An e.g. would...more >>

Exception Reporting - Best Practices
Posted by T.A. Brooks at 5/21/2004 2:53:29 PM
All, I have an implementation / best practices question I thought I'd offer up to the SQL Server gods. I've developed a SQL Server back-ended web-based (ASP.Net) app to perform a basic business function at work. Some of the data (look-up stuff) in my database has an external source and it...more >>

SQL Server Tools
Posted by dbadmin NO[at]SPAM comcast.net at 5/21/2004 2:45:36 PM
Has anybody else tried the new SQL Server Tools? http://www.sqlservertools.us They sound useful, but there's no online help within the applications....more >>

Can I convert binary data to an ADO Recordset and vice versa ?
Posted by Peri at 5/21/2004 2:26:41 PM
Hi, Can I convert binary data to an ADO recordset and ADO recordset to a binary data ? Thanks and Regards, Peri ...more >>

IsNull
Posted by JD at 5/21/2004 2:26:26 PM
How do I write a statement that will update nulls in a table.fieldname to 0? thanks ...more >>

Storing HTML in Table
Posted by Monkeyboy at 5/21/2004 2:24:40 PM
I am trying to store large amounts of html (greater than 4000 characters) in a field. The only datatype I see available is nvarchar which is limited to 4000 characters. Problem is when I try to insert data into a nvarchar field via a copy/paste in Enterprise Manager, the data is being truncated ...more >>

Query Assistance Needed
Posted by Jonathan at 5/21/2004 1:40:13 PM
Hi, I am having trouble putting together a query. Selecting * from my table returns something like this: day_ID creation_ts ----------- -------------------------- 1 2004-05-03 13:11:48.093 2 2004-05-03 13:11:56.423 3 2004-05-03 13:12:01.923 4 ...more >>

dynamically created cursor inside a user defined function or stored procedure, how?
Posted by David Lightman Robles at 5/21/2004 1:17:03 PM
In order to simplify the problem, let's suppose I have an Invoices TABLE = (InvoiceId int, CustomerId int, ... morefields) Due to some complex reports I need to create an user defined function in = wich there will be a cursor that I'll use to iterate among the Invoices = table. The cursor should...more >>

Puzzeled on SELECT Statement
Posted by Jim Abel at 5/21/2004 1:13:01 PM
I'm puxxeled as to what is wrong with the following statement. If I leave the <> portion out of the where clause I get the expected results a NULL value from the a table and a string value in the v table. When the <> portion is included it doesn;t return anything. I will eventually use...more >>

Working with unicode
Posted by Aleksei Pashin at 5/21/2004 12:59:51 PM
Hello. I am working at multi-language web site. I need to save Unicode data on my MS SQL 2000 Data Base. I would like to save data on utf-8 format but on this case I have a problem with sorting non English records and transferring them to UPPER case. Could you suggest any ideas or methods ...more >>

ALTER DATABASE (optimization job)
Posted by Dimitris at 5/21/2004 12:47:45 PM
Hi all I have a database (warehouse) with a data file 16GB with Recovery model FULL And each week I do a night run for optimization with the options "Reorganize data and index pages" and "Change free space per page percentage to 10%" When this night run occurs, the transaction log on my da...more >>

find missing/deleted records?
Posted by Mansoor Azam at 5/21/2004 11:50:21 AM
I have 2 tables say table1 and table2 with the same structure. Each record is identified by a field 'SerialNo'. Now there should be a total of 500000 records in both tables with serialno from 1 to 500000. Either a record is in table1 or table2. I want to find records (or SerialNo's) that are in ...more >>

tabLockx - updatelock
Posted by Dean L. Howen at 5/21/2004 11:47:06 AM
please help me to explain more clearly: When is TABLOCKX/UPDLOCK held until the end of the statement? and when end transaction? ...more >>

Multi lingual support in VB app
Posted by Support at 5/21/2004 11:41:55 AM
I have an app in VB and SQLServer 7.0 This app has to have support for many languages, and would be deployed all over. For this, I use resource file with VB. I changed my regional setting from english(US) and my keyboard default language to anything other then english(US), the corresponding SQ...more >>

Algorithm to compare 2 tables have exactly thesame tupples
Posted by Caspy at 5/21/2004 11:39:06 AM
I need a efficient algorithm to compare if 2 tables have exactly the same tupples. the table structure is simple as the following: ----------------------------------------- entity_id uniquidentifier role varchar(10) ----------------------------------------- Th...more >>

Max characters returned by Select on a varchar field
Posted by James Jiao at 5/21/2004 11:35:03 AM
Hi, All I tried to run this statement in the SQL Query Analyzer.. select rules_text from _4thEdition where len(rules_text) > 400 Where rules_text is defined as a user datatype 'card_text' and card_text defined as varchar(500).. the result returned contains two rows (and i confirmed it, ...more >>

_ID NUMBER
Posted by Resolve E-mail at 5/21/2004 11:14:56 AM
Hi All, how do I get the ID of a newly inserted record if the ID is set to AutoNumber. if I say Insert into Table (Name,Address) Values ('Name','Address') how do I get the ID of that newly inserted record, beacause I need the ID to put it into another table which is linked to this ID. Tha...more >>

Using IF with an INNER JOIN
Posted by Nelson at 5/21/2004 10:56:06 AM
SQL Novic I need to get this INNER JOIN embedded in a nested if along with more INNER JOINs INSERT BACKFILE_A SELECT WORK_INTRO.RECID, WORK_INTRO.UPDATE FROM WORK_INTRO INNER JOIN SIF_DT1 ON WORK_INTRO.RECID = SIF_DT1.RECID WHERE SIF_DT1.ROUTE_CODE = 'BACKFILE DELETE WO...more >>

Function VS StoredProcedure
Posted by Reza Alirezaei at 5/21/2004 10:54:46 AM
I just wondered to know the difference between Function and Stored procedure from Compilation ,Performance points of view. Can anyone help? Thanks ...more >>

Percent of total records query
Posted by bobl at 5/21/2004 10:31:15 AM
Need to calculate the percentage of total records that have a certain value in a field. For example: 200 total records 50 records have this field set to a certain value query returns 25% in whatever form (.25 -or- 25 -or- 25%) TIA Bob ...more >>

trigger question
Posted by JT at 5/21/2004 10:30:40 AM
can anyone explain to me the benefit of using a trigger over a stored procedure? as i understand it (but im probably missing something), triggers cannot accept parameters - this makes them fairly troublesome to work with. for instance, lets say that each time myTableA is updated, i need myT...more >>

Probably a simple question
Posted by CJ Taylor at 5/21/2004 10:23:37 AM
Alright, new to SP's, just a hard core .net developer so bear with me. I want to update a set of records in a temp table based off a query from another x number of tables.. ie. update #myTempTable set myCol = ( select sum(mBalance) from Charges where iParent=#myTempTable.iParent group by...more >>

which developing tool
Posted by Jemy at 5/21/2004 10:07:06 AM
Hi all, i need to develop a custom accounting system for my company, this involves alot of database read write. My question is what is the more suitable developing tools for this task? visual c++, foxpro or delphi? I am currently learning visualc++, so my best bet is visualc++, but i wonder i ...more >>

ORDER BY clause: strange performance in cursor
Posted by odd182 NO[at]SPAM hotmail.com at 5/21/2004 10:04:55 AM
I've encountered a very strange performance problem in a stored proc running on SQL Server 2000. Basically, all I change is adding an extra column to the ORDER BY clause and I get a 100-fold boost to performance, and I can't figure out why. I have a cursor that I'm declaring like this: =====...more >>

SET LOCK_TIMEOUT
Posted by eXavier at 5/21/2004 10:00:12 AM
Hi, I want to change LOCK_TIMEOUT for update, but then set it back as the connection is used for other statements. I tried following construction: declare @tmo int set @tmo = @@LOCK_TIMEOUT SET LOCK_TIMEOUT 0 update ... SET LOCK_TIMEOUT @tmo but problem is that SET LOCK_TIMEOUT does not...more >>

Reconfigure table layout
Posted by Andrew at 5/21/2004 9:50:43 AM
Can someone write the code to do this? I have a table that looks like this. Name Number Joe 123 Joe 234 Joe ... Dave 123 Dave 234 Dave ... The number of repeating names can be long. I need to have a new table look like this. Name Number...more >>

IN Operator in SQL queries with a variable having comma seperated values
Posted by Rose at 5/21/2004 9:19:03 AM
Hi Consider the following situation... Following is my procedure: create procedure ret_dep_values @dept_type varchar(255) as begin select dept_cde, dept_name, dept_type from dept where dept_type in ( @dept_type ) end Th...more >>

MDAC 2.7
Posted by roy NO[at]SPAM xeon.tv at 5/21/2004 9:15:51 AM
I recently upgraded from MDAC 2.6 to 2.7. I have an old VB6 dll that uses the data environment in some of the classes. This dll is instantiated in an ASP web application, and is unable to instantiate. The error is in opening the connection to the SQL server. Everything worked fine before upg...more >>

Query Tuning
Posted by JN at 5/21/2004 9:11:04 AM
Hello I am attaching my query that runs as part of a DTS package. The DTS package has several such queries with similar structure and output row numbers, but none take as long as this query does. This query takes at least 2 hours to return a resultset! The underlying tables have all necessary inde...more >>

keep the new line character in SQL server text
Posted by Caspy at 5/21/2004 8:54:40 AM
I am developing a web site for a discussion forum with SQL server 2000 as back end data storage. The post messages are save as 'text' in database. Messages are extracted from a text box. In the text box, poster can have some format like new paragraphs to make post look better. However, the messa...more >>

Format Currency
Posted by ..:::M:O:R:B:I:L:L:O:::.. at 5/21/2004 8:33:19 AM
hi to All I want format a currency number in a strored procedure. Example : 1000000 1,000,000 The field type is varchar .... May you Help me ? Bye ...more >>

time portion from timestamp
Posted by Inayam at 5/21/2004 8:21:07 AM
How do I get the time portion from a date field...equivalent to to_char(sysdate,'hh24:mi:ss) in oracle Thanks....more >>

Followup to IDENTITY and UNIQUEIDENT suggestions
Posted by Rog at 5/21/2004 8:17:21 AM
Thanks Krystian, Louis and Anith for your advice and pointing me the right direction. Will I be able to use these commands on existing tables with an Alter command? I guess I'll find out when I try but thought I'd ask to avoid the old "why doesn't this work, oh it's not supposed to work th...more >>

BUG REPORT (Reporting Services)
Posted by Greg Wilson at 5/21/2004 7:30:36 AM
Is there any work around to the fact that if you are in "Preview" mode on a Reporting Services report in Visual Studio 2003 and your screen saver kicks in, that Visual Studio completely locks up and must be forcibly "End Task"ed, losing all unsaved work?...more >>

Logging within User_Defined Functions (UDF)
Posted by Rob at 5/21/2004 7:19:32 AM
Hi I'm trying to carry out some logging each time an UDF executes.However I understand there are some limitations, i.e you cannot INSERT data into tables directly from within a function. Ultimately you can only execute functions and extended procedures within a function. So i've tried...more >>

Is there a way to automatically generate a unique field
Posted by Rog at 5/21/2004 7:00:24 AM
Hello, I am using a utility (Bindview bv-control) to export my Security Log files into a table. The utility runs each night and appends the data to an existing table. The problem is the export does not make have a field/value for a unique number since there is no such field in the Secu...more >>

Unmatched Record query
Posted by Google NO[at]SPAM Otterlimits.com at 5/21/2004 6:54:26 AM
I am attempting to eliminate a cursor-based process with a result set based process. I have run across one problem I haven't been able to solve. I have to tables containing item numbers, quantity and cost. These tables are from two different systems and not all of the records to are present in e...more >>

Dynamic SQL
Posted by Mark at 5/21/2004 6:35:37 AM
I am about to start new project. This is an HR application. New program should be written in C# which is completely new for me. I have found a few modelers / code generators that I can use to build my business framework and data access components. I particularly like one product. The only pr...more >>

Parameters and order by direction
Posted by Phil396 at 5/21/2004 6:34:50 AM
Can you make the direction of an order by a parameter. Here is an example Proc Select ....... order by Case @colname when 'CompanyName' then companyname when 'Phone' then phone etc.... else null end I am creating a crystal report and would like the option of dynami...more >>

Linear interpolation
Posted by Jamie at 5/21/2004 5:34:53 AM
Hi, Anyone know how can create function, whic fill all fields with null values Algoritem is linear interpolation. Example: ------------------------------------------------ -- Struct of my table ------------------------------------------------ CREATE TABLE [dbo].[tTest] ( [id] [int] IDE...more >>

Group this query for the results I need
Posted by scorcoran at 5/21/2004 5:11:04 AM
I need all Time deposit owners that have a relationship of primary or secondary and then I need to compare this result to see if they have a checking or savings account. When I run this query I get no result select C.SOC_SECURITY_NUM, C.FST_NAME, C.LAST_NAME, C.HOME_PH_NUM, A.ADDR, A.CITY, A.STATE...more >>

Encryption
Posted by Evandro Braga at 5/21/2004 3:46:55 AM
Hello all, how to encrypt my stored procedures using SQL 7 and 2K ??? best regards, Evandro ...more >>

select fields width NULL
Posted by pileggi at 5/21/2004 3:41:03 AM
I must select some records where the fieds "firm" was not valorized. I tryed in the following ways ....where firm = '' .. but often the fields are <NULL> and then it don't select anythin ....where firm = @firm.. an ....("@firma").Value = dbnull.value...(I program in asp.net with Visual Basic...more >>

T-SQL Write to File FROM XML Explicit - delete job info
Posted by fitzfreckle NO[at]SPAM yahoo.co.uk at 5/21/2004 3:17:29 AM
Hi, I have a job that runs a stored procedure that outputs a result from XML EXPLICIT select to a specified file. The result is as follows: Job 'TestJob' : Step 1, 'First Step' : Began Executing 2004-05-21 11:13:08 XML_F52E2B61-18A1-11d1-B105-00805F49916B ---------------------------------...more >>

Mail
Posted by Peter at 5/21/2004 3:06:42 AM
Is there a nice simple tutorial to I can follow for sending / receving mail using a store procedure. Thanks Peter...more >>

returning float with decimal value using division operator
Posted by Grant Williams at 5/21/2004 2:06:09 AM
Hi folks I need to return a ratio value being the result of dividing one value by another. for example, in the following expression, "select 3/4" I need to see the result being 0.75 However, the actual value returned by the / operator is the quotient of the first expression divided by t...more >>

Diff. Name on View
Posted by Konstantinos Michas at 5/21/2004 1:49:33 AM
Hello Experts, I've created some Views using Enterprise Manager, which the code copied from other similar views. My issue is when I see the properties of a view (which is actually it's Create statement), the name in CREATE VIEW "ViewName" stmt is different than the one that appears in t...more >>

execution plan question
Posted by Paul at 5/21/2004 1:26:04 AM
If you look at the execution plan, and hover over an icon, there is a column referred to as cost. Does anyone know what this is referring to? The percentages are useful as a ratio, but the actual figure is confusing - it is not CPU cost, but what is it TIA Paul...more >>

Geting last timestamp?
Posted by Volhv at 5/21/2004 1:01:06 AM
Hello All Is there a way to get last timestamp not using @@DBTS. @@DBTS is wrong for me SELECT OperPlaceID, @@DBT FROM OperPlac -----result-----------------i want thi 1, 123 1, 12 2, 123 2, 12 3, 123 3, 124-----was update by another ...more >>

How to take Database Backup through the SQL Commands....
Posted by ElanKathir .S.N at 5/21/2004 12:36:18 AM
Hi all..! How to take database backup through the SQL Commands in SQL Server 2000. What is command for that .... Thanks & Regards Elankathir, B'lore, India. *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it!...more >>


DevelopmentNow Blog