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 > july 2005 > threads for thursday july 28

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

How to process cubes using VB
Posted by celjavier at 7/28/2005 10:30:58 PM
I need to create a program in VB that will full process cubes. This is to allow end-user to process cubes. Any helpful links or codes on how to do this? If the end-user will run the process on his machine, what type of access should he have at the server to be able to run the process? I ...more >>


Truncating logs with a PHP script
Posted by Chin at 7/28/2005 9:59:31 PM
I am writing a little PHP script that grabs a list of DBs and generates a radio button list of DBs as a user's choice to select which DB's transaction log to truncate. The problem is MS SQL does not appear to like double-quotes being passed into the query through PHP: PHP code: //$pos...more >>

Distributed Transaction Over TCP/IP
Posted by Young, Corey at 7/28/2005 8:56:02 PM
I don't know to which discussion group this question is relevant, so I'll ask here. I have two SQL Server servers A and B that are not on the same network. They are both Windows Server 2003 servers. They communicate only using TCP/IP. Using Query Analyzer, I connect to A and execute the fol...more >>

Parsing a SQL Query
Posted by Pushkar at 7/28/2005 8:48:03 PM
Hi, In my application I have requirement to parse the SQL Select query and = get the name of tables/views which were involved in that query. Is there any free code available that does this task? Or any library available that helps to parse the SQL select query. Any help is appreciated. T...more >>

Getting rid of unwanted characters!
Posted by KB at 7/28/2005 8:17:02 PM
Hello Gurus, I’ve a table that has a column with a text data type. When they imported the data from a different system some non ASCII character slipped into the table. What would be the best way to get rid of them? For example: A man ne£ds ₤∂help. to A man needs help thanks in a...more >>

Cursor logic vs. set based solutons
Posted by Phil396 at 7/28/2005 7:21:02 PM
My boss is an excellent programmer, unfortunately he writes sql as he does code. He likes to call stored procedures from other stored procedures, sometimes two or three levels deep. He also likes to have one procedure being called by many different sp. A very object orientated guy. Although this...more >>

JOIN Process Order and Performance Comparisons
Posted by HardKhor at 7/28/2005 7:12:03 PM
Hi all, A common SQL that I do is joining parent and child tables together (1-M relationship), e.g. Invoice and InvoiceItem tables. These tables have huge number of rows. Q1) Compare the two statements (that give the same result) below, from a programming point of view, which one is more...more >>

SQL Join and Where to Put the 'ON'
Posted by Jason Webley at 7/28/2005 6:08:27 PM
Hello All, I am having a little trouble understaing what difference it makes where I put the 'ON' part of a join and how thenesting works. For example (Please do not take into account the type of joins): I understand this following example... Select ABC123 From TABLE_A INNER JOIN TABL...more >>



update statment problem
Posted by Agnes at 7/28/2005 5:50:30 PM
update arinvinfo set ttlbaseamt = (select baseamt from ZZ where arinvinfo.invNo = invno) in my temp Table ZZ , there are only 10 recrods. in my arinvinfo , there are 1000 recrods. After I process the above update statment, I found that 1000 records had been upated, bUT not 10 , Why ?? Pleas...more >>

Combination of "=" and "like" in a SELECT statement
Posted by Kriste L at 7/28/2005 5:44:51 PM
Hi Everybody, I've a inquiry field whereby user can choose to select specific code_no or use a wild card on the code_no. Example: a) code = 1234, so the result will return only those record matches code = 1234 b) code = '', so the result will return all records c) code = 1234*, so the resu...more >>

DATABASE Testing
Posted by Lara at 7/28/2005 5:41:56 PM
Hi, Can anyone explain how to start the database testing ? Pls send me the linksif any ? Want details of performing stress test of sps regards Lara ...more >>

