Home All Groups Group Topic Archive Search About

SQL Server database programming

microsoft.public.sqlserver.programming
Score last updated column
Big D - 16 Jul 2005 11:47 PM - 5 messages
I have a database that stores computer assets with SystemName(computername) being the primary key. I update this database from a Staging table. Below is a script that gets all the records from the StagingSystemInfo table and if the computername exists the row is inserted into System Info. If a node does ...
Score Difference in miliseconds
Jens Gotthardsen - 16 Jul 2005 9:49 PM - 11 messages
Hi there, Can anybody explain to me why select convert(datetime, '2005-07-16 22:05:27.332') returns: 2005-07-16 22:05:27.333 Whichs has a difference at 1 miliseconds. When I try to store time in a datetime field with miliseconds they ...
Score sp_executesql
Jan Hruz - 16 Jul 2005 9:43 PM - 6 messages
Hi, Is there any way how to dynamically create ntext in procedure and pass it to sp_executesql ? My statement is longer than 4000 chars. I have found one solution : add ntext parameter to stored procedure and create this statement on ...
Score sending large emails from SQL with CDOSYS
Roberto Kohler - 16 Jul 2005 6:14 PM - 1 message
Is there a way to send email messages larger than 8K from SQL with CDOSYS? I have a table with a column defined as ntext with the body of the message that I need to send and sometimes this is larger than 8K. ...
Score Error in msdn transact sql reference
MariusI - 16 Jul 2005 5:43 PM - 3 messages
Hi, i'm creating my own sql object model and parser. I'm using the BNF syntax specified by the microsoft sql transact reference on the msdn library  (see [link] ...
Score Newbie - Table structure - Getting nuts !
TNG - 16 Jul 2005 2:50 PM - 2 messages
Hi, I have a simple table structure set up. so all products can contain many procedures and each procedure is available for many products.  The only thing I'm trying (for 3 hours now) is to have a query where I can add a procedure linked to a certain product ...
Score Using Identity Columns
MD Websunlimited - 16 Jul 2005 1:54 PM - 10 messages
I'm attempting to move data from one database to another programmatically.  But for the life of me can not get the identity columns to work correctly. I create the table, then I issue a SET IDENTITY_INSERT OFF so that I can insert the existing data into the newly created table. However, I get an error stating that I can not insert into a table with out first setting IDENTITY_INSERT OFF which I did without any error. If I create a single SQL statement that includes the SET IDENTITY_INSERT OFF and the INSERT data statement then it will allow me to insert the data without problem. However, the next table says that SET IDENTITY_INSERT is on for the prior table even though I have issued a SET IDENTITY_INSERT OFF. ...
Score Problem with trace
Nameless - 16 Jul 2005 7:12 AM - 1 message
Hello! Sorry for my English, but... I'm using Microsoft SQL Server  2000 - 8.00.760 (Intel X86)     Dec 17 2002 14:22:05     Copyright (c) 1988-2003 Microsoft Corporation     Desktop Engine on Windows NT 5.1 (Build 2600: Service Pack 2) ...
Score Problem with trace
Nameless - 16 Jul 2005 7:12 AM - 1 message
Hello! Sorry for my English, but... I'm using Microsoft SQL Server  2000 - 8.00.760 (Intel X86)     Dec 17 2002 14:22:05     Copyright (c) 1988-2003 Microsoft Corporation     Desktop Engine on Windows NT 5.1 (Build 2600: Service Pack 2) ...
Score HAVING!
Arpan - 16 Jul 2005 7:07 AM - 4 messages
Should a column that is being used in the HAVING clause always be referenced in the GROUP BY clause even if that column is contained in an aggregate function in the SELECT list (as  shownin the second example below) unless the column being used in the HAVING clause is ...
Score HAVING!
Arpan - 16 Jul 2005 7:06 AM - 1 message
Should a column that is being used in the HAVING clause always be referenced in the GROUP BY clause even if that column is contained in an aggregate function in the SELECT list (as  shownin the second example below) unless the column being used in the HAVING clause is ...
Score GROUP BY in BOL!
Arpan - 16 Jul 2005 5:05 AM - 4 messages
In BOL, under the sub-topic 'GROUP BY Fundamentals', it is stated that --------------------------------------------- You can group by an expression as long as it does not include aggregate functions. --------------------------------------------- If I am not mistaken, the above sentence can be interpreted as ...
Score how to get cumulative total descending
NHUMAUOXPJHS - 16 Jul 2005 4:43 AM - 2 messages
I have customerid and sales and calculated sales percentage. What is the best way to calculate the cumulative sales and cumulative percentage how do I get the cumulative sales and cumulative sales percentage. -- drop table test_sales1 create table test_sales1 (customerid int ...
Score Order of Execution!
Arpan - 16 Jul 2005 1:21 AM - 2 messages
Suppose there are more than 1 condition in the WHERE clause & only the logical operator 'AND' is being used in the WHERE clause. For eg. (note that none of the conditions are bracketted) SELECT...FROM...WHERE ColA>4 AND ColB<2 AND ColC<=10 AND ColD=5 ...
Score Data Sampling
Lianne Kwock - 15 Jul 2005 11:19 PM - 7 messages
Is there a function to randomly select certain percent of the data from a table each time? ...
Score performance
Jan Hruz - 15 Jul 2005 10:52 PM - 3 messages
Hi all, I created search query that combines fulltextsearch with some other subsearches and other conditions. My problem is that SQL server also evaluates conditions or some subqueries which are not needed. For example: .... @search_string is null or contains(b.*, @search_string) ...
Score insert multiple rows select from while incrementing a uniq chr key
Rob - 15 Jul 2005 10:16 PM - 6 messages
How do you insert multiple rows from a select statement while incrementing a unique primary key in chr?  i.e. 00000001 - 00000100 What I have tried to no avail, with error: A SELECT statement that assigns a value to a variable must not be combined ...
Score place decimal for a char datatype
microsoft.public.dotnet.languages.vb - 15 Jul 2005 9:51 PM - 4 messages
Hi All, I am importing data from a mainframe output to SQl Server 2000 database. I have some cost fields but I have made the field's datatupe in char, so that I will not have any problem with populating the SQL Server ...
Score SP Question
tim - 15 Jul 2005 7:56 PM - 4 messages
Hi, I am somewhat new to T-SQL and I am this error The column prefix 'table1' does not match with a table name or alias name used in the query.  What is wrong with the code below? SELECT fmtno, fmtr INTO table1 FROM fomtg WHERE fmtno = @ptNo ...
Score Debbugging Stored Procedures on remote SQL 2000 with VS.NET 2005 Beta
Patrick - 15 Jul 2005 7:55 PM - 3 messages
Hello I have a SQL Server 2000 on a remote server, and installed VS.NET 2005 Beta2 on my computer. Now I try to debug stored procedures, but I always geht the message, "Symbols not loaded for this breakpoint", thought it does not stop ...
Score Using CASE in WHERE clause
Drew - 15 Jul 2005 7:16 PM - 25 messages
I have used CASE before, but am currently running into problems using it for different parameters in the WHERE clause, CREATE PROCEDURE spTest @Value int AS SELECT * FROM Category WHERE CASE WHEN @Value = 1 THEN CatID = 2 ELSE CatID = 3 ...
Score Sql Server Lock
Ben Ong - 15 Jul 2005 6:54 PM - 7 messages
Hi all, Hope everyone is having a nice day. I'm currently developing in ASP.NET and sql Server.  Here's my problem. I have a database that acts like a queue.  Users can add or delete lines from this queue.   When the stored procedure ...
Score How to get the Table Name from the ID column in syscolumns
Mator DeSchenna - 15 Jul 2005 6:19 PM - 6 messages
select ID from syscolumns how do I find out what the table name is based on ID? thanks ...
Score ANSI Settings for Indexed view
Steve H - 15 Jul 2005 6:02 PM - 1 message
Greetings.  I am trying to use an indexed view in SQL Server 2000.  I created the view and applied the index in Query Analyzer with appropriate ANSI settings i.e. ARITHABORT, QUOTED_IDENTIFIER and ANSI_NULLS set to on (others were set as ...
Score Tempdb is growing and I can't tell what process is to blame
pshroads - 15 Jul 2005 5:48 PM - 14 messages
My tempdb has grown to 40 GB and is growing my the minute but I'm unable to determine what process is to blame. If I look at tempdb..sysobjects all the objects are created very recently and change each time i rerun the proc. I would think that anything that has grown ...
Score Beating a dead horse - Drop table from proc
John - 15 Jul 2005 5:37 PM - 20 messages
Hi, I have a DROP TABLE command in a proc. The proc fails on DROP TABLE, if I run it under any user other than sa. Even with the execute permission. My understanding is, that procs are run with the permission of the proc ...
Score Application Role for multiple databases
Perayu - 15 Jul 2005 5:35 PM - 7 messages
I need to use Application Role for our security issue. But my application use three (3) different databases. After I setup Application Role in one database, my application can not access to other 2 database, unless create a 'guest" account, which I don't want to do that. Is there anyway that  I can ...
Score n' prefix
Bernie Yaeger - 15 Jul 2005 4:55 PM - 6 messages
What is the meaning/use of an n' prefix like this: select N'fname, N'lname for customers tx for any help Bernie Yaeger ...
Score Text importation errors with delimiters
Job - 15 Jul 2005 4:51 PM - 1 message
I have large .log files I'm trying to import.  After DTS gave errors and specifc line numbers I looked into the raw data and saw that the file was delimted with a ^ and was text qualified with ".  However, some of the ...
Score need help with an index!
=== Steve L === - 15 Jul 2005 4:39 PM - 2 messages
i'm using sql2k. one of the table i'm working with has book title field in in. the max lengh is 1800 (varchar). i need to index on the title for search performance but the max index key lenght for sql is 900 bytes. what can ...
Score insert - Selecting Columns
Shahriar - 15 Jul 2005 4:20 PM - 5 messages
How could I achieve this easily? I have 50 fields in my table and I want to insert a new row from an existing row with changing the value of 2 fields only.  I want to somehow specify the ...
Score Find Alphabetical records only
microsoft.public.dotnet.languages.vb - 15 Jul 2005 3:47 PM - 6 messages
Hi All, Here is the scenario. Table contains vendor codes and these are either numeric or mix of alphabets and numbers. Such as : 56710 BAC67 ABF11 34567 I want to query which will give me the results which starts with ...
Score ADDING CASES in STORED PROCEDURE
pmud - 15 Jul 2005 3:35 PM - 5 messages
Hi, I an using the following stored procedure. Now what I want to do is: 1. If @month is null or nothing.. then @month's value should be all months, i.e it should  display data for all months. ...
Score query - join
Mike - 15 Jul 2005 3:28 PM - 2 messages
I have a table 'download' with 2 fields userid,ipaddress I would like to know the userid's that have the same ip address, how can I get this? sample data ID       ip 1       1.2.3.4 ...
Score Stored Procedure (Weird Question)
marcmc - 15 Jul 2005 3:17 PM - 10 messages
Is it in any way possible to have a sProc called and executed within SQLServer return its return value to an .Net Vb application or indeed any application? As a programmer I beleive this can be done and if I wreck my head enough I ...
Score altering stored procedures as a batch
jason - 15 Jul 2005 3:12 PM - 3 messages
is there a way to alter stored procedures as part of a batch? for example if i want to change the name of a parameter, or field that appears in many stored procedures, is there a batch method i can use to ...
Score fixing an error
Britney - 15 Jul 2005 3:08 PM - 2 messages
Hi guys, DBCC CHECKTABLE (sysindexes, 255) Result: Server: Msg 8928, Level 16, State 1, Line 1 Object ID 2, index ID 255: Page (1:869938) could not be processed. See other errors for details. Server: Msg 8939, Level 16, State 1, Line 1 ...
Score question
Britney - 15 Jul 2005 2:58 PM - 6 messages
Hi guys, DBCC CHECKTABLE (sysindexes, 255) Result: Server: Msg 8928, Level 16, State 1, Line 1 Object ID 2, index ID 255: Page (1:869938) could not be processed. See other errors for details. Server: Msg 8939, Level 16, State 1, Line 1 ...
Score set column precision
rbutch@coair.com - 15 Jul 2005 2:45 PM - 3 messages
hey guys, need a little advice here. if i want to restrict a column to a decimal precision of 2 - can i do this when i create the table. and should i use a decimal or float datatype. i just want to force two decimal places. ...
Score Executing an Oracle SP from SQL 2000
jaylou - 15 Jul 2005 2:42 PM - 4 messages
Hi all, I have a linked Oracle Database to one of my SQL servers.  I can query the database using openquery.  Is there a wat to execute and pass parameters into a Stored Proc on the Orcle DB?  I had the Orcle DBA put the SP into a package ...
Score When to use a flag Attribute?
C TO - 15 Jul 2005 2:27 PM - 3 messages
Hello World, I have a SalesAgent, SalesOrder, Product, and ProductType entities. Say, my product types are "Hard Drive","Mouse","Monitor". I need to store the record when/if the SalesAgent did purchase a product for demo purpose (for profiling). Please comment on the options below or adivise for bettter option: ...
Score Stored Procedure Death
Al K - 15 Jul 2005 2:05 PM - 7 messages
I have a stored procedure which accepts a single input string of variable lenght, as its parameter.  It then parses that string to develop a set of inputs which will be input, deleted or updated in the database.  The amount ...
Score EXCECUTION PLAN ROW COUNT IS HIGHER THAN ROWS IN TABLE
Kuido Külm via SQLMonster.com - 15 Jul 2005 1:10 PM - 3 messages
Hello ! I'm looking at the query Excecution plan, there is CLUSTERED INDEX SEEK operation and the numbers are: ROW COUNT: 6 850 703 Estimated Row Count:  554 But in fact there is only  2 557 244 rows in the table. ...
Score Fetch statement
Shahriar - 15 Jul 2005 1:01 PM - 6 messages
I need to update few records in a very large table and wanted to know the pros and cons of using a fetch statement in a stored procedure to first select all the records that need to be updated and then loop through each ...
Score Basic Query Help
TheBook - 15 Jul 2005 1:01 PM - 6 messages
I'm not a programmer, so I need help with a query. Table: IpAddress Char 23 UserName char 20 ComputerName char 20 LoginDate datetime Many people different people have logged into any one computer many times. I'm looking to get a Count of the number of times a computer has been logged ...
Score Please I'm getting crazy, datetime question.
Fabri - 15 Jul 2005 12:13 PM - 4 messages
declare @datacontr datetime declare @datafine datetime select     @datacontr = '20040615',     @datafine = '20050514' Assuming I have two dates I would like to query results if these conditions are satisfied: 1) Year of @datafine must have at least year(getdate()) - 1 value ...
Score combine MSaccess security login with login to linked sql db
Sam - 15 Jul 2005 11:45 AM - 2 messages
is their is a way to combine MSaccess security login with login to linked sql db? thanks ...
Score Query of XML Data in SQL 2000 text field
Paul - 15 Jul 2005 11:15 AM - 3 messages
Hi, I need to query XML data that is held in a text field on a SQL Server 2000 table, the XML includes DTD and Data elements. For example the XML has a data element named S1 and I want to list all the ...
Score Calling TSQL Script from within TSQL Script
Bluemonkey - 15 Jul 2005 11:07 AM - 3 messages
Hi, Is it possible to have a script (e.g main.sql) that calls other sql scripts ? In Oracle you can use "@<path><filename>.sql to call it but I cannot find a way to do it in SQL Server. ...
Score Numbering the records in the many part of a join
Chris Strug - 15 Jul 2005 10:45 AM - 3 messages
Hi, Probably a silly question but given the statement SELECT     B.Booking_Number, B.Job_Status, A.Address_1, A.Address_2, A.Address_3, A.Address_4, A.Address_Postcode FROM         dbo.tblAddress A RIGHT OUTER JOIN ...
Score Help with simple SP (newbie)
Diego F. - 15 Jul 2005 10:24 AM - 4 messages
Hi. I'm writing my firsts stored procedures. I'm trying to get a row from one table and insert the results in other table. By now I have this: create proc registerTable @email varchar(30) as select name,email ...
Score modules in Access, connection strings, and macro usernames/passwords
David Shorthouse - 15 Jul 2005 10:19 AM - 3 messages
Hello folks,     I'm not sure if this is possible, but I would appreciate any guidance. I have a number of passthrough queries in an Access template I am developing for clients as well as some linked tables. In order to make my life easier ...
Score DTS Issue while calling from another domain
zacH - 15 Jul 2005 6:19 AM - 8 messages
hey guys, i have this Applicaation that is hosted on one server. This makes a call to a DTS which is on teh DB server on another Domain which is behind a firewall. When the app calls it the call never excutes the ...
Score DTS Issue while calling from another domain
zacH - 15 Jul 2005 5:59 AM - 1 message
hey guys, i have this Applicaation that is hosted on one server. This makes a call to a DTS which is on teh DB server on another Domain which is behind a firewall. When the app calls it the call never excutes the ...
Score Differences among VARCHAR, VARCHAR2, and CHAR
jrefactors - 15 Jul 2005 4:51 AM - 6 messages
What are the major differences among data type VARCHAR, VARCHAR2, and CHAR? please advise. thanks!! ...
Score how to avoid inserting duplicate key to the table?
jrefactors - 15 Jul 2005 4:50 AM - 4 messages
how to avoid inserting duplicate key to the table? For example, the EMPLOYEE TABLE has field EMPID (primary key) and NAME If I execute the following sql statement one by one, I will get error "violation of primary key contraint. cannot insert duplicate ...
Score Finding How Many users connected ?
WhiteJul - 15 Jul 2005 4:49 AM - 3 messages
if there is any SP to check how many users are connected to my  sql server? This is good in case I need to know who is connected or not, so I can bounce the server or do some maintenance without interfering with users's ...
Score how to use join hints ?
Hassan - 15 Jul 2005 4:14 AM - 5 messages
Can someone send me a query example on how to force join hints ? Id like to try different options such as nested, merge,hash Thanks ...
Score MSSQL Session
Randy Adanza - 15 Jul 2005 4:08 AM - 3 messages
Cheers, I need to implement an audit trail on a existing Database.  The way im planning to do this is to make a duplicate table for each of the tables on the Database and add 2 fields, namely Change Date and Change By.  Now on ...
Score Trigger to block and log
John Baima - 15 Jul 2005 3:32 AM - 4 messages
I would like a trigger to both block updates and deletions as well as log all information I can get. I really don't care what the update or deletion is. Thanks for any help. -John ...
Score What the N is going on?
Mator DeSchenna - 15 Jul 2005 3:18 AM - 4 messages
What the heck is with these Ns that SQL script generator sticks in here everywhere. It is enough to make me quit my  SQL Farm Managerial position. Why do I have to deal with Ns everywhere?? EXECUTE sp_rename N'dbo.Tmp_Table1, N'Table1', 'OBJECT' ...
Score Compare image data type fields
Tina - 15 Jul 2005 2:44 AM - 1 message
Hi, How do you compare images data type fields stored in different tables? Because images are stored in SQL as binary data, you can't use the comparison operators. Also, i would like to compare the images using a stored proc, what data type ...
Score Can I do this?
Brian Selzer - 15 Jul 2005 1:16 AM - 16 messages
DECLARE @inserted TABLE (   RowNumber INT IDENTITY(1, 1) NOT NULL,   BadgeNo CHAR(6) NOT NULL,   LastName VARCHAR(35) NOT NULL,   FirstName VARCHAR(25) NOT NULL,   Street VARCHAR(125) NOT NULL,   City VARCHAR(40) NOT NULL, ...
Score Is there a more efficient way?
Michael C - 15 Jul 2005 1:15 AM - 4 messages
I want to retreive the records for when a certain column has a maximum value in a group. Using MAX i get the maximum value but what I really want is the row, not the value. I can do it with a subquery but it doesn't seem that ...
Score San Diego Users Group
Patrick - 15 Jul 2005 1:06 AM - 4 messages
Gang, I'm looking for a SQL Server Users group in San Diego. ...
Score How to get the 4th record and on from select query
TdarTdar - 14 Jul 2005 11:42 PM - 6 messages
SELECT [itemVal] FROM #TempTB WHERE [ID] >  (the fourth Record in the #TempTB) Thanks Tdar ...
Score Basic question on object naming
vvenk - 14 Jul 2005 11:32 PM - 5 messages
Hello: If I have a table named venki.TableA and if I log in as Venki, is the following syntax valid: SELECT * FROM TableA I tried it and it complained about an invalid object, TableA. However, the following works no matter who has been logged in" ...
Score Field length question
Mark - 14 Jul 2005 11:21 PM - 2 messages
Hello, Will SQL Server alert you to the fact that you are trying to put more characters into a nvarchar column than is allowed or will it truncate the data? Thanks in advance. Any help would be greatly appreciated! ...
Score Custom Aggregate function
Oleg - 14 Jul 2005 10:39 PM - 3 messages
Can I write a custom aggregate function? something like bult in 'SUM' function. The reason is  that I want to culculate a sum of integer column as bitmaps when I have a 'group by' clause. Another question. Which way is better to write SELECT statement with ...
Score Multi columns in a sub query?
JP - 14 Jul 2005 9:54 PM - 4 messages
select Addresses.ID, Addresses.Address1, Addresses.Address2 , Addresses.City, Addresses.State, Addresses.ZipCode, (select top 1 Phone,Email from Attributes where attAddrID=Addresses.ID), Addresses.AreaName how do I select multiple filelds in the sub query. Analyser will only let me ...
Score flexible database filtering
ChrisB - 14 Jul 2005 9:38 PM - 5 messages
Hello: I would like to add filters to some Sql Server 2000 queries and was wondering if someone might be able to recommend a proven design pattern. To be more specific, like most applications, I have several queries that reduce the number of returned records through the use of filtering. ...
Score Duplicate entry issue
Lontae Jones - 14 Jul 2005 9:21 PM - 2 messages
Hello I have a table called log and the schema is below Create table [log] ([AutoID] [int] IDENTITY (1, 1) NOT NULL ,     [Timestamp] [smalldatetime] ,     [PageSource] [varchar] (100),     [Domain] [varchar] (100),     [Faxedby] [varchar] (5), ...
Score min permision needed for using Analysis Serivces?
=== Steve L === - 14 Jul 2005 9:10 PM - 1 message
in sql2k, what's the min rights for a person to use analysis services and create cubes from their workstation (Analysis Services has been installed) to register with a remote sql server? ...
Score Executing a RESTORE across servers
E2TheC - 14 Jul 2005 8:59 PM - 3 messages
I have a procedure in a db on Server A that I want to have execute a RESTORE statement to restore a database on Server B. Is this possible programmatically? Server B is a Linked Server on Server A, but how can I execute the RESTORE? ...
Score Way to see how many records will be returned?
ChrisR - 14 Jul 2005 8:49 PM - 4 messages
sql2k I could have sworn there was a way to see how many records will be returned from a query in Query Analyzer. Either under "Query" or "Tools"? Ive tried and cant find it. Is there such a thing? TIA, ChrisR ...
Score sp_who2 shows old connections
Mike - 14 Jul 2005 8:49 PM - 3 messages
Hi, when I tried sp_who2, I see connections that are old, please take a look at this and suggest what I need to do - (I have connections showing up since 6/27), how can I clean them up and how did it stay so long? ...
Score delete ?
KevinE - 14 Jul 2005 8:48 PM - 4 messages
is there a keyword in sql that will allow me to run a delete statement that delete's 1000 rows (example) but breaks the processing into deleting 100 rows 10 times? TIA, KevinE. ...
Score Stored Procedure with a Field of Type "text"
honcho - 14 Jul 2005 8:29 PM - 3 messages
Hello, Does anyone have an example of an SQL Server stored procedure that updates a record, where one of its field is of type "text"?  My procedure is /* **  Update the client note and production cycle in a Sites record.  Set the ...
Score is there a set-based solution to this task?
jason - 14 Jul 2005 8:02 PM - 11 messages
given the following simplified tables: create table apples (      appleid int not null,      column1 varchar(50) null,      column2 varchar(50) null,      orangeid int null) create table oranges ( ...
Score Help with grouping-type query
epigram - 14 Jul 2005 7:47 PM - 3 messages
I think a simple (but fictitious) example is the best way to express what I am trying to do. I have 4 tables. Family: ID Description Person: ID FamilyID Name Person_Car: ID PersonID CarID Car: ID Make Model Year This setup allows me to have many common types of cars in the Car table, and ...
Score an index creation question...
=== Steve L === - 14 Jul 2005 7:08 PM - 6 messages
i'm using sql2k i have a big table with client names in it. first and last names are seperate fields. users would like to search on either first or last name, or both at the same time. what's the best way to create indexes ...
Score DTS package for exporting data from excel into temp tbl
Ilin S via SQLMonster.com - 14 Jul 2005 6:37 PM - 6 messages
I need to create a DTS package , which will export data from excel into temp table in MS SQL and then use stored proc to manipulate this data from temp table and some permanent tables. Any help will be appreciated. ...
Score Best way to implement tedious trigger?
Kyle - 14 Jul 2005 6:26 PM - 3 messages
Hi. I'm working on a trigger for logging changes made to a particular table. For ugly legacy reasons, the table has 150+ fields, and currently the trigger is a long string of 'If UPDATE(Fieldname)' statements. Is there a better way? ...
Score question
Britney - 14 Jul 2005 6:05 PM - 2 messages
how to find out when was last time the sql server was down? ...
Score xpsql.cpp: Error 87 from GetProxyAccount on line 604
carloscajas - 14 Jul 2005 5:09 PM - 2 messages
they reckoned, I am executing these commands in slqanalyzer: set @ruta ='\\aBsrvNET\reportes_TC\' + @mess + '\' + @mes + dbo.f_it_fill_campo(convert(varchar(2),day(@pp_fecha)),1,'0') + convert(varchar(4),year(@pp_fecha)) + '_LISTADOS\OTROS\' -- BUSCA EL ARCHIVO PARA SABER -- SI YA SE HA GENERADO ...
Score mscomm
gerry - 14 Jul 2005 4:30 PM - 3 messages
we have need to use mscomm from within sql server to do a simple output. using sp_OA everything works fine with the exception of setting the Output property. we are getting the error 0x800A017C Invalid property value I assume this is because the proprty expects a Variant and we are sending a ...
Score Strange SP Problem
Neil - 14 Jul 2005 4:28 PM - 4 messages
I have a strange situation. I have a stored procedure that is hanging upon execution, but only some machines and not others. The db is an Access 2000 MDB using ODBC linked tables and a SQL 7 back end. The sp is executed as a ...
Score how to check if #temp table exists?
Rich - 14 Jul 2005 4:12 PM - 7 messages
I create a temp table Create Table #temp... and do stuff - without dropping #temp.  Then I tried using the following in Query Analyzer if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[#temp]') and OBJECTPROPERTY(id, N'IsUserTable') = 1) ...
Score Conversion to int error
quiglepops - 14 Jul 2005 4:07 PM - 2 messages
Here is a code excerpt from a large proc I have inherited. It runs from within an application, but when I take it outside and try to run it in Query Analyzer I encounter problems... (Note that these are only code sections and ...
Score best way to calculate aggregate products from materialized paths?
Paul - 14 Jul 2005 4:01 PM - 5 messages
I need to implement some complicated hierarchy manipulation features. To make this happen I can no longer maintain expanded structures relationally - doing it purely in SQL would be a nightmare. I'm going to move the logic that maintains them into OO; this will force me to do row updates ...
Score sql server 2000 datetime data type question
Wendy Elizabeth - 14 Jul 2005 3:46 PM - 7 messages
I just started to work with sql server 2000. I want to write a query against "datetime" columns in the sql server 2000 database. I am to be able to do the following with the sql server 2000 "datetime" columns: ...
Score Need help in defining a stored procedure
romy - 14 Jul 2005 3:37 PM - 3 messages
Hi I need to define a SP which returns the frequency of occurrences of Events in a certain range of dates. Parameters: range of dates (DateFrom ,DateTo) Input: An events table which its relevant fields are: EventCode, EventDate Output: For each eventcode return the average Frequency in which the event occur. ...
Score Set default value from another table?
MartyNg - 14 Jul 2005 3:29 PM - 10 messages
I have a field in a table which I need to set a default value for. The default value needs to be a string concatenation of two fields from a DIFFERENT table. Anyone know how to do this? Thanks! SQL Server 2000. ...
Score Can use Subquery like this?
Bongee - 14 Jul 2005 3:26 PM - 5 messages
Hello, SELECT B.CODE, C.CURCODE,        SUM(A.AMOUNT) AS TL_TOPLAM,        SUM(A.TRNET) AS DOVIZ_TOPLAM,        SUM(A.TRNET * (SELECT RATES1 FROM L_DAILYEXCHANGES WHERE LREF = 1) ) ...
Score Can we connect?
Rogers - 14 Jul 2005 3:26 PM - 6 messages
can we connect named instance through IP like in the network utility I just defined the IP of the server where the named instance installed and define the port.... Client Netowork Utility > Alias > Alias:  MyServer Server: 209.45.23.55 ...
Score @@spid
JT - 14 Jul 2005 3:21 PM - 6 messages
can someone point me to an article or give me a brief explanation of how sql server 2000 assigns a value to @@spid?  does each stored procedure get its own spid?  what if a stored procedure calls another stored procedure?  do ...
Score Selecting a Specific row from a range
-Ldwater - 14 Jul 2005 3:18 PM - 3 messages
Hi all, Just wondering.. is there currently a function in SQL to be able to return a specfic row number from a record set. For example, from my Select statement, I only want the 5th record. Just wondering if there is any function already available that means that I ...
Score partitioned data
simon - 14 Jul 2005 3:15 PM - 3 messages
Hi, I have one big table with 5 million of data. If applocation works on that table, it's very slow. So, I should break one huge table into smaller tables, for example one for each year. Lets say, I have tables: ...
Score sp_Execute
Mike Labosh - 14 Jul 2005 3:08 PM - 3 messages
Someone is running a big batch in MS Access connected to some SQL Server table(s) -- What Access calls "linked tables". I am monitoring a batch running on my local box with SQL Profiler. I can see this other user's process spewing gobbles of calls like this: ...
Score Migrating data from old database to new???
Tim::.. - 14 Jul 2005 3:01 PM - 3 messages
Can someone please tell me why this doesn't work! I'm trying to migrate some data from an old database into a new database but it keeps returning the error: Server: Msg 208, Level 16, State 1, Line 1 ...
Next »