Home All Groups Group Topic Archive Search About

SQL Server database programming

microsoft.public.sqlserver.programming
Score Can any one help me with this SQLXML 3.0 SP3 Problem?
Grant Smith - eNVENT Technologies - 12 Nov 2005 11:32 PM - 8 messages
I'm having a problem with SQLXML. I have written a small VB.NET application to manipulate xml files and import them into an SQL Server database. Every time I run the application, the import fails. The error log contains the following xml: ...
Score Variant to Decimal type
Scott - 12 Nov 2005 10:10 PM - 4 messages
My code returns 48 because I'm setting @mypercent as an integer. I need it to return 1 decimal point and return 48.2. I tried different decimal types but got errors. What should my final line of code be to return 48.2? ...
Score Stored Procedure Problem (Bug?)
Gary Harding - 12 Nov 2005 8:57 PM - 12 messages
Hello We're using SQL Server 2000 SP3 on Windows Server 2003 (no SP) with 24 Windows XP Pro SP2 clients. We have a stored procedure which allocates sequence numbers from a table. It's called frequently, and concurrently, by code running on clients and on ...
Score Executing stored procedure against openxml rowset
CJ - 12 Nov 2005 6:51 PM - 7 messages
Im trying to run a batch user account process where a chunk of xml would define user account info to create a set of new accounts against one database call.  Something like this.. <accounts>      <account user="testAcct1" pass="testPass1" type="LN"/> ...
Score INSERT INTO...WHERE (copy rows from table into same table)
GW - 12 Nov 2005 6:48 PM - 5 messages
Trying to copy rows into new rows but changing the first column id to sNewASMM which is entered by the user. There are several rows with the sSourceASMM ID. Table is indexed on inkasmm, inkprod. sSQL = "INSERT INTO INKT" _ ...
Score Convert DateTime to NVARCHAR
refdk - 12 Nov 2005 5:03 PM - 3 messages
Hi, My test table looks like this: 1    Id                 int    4    0 0    DateTimes       datetime    8    1 ...
Score Help with SELECT statement
Niclas - 12 Nov 2005 3:33 PM - 4 messages
Hi, I have two tables with a UserID column and need to construct a query that lists all UserIDs from Table A that is not present in Table B. Any help with this select statement would be appreciated Niclas ...
Score SqlDumpExceptionHandler: Process 52 generated fatal exception c0000005 EXCEPTION_ACCESS_VIOLATION. S
Peri - 12 Nov 2005 12:57 PM - 2 messages
Dear All, I am facing this peculiar problem in SQL server. ODBC: Msg 0, Level 19, State 1 SqlDumpExceptionHandler: Process 52 generated fatal exception c0000005 EXCEPTION_ACCESS_VIOLATION. SQL Server is terminating this process. Some times the process is coming as 80, 65 and 59. If this error comes then ...
Score automagical calculation of a field value
Jan Rösner - 12 Nov 2005 12:56 PM - 4 messages
Hi All, I have a table "AggregatedSales" which has a column called "AggregatedSales.YearSum". This column should contain a sum which can be derived directly from another table called "Sales" by summing up all values of "Sales.Price" WHERE "Sales.Year" = 2005. ...
Score create new table from base table
barcode - 12 Nov 2005 12:48 PM - 4 messages
Hi, I am trying to create a new table from an existing base table. The base table isn't normalised in any way. The table was given to me and that's what I have to work with. The problem is that parent ids can have ...
Score How to restore Values to Table based on some Query
vinoth - 12 Nov 2005 12:19 PM - 2 messages
Hi,    I have a table called A and another Table Called B. A table has the following Column and Values ID        One         Two       Three ...
Score SP succeeds but returns error
Hoof Hearted - 12 Nov 2005 9:15 AM - 10 messages
A have a stored procedure which finds an unused record in a table and then populates it with data. When I call it from MS Access, it does exactly what it is supposed to, but it returns error code -2147467259 - unspecified error. ...
Score Programming SSIS - AttachPathAndPropagateNotifications problem
Slawomir Zurek - 12 Nov 2005 6:46 AM - 1 message
Hello, I'm trying to build SSIS package from my application, and encountered a big performance problem - AttachPathAndPropagateNotifications method semm very slowly when Dataflow contains some more components. Below description of my scenario: - i'm building SSIS for transform facts table to my data warehouse; its ...
Score GETDATE
Chris Lane - 12 Nov 2005 5:35 AM - 5 messages
I have a database that contains, amongst others, the following fields DocNo, DocDate, DocAmt I need  to extract the data in the these fields, but only where the date (in yyyy-mm-dd format) is equal to the current date.  In other words, I need a ...
Score Abstract DTS
Toff McGowen - 12 Nov 2005 3:28 AM - 3 messages
Hello I have a DTS package that loads an Sql Server Database with data from MS Access datasource. The package works fine but I want to be able to change either the source or destination connection or both (for reuse purposes) and ...
Score Select in transaction??
ReTF - 12 Nov 2005 3:05 AM - 5 messages
Hi All, I did read that I cant put SELECT in one transaction, but I need put one SELECT in one transaction(see code), because I need have certainty that this SELECT was executed, how I should do this?   BEGIN TRANSACTION ...
Score Introducing (NOLOCK) into production code for Selects
jkotuby - 12 Nov 2005 2:15 AM - 4 messages
I have a large application that is multi-user and quite transactional, driven by a VB front end. It uses mostly stored procedures for retrieving data. I was running into locking contention on tables with 300,000 to 2 million records that are read and ...
Score www.dvd100.net ** SIN CANON** CDS Y DVDS Visitanos!! 518C
maria - 12 Nov 2005 1:39 AM - 1 message
--- Codi motesarit nocemoti lirenisovav so tavo nomililedoc finise gitewefas xelem riyifomo tegacecama . ...
Score sp_executesql syntax
Scott - 12 Nov 2005 1:36 AM - 9 messages
In FIGURE 1, my code works fine, allowing dynamic fields to be passed. My attempt in FIGURE 2 was to have 2 WHERE parameters and  an IF test that allows changing the @field and @result variables because different fields ...
Score INSERT INTO
Roy Gourgi - 11 Nov 2005 11:34 PM - 4 messages
Hi, I am tryng to insert a row into an SQL 2005 database, but it is not working. I am not getting an error messsage, rather it is just not adding the row. I have added the Data Source and made the database connection. What am I doing ...
Score using UDF in 'IN' clause
barcode - 11 Nov 2005 11:25 PM - 17 messages
Hi, I am desperate for some help on an issue I have with using an udf in a select statement. The udf can return mulitple comma delimited values e.g. 14123,12312 I am using the following (simplified) query: select distinct firstname, lastname, number ...
Score Service Broker Conversation Timer
William Stacey [MVP] - 11 Nov 2005 11:24 PM - 4 messages
How is Conversation Timer () Timeout = 60; handled internally?  Does each call start a new system timer?  Or is one time used that always waits for the "least" time for all waiting conversations?  TIA ...
Score SMO can't connect to 7.0?
Johnny Ortega - 11 Nov 2005 10:48 PM - 3 messages
I've installed SQL Server 2005 RTM and using Microsoft's sample on connecting using SMO, I tried connecting to a SQL Server 7.0 server. I received this error: "This SQL Server version (7.0) is not supported". Huh?! BOL says SMO supports 7.0. ...
Score The uninstall of sql server 2005 beta and visual studio 2005 is a mess
=== Steve L === - 11 Nov 2005 10:12 PM - 10 messages
there are numerous complains about it on the net. mostly about ....incompatible beta components... ....can't find .Net Framework 2.0 (hello?! but which version!???)... v2.0.40607? v2.0.40903? v2.0.50215? v2.0.50727? ....could not be located in the dynamic link library..... ...
Score Table results from Exec - Within a UDF
adi - 11 Nov 2005 9:21 PM - 5 messages
Hi all,    I have a question on how to obtain the results of a exec out of a UDF/Stored Proc? Currently I haev a UDF that builds a select statement and executes it using the [I wanted to return the Statement itself, but was too big for varchar] ...
Score Why would my trigger require IISReset?
trufaux - 11 Nov 2005 8:52 PM - 5 messages
What follows is a trigger I wrote to mirror the MbfUser to the MbfRole table in my Business Portal database.  I send a report to one of these roles and for some reason it doesn't show until after I do an IISReset on my server. ...
Score Values from an update within a transaction visible to other connection ??!!
Christian - 11 Nov 2005 8:31 PM - 8 messages
Hi all, I am new to the forum, I am having a weird issue here. I have a stored procedure that 1. Insert data, 2. update data 3. delete data all 3 operations are within the same Begin Transaction/Commit and on ...
Score Using MSMQ from CLR Stored Procedure
David S Platt - 11 Nov 2005 8:28 PM - 5 messages
I am trying to use MSMQ from within a stored procedure that I've written in C#. When the data in a table changes, I want to post MSMQ messages to remote clients telling them that the data has change as of that time, so that the ...
Score Database Stuck In LOADING
A. Robinson - 11 Nov 2005 8:03 PM - 3 messages
I'm performaing a restore of a database and am encountering some odd behavior. The resore has been running since 10:00 this morning...! It should not have taken more than an hour to complete. The database continually shows a status of LOADING. I've even stopped and ...
Score Return Available appointments
msdnbuddy - 11 Nov 2005 8:01 PM - 6 messages
I am upgrading an application that another developer wrote.  Basically, it is an application used to display appointments / request appointments.  The new request is to display available appointments.  That is where I need help in figuring out how to return available time slots. ...
Score Generate SQL Scripts
myronschroner - 11 Nov 2005 7:59 PM - 7 messages
Hi all, In Enterprise Manager, I could right click on a database and "generate SQL Scripts" for hundreds of objects at once.  In 2005, though, I've only been able to generate scripts one at a time in Object Explorer, ...
Score Re: Stored Procedure Terminating Prematurely [Revisited]
Fred Foozle - 11 Nov 2005 7:48 PM - 1 message
At one point there was a topic with this subject that I posted on 05-Oct-2005. I have refined the criteria to reproduce the problem that I have observed.  This problem appears to be an ODBC problem.  I have posted a ...
Score Consecutive values
Jerry Spivey - 11 Nov 2005 7:26 PM - 9 messages
Hi, Given the following dataset, how can I determine the maximum number of consecutive Bs for a given A? A B - - 2 1 2 2 2 7 3 2 3 3 3 4 3 6 3 8 3 9 3 10 ...
Score Random number generation with seed value
Sai - 11 Nov 2005 7:03 PM - 12 messages
I have to generate random number with a given seed value. I am able to do that, except that the values genered in SQL Server is not matching the same random values generation in VB with same seed value. In VB I am doing the following ...
Score SQL Transactions
Jay - 11 Nov 2005 6:34 PM - 4 messages
I have the stored procedure below that I am using from asp.net.  To test things out I changed a table column name so it would fail.  I got the error below.  Furthermore, it hung my database so I had to stop SQL Server and ...
Score SQL Server International Learning Survey.
Alan Brewer [MSFT] - 11 Nov 2005 6:12 PM - 1 message
If you live outside of the United States or Canada we want to know more about your experience learning about SQL Server. How did you initially learn to use SQL Server? What are your preferences for learning about new features? What can we do to make SQL Server easier to ...
Score Does Commit Transaction delete Temporary table?
adi - 11 Nov 2005 5:52 PM - 3 messages
Hi SQL Guru's,     I create a global temp table in one of my procedures: select * into ##temp_update from ( select distinct * from ...... after this I issue a commit transaction, and when I try to select from the table I created (from my .Net code or Query Analyzer) it is not ...
Score Bad characters in strings
.... - 11 Nov 2005 5:52 PM - 2 messages
Hi We have a problem whereby a particular application is writing certain ascii characters to our table which is causing an issue in another application. Obviously the solution is to fix the application, but it's taking some time. In the meantime I'm trying to develop a trigger to fix the data.  I have a ...
Score Query Help
dotnettester - 11 Nov 2005 5:32 PM - 2 messages
Hi, I have two tables Products ---------- ProductId ProductTitle Bids ----- BidId ProductId BidAmount BidderName I want to grab all the products with the highest bidAmount and the BidderName. There could be multiple bidders for each product. ...
Score Compute sum of count(*) with group by
J Williams - 11 Nov 2005 5:30 PM - 9 messages
Hi, Given the following table and test data: CREATE TABLE test (     recordId numeric(18, 0) NOT NULL,     spId int NOT NULL,     startTime datetime NULL,     endTime datetime NULL ) INSERT INTO test VALUES (1,1,'2005-01-01 12:00','2005-01-01 14:33') ...
Score Copying records from one table to another
tshad - 11 Nov 2005 5:25 PM - 9 messages
I have a lot of templates that I copy from table to another, but ran into one table where I am having trouble. I normally do a copy like so: INSERT table2 (field1, field2) SELECT field1, field2 FROM table1 This works fine most of the time where I take all the data from table 1 and ...
Score sql server 2005 quoted_identifier don't work
Roger - 11 Nov 2005 5:21 PM - 3 messages
Hi all I am using sql server 2005 and I try this: set quoted_identifier on go select "roger" and I receive a error: Msg 207, Level 16, State 1, Line 1 Invalid column name 'roger'. Why ??? ...
Score How to get a Single Record's Data from SQL server
Kirk - 11 Nov 2005 4:55 PM - 3 messages
I currently have a VB.NET application that gets record information from a SQL database.  When it finds this information, it is placed into a dataset.  I know I will only get one record because I am querying based ...
Score How to Remove '-' from QAA -
Disney - 11 Nov 2005 4:41 PM - 4 messages
Can someone help me with a query that removes the '-' from as string QAA - Thanks ...
Score How to find current database
Boaz Ben-Porat - 11 Nov 2005 4:20 PM - 4 messages
Is there a way to find out what is the current database? In Query analizer, you execute "use <db-name>", and you can se the current database in the combo box. Is the an SQL command to find currrent database ? ...
Score @@ERROR in mult thread environment??
ReTF - 11 Nov 2005 3:57 PM - 2 messages
Hi all, I would like know if I can use @@ERROR to error in mult thread environment? For sample: If this SP is executed by 2 threads in same time, I wiil have correct value in @@ERROR Thanks IF EXISTS (SELECT name ...
Score Grouping two similar column names but different data?
John - 11 Nov 2005 3:42 PM - 5 messages
Hi All, I have a need to group a column with he same name. I have a column called "AccountType" which has data such as : A1 A2 A3 A4 I am using an aggrate for this column: SELECT SUM (CASE WHEN AccountType = 'A1' Then 'Good' END) AS [Account Type] ...
Score Case Statement(Help Please)
Ray - 11 Nov 2005 3:05 PM - 5 messages
I am trying to use a case statement to pull bad phone numbers out of my company table into a readable format.  I am using SQL Server 2000 SP4. The phone numbers, in my inherited database, are in any number of formats, ...
Score Help with Update from Child table
hals_left - 11 Nov 2005 2:53 PM - 4 messages
I have two tables tblInvoice and tblInvoice Line. Both tables have a column InvoiceID that is Primary / Foreign Key . tblInvoice  has a column TransType char(2) 'SI' or 'SC' I have now added this column to tblInvoice and want to update the ...
Score Change in Job Execution - SQL Server 2005?
Amos Soma - 11 Nov 2005 2:48 PM - 2 messages
I just converted a SQL Server 2000 database to 2005. I have a job whose only step does the following: Declare @Command char(240) Set @Command = '\SDBS\Scheduler\Scheduler.Exe '  + Convert(char(50),Convert(uniqueidentifier,[JOBID]))  +  ' ' +  (Select ...
Score Automate Importing File
David Lozzi - 11 Nov 2005 2:45 PM - 12 messages
Hello, I need to automate importation of a excel file into a table. Here's my scenario: I'm writing an ASP.NET application where users can pull reports on imported data. The imported data is pulled from an old UNIX based system, ...
Score concurrency in stored proc
Bob - 11 Nov 2005 2:21 PM - 47 messages
I am trying add an item to a table that does not allow duplicates but if the item already exists I want to return its id.  I need an SQL equivalent to a critical section but I am not sure how its done.  It would like something ...
Score SQL Server & JSP, JDBC etc
Ronan Maddock - 11 Nov 2005 12:53 PM - 5 messages
Hello, I'm currently studying SQL Server in college and have been asked to find out how SQL Server uses JSP, JDBC, SQLJ & XML in the context of database applications.  Try as I might,  I cannot seem to get any info on this.  I ...
Score Why isn't this working?
Morten Wennevik - 11 Nov 2005 12:29 PM - 8 messages
Hi, Given a set of rows with RowID from 1-499 I want to return the last ten rows in ascending order, 490, 491, ... , 499 SELECT * FROM (    SELECT TOP 10 * FROM Import WHERE RowID >= 1 ORDER BY RowID DESC ...
Score Database Snapshot (SQL Server 2005)
Leila - 11 Nov 2005 11:59 AM - 5 messages
Hi, ------- Sorry for posting my question in this group. Isn't Micsrosoft going to create new forums for SQL2K5? ------- BOL states that the snapshot file(sparse file) is small when it is created, and gradually grows. But I tried on my databases (even big ones) and its ...
Score unidentified entry in profiler
Jose G. de Jesus Jr MCP, MCDBA - 11 Nov 2005 11:44 AM - 4 messages
can anyone pls tell me what this thing do insert bulk dbo.test ...
Score concatenation
marcmc - 11 Nov 2005 11:26 AM - 3 messages
could you give me a dig out with this concatenation, it's driving me nuts declare @ev_bat_desc varchar(50), @text varchar(100) select  @ev_bat_desc = 'CQA_cmdmgr_Marc.bat' -- select     'c:\psexec \\10.2.27.230 -I ' + @ev_bat_desc + ' ;' -- emulate ...
Score How to reverse a reverse order by?
Morten Wennevik - 11 Nov 2005 11:24 AM - 9 messages
Hi, using the statement SELECT TOP 10 * FROM Import WHERE RowID >= 1 ORDER BY RowID DESC I get the last 10 rows in the Import table as expected, but how to I reverse these last 10 rows? Morten ...
Score auditing
uros - 11 Nov 2005 8:47 AM - 4 messages
I have another question. I want to create audit table with columns (userID, date, tableAffected, ColumnAffected). This table should have data from tables that I want to trace. It easy to collect data about time and users, but I don't know how to collect data about ...
Score Need Help Denormalizing Several Tables
ViLo - 11 Nov 2005 8:41 AM - 7 messages
Hello everyone, I need to figure out how to de-normalize several one-to-many relationships into a single row of data. For reference, here is a small sample of the Normalized Tables: Tabe Artist ----------------------------------- AristID int not null identity, ...
Score Cursor working in this stored Procedure??
marlenee - 11 Nov 2005 8:21 AM - 12 messages
Hi I need some help with my cursor in a stored procedure in SQL Query Analyzer, please.  It takes so long to finish, that I break out of it every time and I can not see if it actually works.  What it needs to do ...
Score Can't you have a variable TOP in a select statement?
Morten Wennevik - 11 Nov 2005 8:15 AM - 4 messages
Hi, I got a stored procedure like this CREATE PROCEDURE dbo.readImport (     @Start INTEGER,     @Number INTEGER ) AS SELECT TOP @Number * FROM Import WHERE RowID >= @Start ORDER BY RowID GO However, it doesn't seem to like having an unknown @Number. ...
Score Always selecting at least 10 rows?
Morten Wennevik - 11 Nov 2005 7:46 AM - 7 messages
Hi, I use an Identity column to create row numbers displayed in a DataGrid.  The datagrid typically displays row 1-10, 11-20 etc.  The datagrid is filled using SELECT * FROM Tabel WHERE RowID BETWEEN Start AND End. ...
Score SQL statement performance
Atenza - 11 Nov 2005 6:03 AM - 5 messages
Hi all, I have the following sql: SELECT     a.fieldA, b.fieldB, c.filedC,     dbo.fn_A(1, a.fieldA, b.fieldB, c.filedC) as testField FROM tableA a     INNER JOIN tableB b ON ... ...
Score trigger on system table
chaujohnthan - 11 Nov 2005 5:44 AM - 6 messages
i can add trigger to system table by changing sysobject records. but it doesn't fire. this is really needed, why not? ...
Score Best solution, iterate over millions records and call extended sp
nick - 11 Nov 2005 5:43 AM - 11 messages
Hi, I need to iterate over millions rows in a table and I need call an extended stored procedure (written in C++ and not possible be written in TSQL) using the columns of each row as parameters and write the return values to an new ...
Score SET NOCOUNT ON but still receiving "Operation not allowed when the object is closed" error
Frank Dean - 11 Nov 2005 4:21 AM - 7 messages
I'm accessing a SQL Server 2000 stored procedure with ADO and I get the error message: "Operation not allowed when the object is closed" I know to add "SET NOCOUNT ON" to the procedure (that usually solves the problem) but in this case it didn't. ...
Score Log Shipping or something else?
asawyer - 11 Nov 2005 12:49 AM - 3 messages
Here's my scenario. I have two sql servers, one located in another state, but connected via a continuous vpn so it really looks like it's always on my network. I only make changes to the sql server on the remote server, but I want the ...
Score Field Name variable
Scott - 11 Nov 2005 12:11 AM - 6 messages
I'm trying to use sField as a variable for a field in the [Order Details] table in Northwind, but having trouble with syntax. Can anyone shed light on a solution? CODE: declare @orderID int declare @sField Char(40) set @orderID = '10248' ...
Score Insert failing with RPC call between 2 SQL 2000 boxes
Steve - 10 Nov 2005 11:47 PM - 3 messages
Hi, After following the Books Online instructions to setup a remote procedure call: "How to set up a remote server to allow the use of remote stored procedures (Transact-SQL)" The 2 boxes are in same WORKGROUP and sa passwords are the same. ...
Score Refering to tables in other databases via views
Craig HB - 10 Nov 2005 11:26 PM - 3 messages
Stored procedures on our SQL Server often refer to tables in other databases. eg. create proc Proc1 as UPDATE OtherDatabase..Sales SET Flag = 1. We want to change things so that when a table in another database is referred to, it only happens in views and then the stored procedures refer to ...
Score Merging data
karagias - 10 Nov 2005 11:03 PM - 2 messages
I am creating a stored procedure. I want to merge data from 3 tables. 1. schedule_rohan = contains hours available in the schedule according to day 2. appointments_rohan = contains appointments 3. patients_rohan = contains patients For example, I have the following as my select statement: ...
Score Need to query whether a column is identity
Juan Dent - 10 Nov 2005 10:56 PM - 5 messages
Hi, I am desperately seeking for a query that I may issue against SQL Server2000- that will tell me whether a column is identiy or not!! Please help!! ...
Score USE statement
Joe from WI - 10 Nov 2005 10:49 PM - 8 messages
In a script or stored procedure, you can change your database context with the USE statement.  For example, USE pubs. How do I do that dynamically? For example, a stored procedure is executing in the pubs database.  Based on ...
Score Enable/Disable Trigger
Joe K. - 10 Nov 2005 9:30 PM - 4 messages
I have a stored procedure disable and enable triggers on several tables. What would be a workaround to using the alter table with disable and enable triggers listed below. Thanks, CREATE PROCEDURE dbo.K_ManualMoves as BEGIN alter table T_Moves disable trigger iu_t_Moves ...
Score CADORecordBinding ... adDate
beginthreadex - 10 Nov 2005 9:09 PM - 3 messages
I am using RecordBinding from VC++ successfully against a SQL server 2000 database. My issues revolve around getting datetimes from SQL into anything readable in VC++ as a date/double/ULARGE??? variable. Right now I can put this data into a double but the data is not able to be parsed. There does ...
Score Extracting currency symbol and measurement units using tSQL
mukesh bhakta - 10 Nov 2005 9:06 PM - 4 messages
Hi guys, Does anyone know how to extract the currency symbol and measurement unitsusing an ISQL query? For instance, in .NET I can very easily do the following -Thread.CurrentThread.CurrentCulture.NumberFormat.CurrencySymbol and System.Globalization.RegionInfo.CurrentRegion.IsMetric Is such a thing possible under SQL Server? ...
Score Flag a record
Patrice - 10 Nov 2005 9:02 PM - 2 messages
Given the following record set, how can I "Flag" the first payment record (Typecode = 'P') so that it has satisfied the     "Fire_Fee_Recvd" In other words when a payment comes in, the billed fire fee amount is to be ...
Score Error msg in OLD DB provider
Roy - 10 Nov 2005 8:09 PM - 3 messages
I use OLE DB to call a series of stored procedures to add records to database tables within one transaction. I got the following errors: Description: Cannot create new connection because in manual or distributed transaction mode. Source Description: Microsoft OLE DB Provider for SQL Server ...
Score Where to Download Reporting Services?
Fao, Sean - 10 Nov 2005 8:00 PM - 6 messages
I just heard about Reporting Services and it sounds like something I could use, but I can't find it anywhere.  Is it a free download?  If so where can I download it?  Otherwise, where to I get it? ...
Score Create Trigger Help
Test Test - 10 Nov 2005 7:58 PM - 5 messages
Hello! I want to create an update trigger on table "A". What I want is to udpate the "status" and "submit_date" flds in table "A" if it meets the criteria. See below the udpate statment which works. I dont know how to ...
Score Locking Row
Vai2000 - 10 Nov 2005 7:16 PM - 3 messages
Is there a way I can prevent a specific user from updating a specific row to a Table...? TIA ...
Score Tables/DB Names ----JOBS in SQL Server???
Steve - 10 Nov 2005 7:10 PM - 2 messages
Hi, Once we create job job in SQL Server & if it fails then we can view the job history for the failure message.  In what Database & table does this message get stored.  Is it stored in MSDB or Master database?  & in which table. ...
Score CASE statement with an IN
louise raisbeck - 10 Nov 2005 6:48 PM - 6 messages
hi there, I am trying to do this, it would simply my sql so much, but the syntax won't parse. DECLARE @Tmp varchar --@Tmp will either be cow or pig after something done here, lets say pig for simplification.. ...
Score Mental Block
John - 10 Nov 2005 6:48 PM - 4 messages
Can some please help with this SQL problem: I have tables in select query and i want to show all dbo.TblTerritory.Description even is there is no data in the other columns, ie there are no  records of type 'lost' in ProjectStatus ...
Score just a quick key question
Lynn - 10 Nov 2005 6:46 PM - 7 messages
Just looking for general feedback --- I've been asked to create a unique key for a table.  The problem is, it's based on three rather wide attributes...2 varchar(50)'s and a smalldatetime.  apparently this is the only combination ...
Score Get Current Year
scott - 10 Nov 2005 5:59 PM - 6 messages
When I run below code, I get Jun 29 1905 12:00AM. How can I get 2005 as the current year? CODE:     SET @dtYear = DATEPART(yy,GetDate())     PRINT  @dtYear ...
Score BAFFLED! -- Why won't this code work?!?!
Butaambala - 10 Nov 2005 5:52 PM - 7 messages
Hello, The below code is intended to create a sp, then loop through a set of values, each time running the sp with the new value.  The CREATE PROC executes fine, but I get an error when attempting the loop:  "Invalid ...
Score convert INT
Joey Martin - 10 Nov 2005 5:46 PM - 9 messages
I am writing a sql statement similiar to: select * from testtable where id in (select id from anothertable). The ID field in anothertable is int whereas the ID field in testtable is varchar(originally created by someone else). 99% of the data in the ID field of testtable is an INT, so I usually do ...
Score analize sp
JFB - 10 Nov 2005 5:11 PM - 3 messages
Hi All, I have an store procedure with a 100 and some lines, and I want to analize the result from another sp. How can I get the values to do a select statement? create procedure myPro As     select * from orders bla... ...
Score SQL Select help
SteveInBeloit - 10 Nov 2005 5:05 PM - 2 messages
I have a table that may have one to many rows.  I need to alert the users if one of the columns of this table does not contain the same value for all rows.  Say the column is 10 for the first row, 5 for the second, and 10 the the remaining 3 rows.  I just need to tell them that there is a difference. I can't quite get a Select statement that will tell me this. Any thoughts? Thanks ...
Score T-SQL Variables
orourksj - 10 Nov 2005 5:05 PM - 4 messages
I am trying to select for an insert. I have pasted the attempted code below that I have used for testing purposes. Query Analyzer will not accept the 'top' and a variable. I have tries Casting and converting even though i have ...
Score T-SQL Select help
SteveInBeloit - 10 Nov 2005 4:53 PM - 4 messages
In a stored proc, I have a table that may have one to many rows.  I need to alert the users is one of the column of this table does not contain the same value for all rows.  Say the column is 10 for the first row, 5 for the ...
Score DTS or stored procedure
Spike - 10 Nov 2005 4:44 PM - 3 messages
I need to copy some rows from a table in one server to a table in another server.  The amount of data is not very large and nothing fancy happens to the data on the way. Does anyone have any advice on the reletive merits of DTS as opposed to just ...
Score A difficult Combining Rows problem
Factor - 10 Nov 2005 4:42 PM - 18 messages
Greetings, I'm working to combine rows based on a time window and I am hoping to be able to write a stored procedure to do this for me, rather than have parse through all this data in my program.  I'm not very well versed ...
Score SQL Server Agent
MS User - 10 Nov 2005 4:39 PM - 2 messages
SQL 2000 Today few of our SQL jobs failed with 'Performing Completion Actions' and couldn't  re-start . I tried stop/start SQL SERVER AGENT , but the agent is in Starting status and never came back. Finally I was forced to reboot the server. ...
Score Stored Procedure Parameter problem
the_kiddie98 - 10 Nov 2005 4:20 PM - 4 messages
Hi,    I have a stored procedure which returns values from a table. I want to be able to pass it a parameter which it should ignore if it is 0 but include in the where clause if it is 1. ...
Score retrieving BCP number of rows process
Tomas - 10 Nov 2005 3:41 PM - 3 messages
Thank you in advance I am trying to retrieve the number of row that BCP process upon completion,also how to find out what errors have occured when using the BCP command. thank you tomas ...
Score Identifying Locking Login
david.parenteau - 10 Nov 2005 3:39 PM - 3 messages
Hi! I'm facing a big problem. About 10 persons are working on a ssingle database that serve an application. The Search screen for "Reservation Module" (only), works fine and fast almost of the time, but sometimes, they get a Timeout Error. ...
Score very simple query problem
Stimp - 10 Nov 2005 3:29 PM - 7 messages
This is a realy basic sql outer join and I have no idea why it's not working. I have a table [FEATURE] that has 29 rows. [FEATURE] {     idFeature int IDENTITY     FeatureName varchar } I have another table [VEHICLEFEATURE] that lists which features are ...
Next »