cross-section select
Posted by simon at 7/28/2005 4:38:27 PM
I have table pool with columns: USERID,QUESTIONID,ANSWERID I have about 50 questions in table and each question can have couple answers. For example: USERID QUESTIONID ANSWERID ------------------------------------------------------------ 1 1 ...more >>

DB to DB sp
Posted by Emmanuel at 7/28/2005 4:26:46 PM
Hi, i am writing a tool that interfaces to a third-party database. I will be creating a database for my tool which contains stored procedures that accesses tables from the third-party database. I am doing this only to aviod manipulating the third party database. My database will be located ...more >>

SP to document maintenance plan ?
Posted by Simo Sentissi at 7/28/2005 4:24:27 PM
Hello there I was wondering is there is a stored procedure to witch I could feed the name of a maintenace job and it will give me all the data that exists in the maintenance configuration screen ? thanks ...more >>

Access Update Query Problem
Posted by Dan at 7/28/2005 3:19:49 PM
Hi, I have a local Access table that holds a values that I want to update a MS SQL server table. So I do a join between the local MDB table and the SQL Server table (table is attached via ODBC) and make it an update query. But the query spikes the CPU 100% and won't update the SQL serve...more >>

SQL TRANSACTIONS
Posted by Francois Malgreve at 7/28/2005 3:17:07 PM
Hi, If I have a Stored procedure that executes update statements on 2 Databases belonging to the same SQL server instance. So, do i have to use BEGIN DISTRUBUTED TRANSACTION or can I just start a normal transaction with BEGIN TRANSACTION? Best, Francois Malgreve ...more >>

view sql statement via trigger
Posted by Bahman at 7/28/2005 3:00:03 PM
Hello! I have triggers that tell me when a table is updated, for example. But I don't know what rows were appended. I don't know the content of the sql statement that ran. Is there a way to use the trigger to send me the actual sql statement that was run? -Bahman ...more >>

Finding a tape drive
Posted by John J. Hughes II at 7/28/2005 2:55:58 PM
I am writing an interface for the SQL backup in my application. I am currently trying to determine if a tape drive exists on the system so the system can add it as a backup device. If I use enterprise manager to add the tape drive as a device my application can see the device but still can't...more >>

UNION and minusing 3rd result set
Posted by Khurram Shahzad at 7/28/2005 2:29:46 PM
Dear all, I want to do a UNION of 2 queries and Minusing the result set of 3rd query. select * from table a where .. UNION select * from table b where .. MINUSING select * from table c where .. Kind regards Khurram Shahzad ...more >>

Multilple statements inside a Transaction
Posted by Lara at 7/28/2005 2:23:19 PM
Hi, I have a small doubt regarding the BEGIN TRAN ...CoMMIT TRAN If there are more than 1 statement (of course i know that the trandsaction is used for such a case), is there any need to put BEGIN..END within the BEGIN TRAN .. COMMIT TRAN. eg: BEGIN TRAN BEGIN statement 1 ...more >>

Tax calculation net to gross.
Posted by Martin at 7/28/2005 1:53:30 PM
Hi everyone, I'm looking for some help on a tax calculation. I want to enter the net amount the person has to receive and the gross amount should be calculated. I want to use the calculation in a query so it can make the calculation for each person. Any suggestion or examples how i can...more >>

Stored Procs vs VIEWS: Seeking Comparison
Posted by Joseph Geretz at 7/28/2005 1:53:16 PM
Every article which I've seen proposing Stored Procedures makes the same comparison: Stored Procs are faster than submitted SQL because Stored Procs are precompiled. Fine, but there's a third alternative, which I haven't seen mentioned at all. How do Stored Procedures compare with VIEWS? No...more >>

CHECK
Posted by ReTF at 7/28/2005 1:05:52 PM
Hi All, In my table I have 'filial' attribute(field), and I need check this as folow: If 'filial' = TRUE the attributes 'cnpj_da_matriz' and 'numero_de_filiais' can not be NULL else if 'filial' = FALSE 'cnpj_da_matriz' and 'numero_de_filiais' must be NULL. How I can do this? Have any...more >>

