Home All Groups Group Topic Archive Search About

SQL Server database programming

microsoft.public.sqlserver.programming
Score Query Tuning.
Sagar - 30 Jul 2005 7:11 PM - 9 messages
Hi, I have the following query which takes 12- 15 seconds to return almost 900,000 rows.  I would like the query to return in less than 4 seconds (1-3). I have added indexes where needed but was not successful. I am ...
Score Question
Bpk. Adi Wira Kusuma - 30 Jul 2005 5:25 PM - 2 messages
I ever hear that visual can visual foxpro programming can connect with SQL Server 2000. Really? Can you give me its simple script? ...
Score 1) User-Defined string Functions Transact-SQL 2) BUG in replace
Igor2004 - 30 Jul 2005 4:36 PM - 1 message
Ladies and Gentlemen, I am pleased to offer, free of charge, the following string functions Transact-SQL: AT():  Returns the beginning numeric position of the nth occurrence of a character expression within another character expression, counting from the leftmost character. ...
Score Full join problem...
tw - 30 Jul 2005 4:32 PM - 4 messages
Hi, My scenario is that i do a full join for check after duplicates name with the difference function. The problem is that i want to set a group value for each probably duplicates. After that i can set a distinct or something. ...
Score Table Creation Text
Zachary Hartnett - 30 Jul 2005 3:59 PM - 3 messages
I know how to get the text for various database objects (like stored procedures) using sp_helptext or through direct access to the syscomments table. One thing I have not been able to find is the text associated with creating a table. ...
Score Slow Stored Procedure when run via ado, fast from query analyzer
barooz - 30 Jul 2005 11:51 AM - 3 messages
Greetings folks. I've got a stored procedure reading data from the database that runs in about 2 seconds from query analyzer, and takes 50+ seconds run from ADO in asp classic.  I'm using SQLOLEDB.  I'm totally baffled, any ideas ...
Score how to write a query to get list of user-defined types
arch - 30 Jul 2005 11:04 AM - 12 messages
I wanted to write a select query that returns a list of user-defined types only (without returning the system types).  In other words, I can't just do "select * from systypes".  Does anyone know if this can be done? ...
Score Is there such thing as cross-table index or something?
Rich - 30 Jul 2005 8:43 AM - 5 messages
CREATE TABLE [SalesForecast] ( [SaleDate] [datetime] NOT NULL , [CustID] [varchar] (10) NOT NULL , [F1] [money] NOT NULL ) ON [PRIMARY] CREATE TABLE [Sales] ( [SaleDate] [datetime] NOT NULL , [CustID] [varchar] (10) NOT NULL , [S1] [money] NOT NULL ) ON [PRIMARY] CREATE NONCLUSTERED INDEX SalesForecast_CustID ON SalesForecast (CustID) ...
Score ANSI-Style Joins & Old-Style Joins!
Arpan - 30 Jul 2005 8:38 AM - 4 messages
I came across an article which states the differences between ANSI-style JOINs & old-style JOINs. This was one among them: ---------------------------------------------- The ANSI-style JOIN supports query constructions which the old-style JOIN syntax does not support. ---------------------------------------------- What does the above mean especially the term "query constructions"? ...
Score Granting SA rights to Sr. Developers in Small ITS Groups when ther
JA - 30 Jul 2005 5:56 AM - 7 messages
I just finished reading several articles on the SQL Server Security Checklist or Best Practices - and I could use some advise.  Our ITS group is too small to have a full time [application] DBA for SQL Servers so only Networking has ...
Score how to count the total rows for a query with group by?
zxo102 - 30 Jul 2005 3:01 AM - 14 messages
Hi,     I have a query  like   select tbl1.f1, tbl2.f2, count(tbl1.f1) as YY from tbl1, tbl2 where tbl1.f1=tbl2.f2 group by tbl1.f1, tbl2.f2    for example, I can get the results like ...
Score Run Job From TSQL
Judy - 30 Jul 2005 2:59 AM - 4 messages
Dear All, I need some help on this problem. I create a job on SQL Agent, the job had schedule as selected date and time, but I want to have a optional choise to user to allow them start the job at ...
Score Is there a smart set-based solution?
Mowgli - 29 Jul 2005 10:53 PM - 45 messages
I have a column of starting times below (converted to seconds for simplicity): 500 505 510 535 910 939 944 977 I need to assign a Group ID to the above values, based on a time interval of 30 seconds, so the correct result would be: ...
Score Using Trace Output
Larry - 29 Jul 2005 10:37 PM - 3 messages
We are on SQL Server 2000. I have a huge stored procedure (2000 lines) written by someone who has left, and we need to optimize it. This stored procedure uses Global Temporary Tables. Occasionally we get a timeout error, when this stored procedure is ...
Score Database design question
chewie - 29 Jul 2005 10:37 PM - 2 messages
I’m relatively new at database design so forgive me if I’ve overlooked something stupid.  I’m designing a teacher grading application on the new SQL 2005 Express.  Right now I’ve got a Student table that lists info on each student.  I then ...
Score How to Avoid dynamic sql in dealing with array of INTEGERS
sqlster - 29 Jul 2005 10:09 PM - 5 messages
I would like to pass in comma delimted integer numbers in terms of string array from front end .net application as an input parameter to a stored procedure. Stored procedure would some how sort this input string into an integer array ...
Score looking for equivalent to alphanumeric identity column
jason - 29 Jul 2005 9:28 PM - 7 messages
hello everyone, i'm looking for a solution that would generate the equivalent of a case-inspecific, alphanumeric identity column. which is to say a column that iterates through guaranteed unique values, but using case-inspecific alphanumeric characters instead of ...
Score xml question
Walter Levine - 29 Jul 2005 9:15 PM - 2 messages
am using Visual Studio 2003/C# I created a new  xml schema/xsd file (Project Create new item->Dataset) I then  added Elements to the schema using the designer From the toolbox I then created an instance of my dataset. ...
Score Upgrading to SQLServer
John - 29 Jul 2005 8:02 PM - 4 messages
Hi I need to upgrade an access app to sql server, for the first time. In the first phase I would like to upgrade only the backend to save time. Are there any pointers for a newbie to help in the upgraded? ...
Score Fun of INSTEAD OF UPDATE trigger
James Ma - 29 Jul 2005 7:03 PM - 4 messages
Hi All, Here I have a view like this: create view vw_Lcustkeycode as     select *, convert(bit,0) as IsArchived from dbo.Lcustkeycode     union all     select *, convert(bit,1) as IsArchived from ...
Score My table design - where did I go wrong?
Rich - 29 Jul 2005 6:58 PM - 7 messages
CREATE TABLE Sales1 (   varchar (10) CustID,   varchar (10) TransID,   datetime SaleDate,   money  S1,   money  S2,   money  S3,   money  S4,   numeric V1 ) CREATE NONCLUSTERED INDEX Sales1_CustID ON Sales1 (CustID) ...
Score SQLServer 2000 EXCEPTION_ACCESS_VIOLATION SqlDumpExceptionHandler
Kalvin - 29 Jul 2005 5:49 PM - 1 message
I am using SQL Server 2000 Sp 3a.  The following error was generated and no more connections to the DB were possible.  I could still use the machine as long as I didn't try to use SQLServer on the machine.  I ...
Score ODBC timeout error 3146
Chubbly Geezer - 29 Jul 2005 5:03 PM - 1 message
I have an Access 2003 databse with tables linked to an SQL back end. I have a piece of code that creates and attempts to open a recordset on one of these linked tables.  However I get ODBC call failed error 3146 or such like. ...
Score Get DateFormat
MAF - 29 Jul 2005 4:20 PM - 2 messages
Is there anyway to get the system dateformat?  What I am trying to do is get the dateformat, set it to a know format so I can run my script and reset it back to the original format. Psuedo code ...
Score SQL Help: Updating aggregate table
Onnuri - 29 Jul 2005 3:56 PM - 2 messages
Hi, I need an SQL statement help.  I am trying to UPDATE a View table, and this is the error message: "Derived Table '________' is not updatable because it contains aggregates." Is there a way to update the table with aggregates? ...
Score SQL HELP - Hugo Kornelis
MS User - 29 Jul 2005 3:55 PM - 5 messages
Hugo,         I replied with sample data and details you asked , related with Subject ' SQL HELP' on the thread started on 7/22/2005 10:18 A.M Do I have to repost as a New Request to get noticed ?? ...
Score Replace a string across multiple stored procedures
26point2er - 29 Jul 2005 3:08 PM - 5 messages
actually 2 questions. a. Need to replace the string "server name" available on multiple stored procedures p1,p2....p19 with ""? can I do this with an update to system tables like syscomments? b. Can I create a linked server to itself? ...
Score SQLDistribution ActiveX does not reinitializes subscription
SammyBar - 29 Jul 2005 2:49 PM - 4 messages
Hi all, I'm using SQL Server ActiveX replication controls for synchronizing programatically a snapshot type publication to an anonymous subscriber. The subscriber is on a laptop and the idea is when this si connected to the network, and the user wish, it can hit a button on a simple Visual Basic 6 ...
Score update from second table
mcnewsxp - 29 Jul 2005 2:49 PM - 5 messages
how do i make this work?  do i need a join? this works in access: UPDATE tblCaseProfiles, tblProviderInvestigatorProfile SET tblCaseProfiles.NewInvestigator = tblProviderInvestigatorProfile.PI_KEY WHERE tblCaseProfiles.Investigator=tblProviderInvestigatorProfile.IP_KEY; ...
Score When to switch from SWITCH() to JOIN
D Babin - 29 Jul 2005 2:41 PM - 2 messages
This is a rather complex post in which I state my concerns about the performance of SWITCH() and JOIN. I'm writing a utility for use with MS Access databases, generating SQL executed via ADO.  First I create a series of fact tables for most fields ...
Score How to Optimize the Profiler Trace?
Pushkar - 29 Jul 2005 2:37 PM - 2 messages
Hi, I  have four different databases and I need to collect different types of trace event for them. For example DB1 I just need to collect login/logout event. For DB2 I need to collect some other events and so on. ...
Score Releationship between 2 tables which are in 2 different databases
Sevugan - 29 Jul 2005 2:16 PM - 11 messages
Hi,    I have 2 tables namely table1 and table2 and 2 databases namely database1 and database2. table1 is in database1 and table2 is in database2.    I want to define relationship between these 2 tables which are in 2 ...
Score Function to retrieve hierarchical data
Henrik Skak Pedersen - 29 Jul 2005 1:54 PM - 7 messages
Hi, I have a table looking aprox. like this: OrganizationId, ParentOrganizationId, ManagerId My problem is that I would like to show all sub units which a manager is responsible for and not only the ones he is directly manager for. I have ...
Score Is tables created in UDF thread safe?
Dave - 29 Jul 2005 1:11 PM - 5 messages
1) Is the tables being created thread safe.  If 2 users hit this function at the same time, do they each get their own copy? 2) Is there a reason to use 2 tables - One temp and one to return? ...
Score Case in a Where clause
Ivan Debono - 29 Jul 2005 12:56 PM - 6 messages
Hi all, I have the following sql statement (it's ugly and it's not my work!!!). UPDATE  abo_tags SET locked = @PrimaryGroupFilter, locking_user = @user, lockingdate = @sDate FROM    abo_tags INNER JOIN abo ON abo_tags.id_no_abo = abo.id_no ...
Score Seeing the heart of a DTS from a Query Analyzer session*
Enric - 29 Jul 2005 12:10 PM - 5 messages
Dear all, I would like to avoid this time VB Code or any script out of SQL so then, the question is easy: Is it possible go across of a DTS, seeing its global variables, main properties and so on, using Transact-SQL? ...
Score Alter table / update... set - strange problem
master - 29 Jul 2005 11:04 AM - 11 messages
Consider the following TSQL code: ---------------------------- create table #t1 (   f1 int ) alter table add f2 int update #t1 set f2 = 5 ---------------------------- Such a code produces the following error message: Server: Msg 207, level 16, state 1, line 7 Invalid column name 'f2'. ...
Score Delete Statement
Stephen - 29 Jul 2005 9:20 AM - 6 messages
If I have a table like below. Does anyone know how I write a delete statement to delete the Timestamps which are the earliest whenever a FromURN is the same? NO  FromURN  ToURN    MoveDateMerged                    Timestamp     ...
Score Newbee question about permissions and sp_OACreate
JorgenD - 29 Jul 2005 8:38 AM - 7 messages
Hi, I'm creating a trigger that shall monitor a table on inserts and if certain conditions are met, it should send a mail the administrator. I do not want to use SQLmail for many reasons so I'm using the extended ...
Score Administrative task: users and groups
Enric - 29 Jul 2005 8:29 AM - 1 message
Dear all, I am pursuing any solution for an administrative task which once put on production, it cut off a lot of time. I know I've written this request before and maybe I am such a pain (sorry for that) but it's important. ...
Score Can you have one field containing multiple data?
niclascolleen - 29 Jul 2005 8:26 AM - 6 messages
Greetings all! I’m developing a web site where you are able to advertise your summer house for subletting per week. Visitors are able to mark there interest by clicking on a certain week in the interface. This being the background I have trouble deciding on how to design the ...
Score Building an SQL statement in a Stored Procedure
Ivan Debono - 29 Jul 2005 8:18 AM - 7 messages
Hi everybody!! The title says it all!!! Joking aside, I need to build an SQL statement by concatenating fields and parameters and if conditions and then execute that sql statement within the same SP. Is this possible, and if yes, how exactly? ...
Score RE: Peculiar Crosstab Query
John Bell - 29 Jul 2005 7:59 AM - 1 message
Hi You may want to evaluate the appropriateness of your datatypes! Have you seen the article by Itzik Ben-Gan on dynamic crosstabs at [link] John ...
Score Select on a table can be audited?
Pushkar - 29 Jul 2005 5:40 AM - 8 messages
Hi, I have requirement to audit all the select that had happened to particular set of tables. But I am not clear which apporach should I follow. Currently I am trying through profiler and tracing stmt:completed event in the profiler and then try to parse that query to find whether it was a select query and find out the tables in that query. ...
Score How to process cubes using VB
celjavier - 29 Jul 2005 5:30 AM - 3 messages
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 ...
Score Distributed Transaction Over TCP/IP
Young, Corey - 29 Jul 2005 3:56 AM - 6 messages
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. ...
Score Getting rid of unwanted characters!
KB - 29 Jul 2005 3:17 AM - 4 messages
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? ...
Score Truncating logs with a PHP script
Chin - 29 Jul 2005 2:59 AM - 3 messages
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 ...
Score Cursor logic vs. set based solutons
Phil396 - 29 Jul 2005 2:21 AM - 4 messages
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 ...
Score JOIN Process Order and Performance Comparisons
HardKhor - 29 Jul 2005 2:12 AM - 3 messages
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 ...
Score Dynamic AND!
Adam Knight - 29 Jul 2005 1:41 AM - 4 messages
Hi all, I am wanting to add an optional and statement to a query. Not quite sure how to go about it. My attempt so far: SELECT bsc_assmnt_area_id, name, parent_id FROM bsc_assmnt_areas WHERE parent_id = @pid CASE WHEN parent_id = 0 Then And mine_id = @mid ...
Score Extracting and converting text fields.
amb - 28 Jul 2005 11:04 PM - 4 messages
Hi All I have a bug where a text field is saving text to a limit of 256 characters, which is no where near enough.  The table structure is an ID with an identity Int, and a field called responseText. ...
Score Is it possible ?
marta - 28 Jul 2005 10:54 PM - 3 messages
Hi I have users in domain group who use application which uses sqlserve, they have rights to insert, update, delete. I want some of the members of this domain group to connect directly to the database using query analyzer but ...
Score SP to document maintenance plan ?
Simo Sentissi - 28 Jul 2005 10:24 PM - 2 messages
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 ...
Score Re: Access Update Query Problem
Stu - 28 Jul 2005 10:13 PM - 6 messages
Are you comparing apples to apples?  In your VBA code, are you executing the same join syntax that you are trying to excute through the Access GUI.  I have a suspicion that you are not, and the reason ...
Score view sql statement via trigger
Bahman - 28 Jul 2005 10:00 PM - 5 messages
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 ...
Score temp table vs normal table
Dave - 28 Jul 2005 7:54 PM - 1 message
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? ...
Score temp table vs normal table
Dave - 28 Jul 2005 7:54 PM - 1 message
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? ...
Score temp table vs normal table
Dave - 28 Jul 2005 7:54 PM - 6 messages
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? ...
Score Running queries on queries
A.B. - 28 Jul 2005 7:16 PM - 2 messages
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 ...
Score Finding a tape drive
John J. Hughes II - 28 Jul 2005 6:55 PM - 6 messages
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 ...
Score OPENXML - element has _xpath in name
A Lowly Tech - 28 Jul 2005 6:46 PM - 2 messages
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) ...
Score Stored Procs vs VIEWS: Seeking Comparison
Joseph Geretz - 28 Jul 2005 5:53 PM - 31 messages
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? ...
Score where logic selection
sqlster - 28 Jul 2005 5:31 PM - 3 messages
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) ...
Score How to find gaps in sequential key
D Babin - 28 Jul 2005 5:04 PM - 22 messages
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 ...
Score Tax calculation net to gross.
Martin - 28 Jul 2005 4:53 PM - 3 messages
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 ...
Score boolean programming
sqlster - 28 Jul 2005 4:26 PM - 22 messages
Is bit the closest to the boolean (true or false) datatype in tsql? Even though it could be 0,1,null?? TIA ...
Score Scheduled job "show step details" more info?
Dave - 28 Jul 2005 4:11 PM - 5 messages
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 ...
Score Uniqueidentifier GUID question
Amil - 28 Jul 2005 4:08 PM - 10 messages
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? ...
Score CHECK
ReTF - 28 Jul 2005 4:05 PM - 5 messages
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. ...
Score Why does the stored procedure behave differently?
Amil - 28 Jul 2005 4:01 PM - 9 messages
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 ...
Score Trim leading 000 from varchar field
Unix_to_Windows - 28 Jul 2005 4:00 PM - 8 messages
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? ...
Score Convert varchar to numeric
Terri - 28 Jul 2005 3:59 PM - 2 messages
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 ...
Score Simple SELECT statement???
Tim::.. - 28 Jul 2005 3:36 PM - 9 messages
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 ...
Score Parsing a SQL Query
Pushkar - 28 Jul 2005 3:18 PM - 2 messages
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. ...
Score Custom 'Order By' Function?
hals_left - 28 Jul 2005 3:00 PM - 3 messages
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 ...
Score cross-section select
simon - 28 Jul 2005 2:38 PM - 5 messages
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                        2 ...
Score numeric data
Jon - 28 Jul 2005 2:27 PM - 2 messages
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. ...
Score DB to DB sp
Emmanuel - 28 Jul 2005 2:26 PM - 6 messages
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 ...
Score Replace temp table with inline table-value function
Mike Jansen - 28 Jul 2005 2:22 PM - 5 messages
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 ...
Score Passing a Table var as an input/output parameter
João Costa - 28 Jul 2005 2:19 PM - 10 messages
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, ...
Score Permissions problem
Chubbly Geezer - 28 Jul 2005 2:15 PM - 5 messages
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. ...
Score Creating a trigger using a cursor
jaylou - 28 Jul 2005 2:01 PM - 16 messages
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 ...
Score Error message in a job, SQLSTATE 42S02 (Error 208)
Blasting Cap - 28 Jul 2005 1:52 PM - 6 messages
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 ...
Score JDBC client - CURSOR as OUT parameter -supported ?
Subbu - 28 Jul 2005 1:45 PM - 14 messages
The following is our query: Product: SQL Server 2000 Driver for JDBC Service Pack 3     We want to know whether this driver supports cursors as output parameters in a stored procedure. If it does not support, is there any suggested ...
Score RUE._What's_wrong?
Klaus - 28 Jul 2005 1:36 PM - 9 messages
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) ...
Score querying the data dictionary
Dwayne King - 28 Jul 2005 1:35 PM - 6 messages
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: ...
Score Stop a DTS Package
Kevin - 28 Jul 2005 1:08 PM - 3 messages
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). ...
Score DATABASE Testing
Lara - 28 Jul 2005 12:11 PM - 3 messages
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 ...
Score DYNAMIC USE
Enric - 28 Jul 2005 11:56 AM - 5 messages
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 ...
Score Trouble using Table data type
João Costa - 28 Jul 2005 11:30 AM - 14 messages
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 ...
Score Trigger problem
Fred - 28 Jul 2005 11:14 AM - 5 messages
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. ...
Score OPENROWSET MSDASQL Microsoft Text Driver
Subramaniam Sivakumar - 28 Jul 2005 11:01 AM - 3 messages
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. Because the source ...
Score Ciclic Foreign Keys?
Martin Hart - 28 Jul 2005 10:42 AM - 4 messages
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 ...
Score system stored procedures output
Enric - 28 Jul 2005 10:29 AM - 6 messages
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. ...
Score Three ways for do the same
Enric - 28 Jul 2005 10:24 AM - 8 messages
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 = ...
Score update statment problem
Agnes - 28 Jul 2005 9:50 AM - 3 messages
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 ...
Score several locations for datafiles
Enric - 28 Jul 2005 9:46 AM - 7 messages
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? ...
Score Combination of "=" and "like" in a SELECT statement
Kriste L - 28 Jul 2005 9:44 AM - 5 messages
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 ...
Score UNION and minusing 3rd result set
Khurram Shahzad - 28 Jul 2005 9:29 AM - 5 messages
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 ...
Next »