temp table vs normal table
Posted by Dave at 7/28/2005 12:54:41 PM
Are the any benefits to using a temp table vs a normal table? Wouldn't it be better to create a normal table to minimize the load on tempdb? ...more >>

Ciclic Foreign Keys?
Posted by Martin Hart at 7/28/2005 12:42:59 PM
Hi: Scenario: -) I have four tables TableA, TableB, TableC and ProductTable. -) TableA is the main header table of TableB, TableB contains a reference to a 'Product' in table ProductTable. -) TableB is, in turn, a header table of TableC, TableC contains a reference to a 'Product' in table ...more >>

Running queries on queries
Posted by A.B. at 7/28/2005 12:16:02 PM
If I am using SQL Server 2000 and running queries on queries. I have made views within the EM and built up to the final query that way. Is that the best way to do it or not. Can I do it by creating a procedure, would that be better....more >>

OPENXML - element has _xpath in name
Posted by A Lowly Tech at 7/28/2005 11:46:28 AM
With this sample, OPENXML returns null for the element named cont_exec_xpath, but change the name of that element to anything else that does not have _xpath in the name, and it returns the data. Any ideas? DECLARE @sampleXML varchar(8000) SET @sampleXML = N'<ROOT><T1Link_Message_Step_list_Tb...more >>

where logic selection
Posted by sqlster at 7/28/2005 10:31:04 AM
Currently I have check like the following going on in the WHERE CLAUSE and to me it could be written better. --- (mydate is null or mydate is not null) and (@only_show_dates is null) or (mydate is not null) and (@only_show_dates is not null) ----- set nocount on go create table ...more >>

numeric data
Posted by Jon at 7/28/2005 10:27:45 AM
This is a really stupid question, but I've never dealt with it before. How does one insert or update numeric data with commas in it? col = numeric (6,2) In an english database, you can simply remove the commas and all is well. insert into table (col) values (1,200.34) would be insert into ...more >>

Replace temp table with inline table-value function
Posted by Mike Jansen at 7/28/2005 10:22:38 AM
PREFACE: We are getting rid of the temporary tables so I don't need to be convinced not to use them. In our current system we have a pattern where a temporary table is created in one or more "calling" procedures and populated with selected keys of a table and in the "called" procedure, tho...more >>

How to find gaps in sequential key
Posted by D Babin at 7/28/2005 10:04:02 AM
Is it possible to write an SQL query to find gaps in a sequential key field? Key Field 7 8 10 11 14 I would like the query to return the gaps 9 12 13 Or better yet, the range of the gaps 9,9 12,13 Any suggestions?...more >>

Convert varchar to numeric
Posted by Terri at 7/28/2005 9:59:48 AM
I have a varchar value like -2.47382558882236E-10. How can I convert this to -2.47382558882236 in order to then convert to numeric. Logically I want to truncate everything after the 14th digit to the right of the decimal point. Thanks for any help. ...more >>

Error message in a job, SQLSTATE 42S02 (Error 208)
Posted by Blasting Cap at 7/28/2005 9:52:26 AM
I have a scheduled job where it's failing intermittently every few days. The job fails in one of two steps, but with the same error above. Step 18 is where I do a drop of the table and a create of the table, and its indexes. It doesn't fail here, but fails in one of the next two steps. ...more >>

querying the data dictionary
Posted by Dwayne King at 7/28/2005 9:35:43 AM
Hi there, I'm building a tool that will connect to a database (Oracle, SQL Server, = DB2) and extract information about the schema objects to an XML file. = My problem is that I can't seem to find the equivalent for the following = query: SELECT LOWER (uc.index_name) AS index_name, LOWER...more >>

boolean programming
Posted by sqlster at 7/28/2005 9:26:11 AM
Is bit the closest to the boolean (true or false) datatype in tsql? Even though it could be 0,1,null?? TIA...more >>

Scheduled job "show step details" more info?
Posted by Dave at 7/28/2005 9:11:57 AM
We have some very large DTS packages that are run nightly. We they fail it is often difficult to diagnose because the error details in Job History is truncated. Is this information written to a log anywhere, or is there a setting to increase the amount of information that is stored? Or... ...more >>

Uniqueidentifier GUID question
Posted by Amil at 7/28/2005 9:08:02 AM
Hi all, Does it matter that when i view the GUID data using the Query Analyzer, the characters are all in uppercase. Whereas, in .Net, the guid is in lower case?...more >>

Why does the stored procedure behave differently?
Posted by Amil at 7/28/2005 9:01:02 AM
Hi all, Following is a code snippet that can be run directly from the Query Analyzer. I am just trying to get my feet wet and I don't know why the stored procedure: sp_test does not correctly assign the correct value to @DataDesc. DROP TABLE #test_table CREATE TABLE #test_table ( guidc...more >>

Trim leading 000 from varchar field
Posted by Unix_to_Windows at 7/28/2005 9:00:06 AM
I have a varchar field with leading 0's as in the example below 00389948 00009348 09984903 How can I strip the leading 0's and still maintain the varchar field?...more >>

Simple SELECT statement???
Posted by Tim::.. at 7/28/2005 8:36:09 AM
Can someone please tell me how I do a select for values that starts with a letter... For example if I wanted to find all the employees from a database that lastnames started with "A"??? EG... SQL = "SELECT LastName, FirstName, Initial,Dept,TeleNo, Email FROM tblNonADUsers WHERE lastname...more >>

Custom 'Order By' Function?
Posted by hals_left at 7/28/2005 8:00:54 AM
Hi I have a column varchar(4). Users enter values in one of 5 formats - 1) 1,2,3,4....10,11 2) 01,02,03,04....10,11 3) A1,A2,A3,B1,B2,B3....B10,B11 4) 1.1,2.1,3.1......10.1,11.1 5) 1.1, 1.1A, 1.1B, 2.1, 2.1A, 2.1B.....10.1,10.1A The queruies that select from this table will only select r...more >>

Passing a Table var as an input/output parameter
Posted by João Costa at 7/28/2005 7:19:01 AM
Hi all About Table vars, is it possible to pass it to sub Stored Procedures as a parameter or not? declare @MDMB table( MIDIIC smallint not null, MRCDDAA smallint not null, MRCDDAM smallint not null, MRCRIC char(1) not null, MDMBIY char(6) not null ) couldn' figure out the...more >>

Permissions problem
Posted by Chubbly Geezer at 7/28/2005 7:15:02 AM
Hi I have some code that I am testing to read data from a FoxPro file. I have copied the FoxPro file locally to test. I have created a linked server that points to this file. Enterprise manager correctly shows the tables available. Works fine.! However, when I create another linked serve...more >>

Creating a trigger using a cursor
Posted by jaylou at 7/28/2005 7:01:13 AM
Hi all, I need to create a trigger on all tables in a database that will insert into an audit table username, and event on the table. I can create the trigger individually, but I would like to put this into a cursor so I do not have to run the trigger 500 times. I am grabbing all user table...more >>

RUE._What's_wrong?
Posted by Klaus at 7/28/2005 6:36:05 AM
Hello, in a case-function the therm 'ß' = 'ss' evaluates to true. Is there a chance to fix the problen in a particular query or better to fix it generally in SQL Server? Thanks in advance, Klaus SQL Server Version: 8.00.760 (SP3) Language: german Collation: Latin1_General_CI_AS ...more >>

Stop a DTS Package
Posted by Kevin at 7/28/2005 6:08:32 AM
Hi I have a SQL Server 2000 server and an access front end. I want to be able to trigger a DTS package from Access. I have a table that stores a value, (idle, waiting to export, exporting). When the user wants to trigger the package, Access puts the 'waiting to export' value in a table. ...more >>

DYNAMIC USE
Posted by Enric at 7/28/2005 4:56:03 AM
I would need go along the current sql server using a cursor (another alternatives will be welcomed) and changing of database Something like that: DECLARE @BD AS CHAR(20) declare cursorbd cursor fast_forward for SELECT NAME FROM MASTER.DBO.SYSDATABASES WHERE NAME NOT IN('MASTER','PUBS...more >>

Trouble using Table data type
Posted by João Costa at 7/28/2005 4:30:04 AM
hello, I'm using Table data type as a suggestion to lower Stack use. I'm just having trouble figuring out how to use the table var correctly. 1 update @MDMB 2 set @MDMB.MDMBMT = @MDMB.MDMBMT - BIT.MDMBMT 3 from @MDMBTotaisAssoc BIT 4 where BIT.MRCSKA = '-' and 5 ...more >>

Trigger problem
Posted by Fred at 7/28/2005 4:14:02 AM
Hi everybody! I'm trying to upgrade my app's on sql2005. Everything work's fine except triggers on a huge tables with more then 30 millions of rows. It takes more then 10 min but on sql2000 on the same computer it take’s 1 second. I have trigger on each table and this trigger’s are for...more >>

OPENROWSET MSDASQL Microsoft Text Driver
Posted by Subramaniam Sivakumar at 7/28/2005 4:01:02 AM
My query is like follows SELECT * INTO TABLE_1 FROM OPENROWSET ('MSDASQL', 'Driver={Microsoft Text Driver (*.txt; *.csv)}; DefaultDir=D:\;','select * from FILE_1.txt ') It is working fine with the files having ',' as separator. I want to use other characters ('*' ';') as separator. Be...more >>

system stored procedures output
Posted by Enric at 7/28/2005 3:29:03 AM
Dear all, I can't work out with this topic. There are system sp which pull data as if it were a report, I mean, retrieves the info without give any possibility for the developer to retain or to manipulate these data in a query way. For example: sp_helprotect NULL, <user> The solution wo...more >>

Three ways for do the same
Posted by Enric at 7/28/2005 3:24:03 AM
Dear all, Which the following methods is the most efficient way?? Faster or most secure. IF EXISTS (SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'testenr') DROP TABLE testenr GO ------------------ if exists (select * from dbo.sysobjects where id = obj...more >>

several locations for datafiles
Posted by Enric at 7/28/2005 2:46:02 AM
Dear gurus, Is it possible have got at the same time a main data file (.MDF) in a domain and the rest ones (.NDF) in another domain? if not, Sql2005 give us the possibility? In the case of AD, is it possible the same but in different forests? Regards, ...more >>

Archive data before deletion
Posted by devccon NO[at]SPAM gmx.de at 7/28/2005 2:17:41 AM
Hi all, how can I copy all dependant child records into duplicate tables before deleting them. The situation is that I have a master table "customer" with 20 other tables that depend on this master table. Foreign keys are all set up correctly and cascading delete is enabled. Now when a custo...more >>

Connection problem with ODBC to MSDE
Posted by Sharad2005 at 7/28/2005 1:12:02 AM
Dear Friends I am facing problem to connect to the SQL server which is in the network through ODBC. I can ping to the machine all shares are available but not able to get the ODBC connection with SQL. Please suggest what can be the reason and how i can solve the same. Best regards Shail...more >>

Subquery returned more than 1 value
Posted by Francois at 7/28/2005 12:17:48 AM
Hi, I'm new to SQL programming and would like to run the following update statement but the statement return more than one value. UPDATE <tableA> set <date> = (SELECT CONVERT(DATETIME, <STARTDATE>, 103) from <tableA>) How can I write this statement so it will update the <date> column with t...more >>


DevelopmentNow Blog