Home All Groups Group Topic Archive Search About

SQL Server database programming

microsoft.public.sqlserver.programming
Score Getting most recent value
Ada - 17 Sep 2005 11:19 PM - 9 messages
Hello All, I have a table with 6 column; week1-5 and month. Month column should be equal to the most recent column within week1...to..week5 column. If there is a value on week5 then month = week5, else week4....till week1. ...
Score Is there a beter way to do this?
DazedAndConfused - 17 Sep 2005 11:09 PM - 8 messages
It seems that nulls reek havoc for queries using variables (you have to use 'is' instead of '='  for null). My objective is to check if a record is already on file to decide if one needs to be added or if it already exists before continuing the procedure. ...
Score Does Table Exists
Mark Moss - 17 Sep 2005 6:17 PM - 2 messages
Gentlemen / Ladies         How can I check if a Temp Table exists, so that I can drop it? Mark ...
Score Assign T-SQL variables in dynamic SQL statement?
Joe - 17 Sep 2005 6:11 PM - 2 messages
I have a dynamic SQL statement in which I need to assign values to variables. SELECT @querystring = 'SELECT  @rows = COUNT(*)     @pages  = COUNT(*) /  @perpage     FROM utbl' + CAST(@tableid AS VARCHAR(15)) + ' WITH (NOLOCK)' ...
Score Microsoft table design best practices
bshewan - 17 Sep 2005 5:50 PM - 2 messages
I remember viewing a Microsoft article (MSDN, i think) that gave a detailed list of Microsoft's best practices for designing database tables. It mentioned stuff like naming conventions, etc. but I'll be damned if I can find it again. ...
Score Stored Proc Question
Joe Delphi - 17 Sep 2005 4:35 PM - 3 messages
Hi,     I have a stored procedure, CLEAN_ACQ_REPORTS which calls another stored procedure, SELECT_TPRD, both of which are shown below.  The SELECT_TPRD proc runs fine by itself and returns the correct string value.  But when I nest ...
Score CREATE an INDEX when using CREATE TABLE?
DazedAndConfused - 17 Sep 2005 3:43 PM - 3 messages
Is there a way to create a index with create table when it is not a primary key or unique? Please see below, to see where I am getting lost. I can create the index using the code below, but I can not see how to create ...
Score Like Query And Null Values
Rich - 17 Sep 2005 11:29 AM - 3 messages
I have a table on SQL Server where one column allows Null values (docMName) and I'm trying to perform a like query using one parameter. When executed the query fails to include rows with Null values for the docMName column. Is ...
Score t-sql join
Duncan Mole - 17 Sep 2005 10:27 AM - 5 messages
Hi, Is it possible to join the result of a subquery? Something like; SELECT * FROM EMPLOYEES EMP JOIN (SELECT COUNT(*) FROM ORDERS WHERE EMP.EMPLOYEEID = O.EMPLOYEEID) ...
Score SQL Query Question
Peri - 17 Sep 2005 8:24 AM - 5 messages
I am having 3 tables Table1, Table2 and Table3 with the following schema and values CREATE TABLE Table1 (TableName VARCHAR(500), FieldName VARCHAR(500), UID INT, TransactionNo INT) GO INSERT INTO TABLE1 (TableName, FieldName, UID, TransactionNo) VALUES ('TABLE2', 'TABLE2.SecCode', 1, 100) ...
Score Which is better? #temp tables or create/drop perm tables on-the-fly
Ali - 17 Sep 2005 7:00 AM - 5 messages
I have a web application where I often need to temporarily store data, do a bunch of processing, counts, etc... and then the data is not needed anymore. I know I could just use temp tables, but I'm wondering what are the ...
Score Export SQL Table to MS Access file
Jafer - 17 Sep 2005 5:05 AM - 9 messages
I want to export a SQL table to new MS Access file or to a file already existing in a known location. The SQL table is a temporary table (#). If not for # table, any idea to export a SQL table will be useful. The exporting ...
Score Finding unique rows, including relationships
jeem.hughes - 17 Sep 2005 12:46 AM - 3 messages
Hello.  I'd appreciate any help from you sql gurus on this problem: I have tables Foo, Bar, and FooBarJoin, which is your typical join table for a m-n relationship. I need to find the unique rows in Foo, where the uniqueness ...
Score Test for numerics?
tshad - 16 Sep 2005 11:59 PM - 9 messages
Is there a check for numerics? In my conversion from another system to ours, they have an alphanumeric field that puts an "A" in front of their check numbers in some cases, has no Alphas in some and all Alphas in others. ...
Score Outer Join Problem
Karim - 16 Sep 2005 11:28 PM - 4 messages
Hi All I am trying to use a left outer join but am not getting the correct results. Here it is SELECT glpd_no FROM   glperiod LEFT OUTER JOIN  invnmove ON (glpd_no=nvtmper_glpdno) AND (glpd_company=nvtm_company) where  (glpd_no>='200501' AND glpd_no<='200505') AND ...
Score Between vs In
David Chase - 16 Sep 2005 9:50 PM - 5 messages
I have a need for a criteria to be = 32 or 33 and wondered if BETWEEN 32 AND 33 would be faster than IN(32,33).  This is an indexed field.  Thanks. David ...
Score Update Lock
Leila - 16 Sep 2005 9:21 PM - 15 messages
Hi, In the description of Update Lock in BOL, it is mentioned that Update Lock can eliminate deadlocks because only one transaction at a time can obtain it. Personally I'm not convinced by this logic. Can an Exclusive Lock be ...
Score select variable in from statement
RWG - 16 Sep 2005 8:33 PM - 11 messages
I'm kinda new to SQL (Been working with access) and since links are not permitted in SQL (except as a view with SELECT * FROM DATABASE.dbo.TABLENAME) it's a static connection where I need dynamic selection.  What I would like ...
Score SQL BLOB data back into a string
Jake - 16 Sep 2005 7:45 PM - 7 messages
I'm stumped, Not sure if this is the right place, sorry if it isn't, but just point me to the right spot if not. My problem, another developer has stored some text, html, images, etc into a table field that is a blob. ...
Score Updating AD from SQL Server
Tim - 16 Sep 2005 7:43 PM - 2 messages
I need to push some data from SQL Server to AD - phone number, office, etc. I can get the data into SQL Server using a SELECT and the ADSI setup documented on the MS KB, but updates on that same object fail with a "provider can't ...
Score Date/String format
tshad - 16 Sep 2005 7:42 PM - 15 messages
I have a date that I need to get into a mmddyyyy format.  There is no standard format to do this and I need to do this in Sql as there is no client program here. SELECT DateBeg,Convert(varChar(2),DatePart(mm,DateBeg)) + ...
Score Help with CREATE TRIGGER syntax
mike - 16 Sep 2005 7:41 PM - 3 messages
Any help would be appreciated. What's wrong with the following syntax? CREATE TRIGGER tr_CMR_Client_Status_Confirm ON [CMR Client Numbers] FOR INSERT, UPDATE         AS     IF UPDATE [Current Status]                     CASE WHEN [Current Status] = 'X' THEN [Status Flag] = [CMR ...
Score Update Question
TheWildDBA - 16 Sep 2005 7:01 PM - 3 messages
A little background first.  I import a csv file into SQL Server into a single table in a junk database.  I then stage data for import into a Sql database.  The file has an (prospect)id, flag field and a comments field.  The refer ...
Score Is this correct?
Mike Labosh - 16 Sep 2005 6:55 PM - 5 messages
Are these two statements equivalent?  If not, how can I rephrase the 2nd one? UPDATE Contact     SET DoNotCallTypeKey = 20 WHERE EXISTS (     SELECT *     FROM SSA         INNER JOIN SSP ...
Score Mirroring SQL servers
Jon Glazer - 16 Sep 2005 6:46 PM - 4 messages
I am in the process of changing from SQL server A to SQL server B but the databases are huge.  Can I mirror A with B then just turn off A when its completed?  What steps would be involved here? ...
Score Backup an entire database ...
Jon Glazer - 16 Sep 2005 6:37 PM - 5 messages
Can someone give me the command to properly backup an entire database including all security and what-not so I can move it to a different SQL server?  The restore command too would help! Thanks! Jon ...
Score Stored Procedure and Command line
timjo916 - 16 Sep 2005 6:37 PM - 2 messages
Simple question ... From within an MS 2000 SQL database stored procedure, I need to execute a DOS command that runs an application AND pass a parameter from the stroed procedure to this command line application.  I also need to receive back a ...
Score ADDING WITH COUNTING
tarheels4025 - 16 Sep 2005 6:04 PM - 2 messages
Below is my query so far.  There is a field in Winpayment call transaction_amount that I would like to add up for use count statement if possible.  So what I am asking is there a way to for each count case add the ...
Score SQL Server 7 with ADO Query Help
Evan Dobkin - 16 Sep 2005 5:50 PM - 5 messages
When running the following query against MS SQL Server 7.0: SELECT documentitems.manufacturerpartnumber,documentitems.customnumber01,documenthe aders.customnumber01,documentitems.description,documentheaders.projectno FROM DocumentHeaders INNER JOIN DocumentItems ON DocumentHeaders.ID = DocumentItems.DocID WHERE ( DocumentHeaders.DocNo='ORLQ1017' AND DocumentItems.CustomNumber01=2) It returns 2 records (Which is correct). ...
Score Please help me in this Query
Nuno Teixeira - 16 Sep 2005 5:42 PM - 2 messages
Hi group. I have this query: SELECT FTDLN.NID FROM FTDLN INNER JOIN FTDOC ON FTDLN.NTIPO = FTDOC.NTIPO AND FTDLN.NNUMDOC = FTDOC.NNUMDOC AND FTDLN.CSERIE = FTDOC.CSERIE This query in a particular database dont'n work, i.e., 0 rows return. ...
Score OSQL Ouput Formatting.
Seequell - 16 Sep 2005 5:10 PM - 6 messages
Hi, When I execute a query in OSQL using Query Analyser the output is not well formatted. Sample Query is given below. Can someone suggest me a way to get good readable format in QA. Thanks in advance. -Kumar. ---***--- SELECT TOP 3 * FROM pubs..authors ...
Score SELECT * vs SELECT col1, col2... colN
Verde - 16 Sep 2005 5:07 PM - 11 messages
*All other things being equal*... just wondering if there is any performance difference [really, if SQL Server has to do less work] between: SELECT * and SELECT col1, col2, col3.... I'm wondering because I have a SELECT statement in a sp that returns all but ...
Score dts Foxpro MEMO Field
SQLbeginner - 16 Sep 2005 5:01 PM - 5 messages
how can I import memo field from Foxpro table?? Many Thanks in Advance!! ...
Score Converting varchar to Money
Snake - 16 Sep 2005 4:34 PM - 3 messages
I have a a Case statement which sometimes fails when converting a Varchar column which contains numeric values to Money.  I can understand why it fails when  "1.05E+07" is passed in, but other values appear to fail also.  I have ...
Score sp_send_cdosysmail
David - 16 Sep 2005 4:34 PM - 6 messages
We've just created the "sp_send_cdosysmail" stored procedure on our sql server box. When running the test call from Query Analyzer to see if it works, we get back the message: "-2147220978". We've searched and searched, and we can't find this error listed anywhere. Does anyone know what this ...
Score PRIMARY KEY
DazedAndConfused - 16 Sep 2005 4:26 PM - 13 messages
Is there any difference between defining a primary key this way: personID  int  not null PRIMARY KEY CLUSTERED(personID) and this way: CONSTRAINT PK_CP_personID PRIMARY KEY CLUSTERED(personID) ?? ...
Score Stored Procedures
Ron - 16 Sep 2005 4:00 PM - 3 messages
We have a sqlserver 2000 database with stored procedures, I am trying to call the stored procedure from my desktop using java. The stored procedure will execute some selects to get some values it needs before doing an insert. The ...
Score Heterogeneous tree and foreign key relationship
DC - 16 Sep 2005 3:57 PM - 6 messages
Hi, I need to represent a data structure in sql server which I think is called a "heterogeneous tree", and I don't know how to efficiently do this in sql. I have a Container table : ContainerName C1 C2 C3 ...
Score Random numbers
Mary W. - 16 Sep 2005 3:56 PM - 4 messages
Hello all! I'm trying to create a function that returns a random progressive / regressive series of values (e.g. 11000, 11300, 11900, 12000, 12250) taking a start value, an end value and (an increment value). Can you please provide ...
Score Slow SELECT IN
SimonC - 16 Sep 2005 3:50 PM - 8 messages
Dear All, Please can you tell me why the following query takes 4-5 mins: SELECT * FROM db1.dbo.table1 WHERE column1 IN (SELECT column1 FROM db2.dbo.table1 WHERE column2 = 'x') The IN () query SELECT column1 FROM db2.dbo.table1 WHERE column2 = 'x' ...
Score file handling
HP - 16 Sep 2005 3:15 PM - 4 messages
Is there function in SQL to return just the filename. For eg. if the filename is 'C:\test\job.txt' , i want to extract job from the filename. Is is possible? Thanks in advance! ...
Score Another case for IDENTITY
Mark White - 16 Sep 2005 2:56 PM - 14 messages
Not to keep beating a dead horse, oh why not. DDL: DDL A: Survey( InternalId int IDENTITY PRIMARY KEY, RespNo int, RespKey nvarchar(16), Qtr char(4), CntyCod smallint, ImportDate datetime not null default getDate()) SurveyAnswers( InternalId int     FK, ...
Score Q: How to copy a row in a table...
Visual Systems AB (Martin Arvidsson) - 16 Sep 2005 2:20 PM - 7 messages
Hi! I want to copy a row in a table, and insert it into the same table but with the difference i want to modify four fields. Why you might ask. I want to be able to copy a order and specify a new date and ordernumber. ...
Score add server to sysservers
mcnewsxp - 16 Sep 2005 1:51 PM - 12 messages
is there a way to add a remote server name to sysservers in the master DB. i am not able to use linked server. ...
Score Query with user-define function John Bell
Helen - 16 Sep 2005 1:30 PM - 2 messages
Yes!! It works. But just a point. In the [Index] column I have both strings and numbers. When I query [Index]=AA there is an error: Invalid column name 'AA' Any more suggestion? Thank you Helen ...
Score Tools for design recovery (reengineering) of C# source code with embedded sql statements ?
Aksel Lindberg - 16 Sep 2005 12:32 PM - 4 messages
Wonder if somebody know if it exist som tools that makes it possible to get a graphical overview of relationships between C# source code components and their's interaction with the database tables/elemts (E.g SQL server database) A typecial rewengineering tool to get a grasp of a system with many ...
Score select distinct from an union result ?
/jerome k - 16 Sep 2005 12:11 PM - 2 messages
I have a big (4 milj rows) aggregation table based on month, prod, customer, country etc columns with month Qty totals, always queried by month with really good performace ! I also have a small correction transaction table (< 5000 rows) that is not aggregated. I want to query the union of those and ...
Score Right characters from ~
Jaap - 16 Sep 2005 11:57 AM - 5 messages
Hai, Who can help me ?? I'm making a query from a table. In that table there is a column with the name NR_ The rows of that column give a result as  ~2000252 ~2003 ~26578 What i want as result, the most right character from the ~character and as ...
Score Query with user-define function
Helen - 16 Sep 2005 11:51 AM - 8 messages
I have a table with 3 fields. In the first field named a there are values i.e. 5 In the second field named b there are values i.e. 9 In the third field named c there are expressions i.e. a+@q+3*b where a,b ...
Score Trigger - across databases rights?
Henry - 16 Sep 2005 11:26 AM - 7 messages
Hi All I have a trigger which is copying data from a tabel in database A into another table in Database B on the same SQL server - but for some reason fails, without an error (as far as I can see). ...
Score Update Trigger
robin9876 - 16 Sep 2005 10:33 AM - 4 messages
Is it possible in an SQL Update Trigger to get values that where for the record before the update statement was run and then insert these pre-update values and new values in to a different table? ...
Score select in range
ghostnguyen - 16 Sep 2005 10:29 AM - 8 messages
Hi I want to write a SP that has 2 params: @begin, @end. This SP returns records from the order "@begin" to "@end". For example: set @begin = 5 set @end = 10 I want to take records from 5 to 10. ...
Score Transaction Log File - How To ?
Prabhat - 16 Sep 2005 10:03 AM - 3 messages
Hi All, I have few questions for Transaction Log of the SQL 2000 DB. I use the below command to truncate the Transaction Log datafile. backup log databasename with truncate_only dbcc shrinkfile (databasename_log, 100) But how do I do this using the Enterprise manager? ...
Score selecting just a column from a resultset returned by an SP
joeycalisay - 16 Sep 2005 9:20 AM - 5 messages
can i do something like this: SELECT BidID FROM (EXEC BidAccessRetrieve @BidID = 30, @LevelID = 6) where BidAccessRetrieve is an SP which returns a resultset?  I just want to reuse the said SP to obtain the list of BidIDs which I will use ...
Score SQLServerAgent login with xp_cmdShell
marcmc - 16 Sep 2005 8:55 AM - 2 messages
Hi, I have a SQL Job step that uses xp_cmdshell to run a 3rd party application which in turn executes jobs on a remote server. To achieve this, I have had to set the job as a TSQL Job type(i need to validate a parameter before ...
Score Inserting without using INSERT INTO
DNKMCA - 16 Sep 2005 8:46 AM - 2 messages
Hi, How do i insert a value into varbinary column using ASP Here i dont want to use "INSERT INTO" Tx. DNK ...
Score Inserting without using INSERT INTO
DNKMCA - 16 Sep 2005 8:46 AM - 5 messages
Hi, How do i insert a value into varbinary column using ASP Here i dont want to use "INSERT INTO" Tx. DNK ...
Score Multiple databases
Jaco - 16 Sep 2005 8:29 AM - 5 messages
Hi I need to run a masive script on multiple databases (about 20) I only want to execute the script once to then loop and run on all databases one by one. Is there a clean way of doing so? ...
Score Can CASE match more than once ?
Andrew Webb - 16 Sep 2005 7:30 AM - 6 messages
Hi I'm tring to write a statement to analyse what orders were open on the first day of each month from a system and return one data set with the months listed and all the orders open during that month. eg. ...
Score Convert varchar to uniqueidentifier
Markku Vainio - 16 Sep 2005 5:36 AM - 3 messages
When I need to have more info about a process, I run this kind of query: SELECT PROGRAM_NAME FROM master..sysprocesses WHERE program_name LIKE 'SQLAgent - TSQL JobStep (Job %' The result might be something like this: SQLAgent - TSQL JobStep (Job 0x9BD0927CE9086241B582AAAAD7D3B86D : Step ...
Score varchar(8000), varchar(max) and other sizes of varchar truncated to varchar(255)
HB - 16 Sep 2005 5:17 AM - 4 messages
I am using VS 2005 and trying to execute a stored procedure in SQL 2005. This SP takes a parameter @var1 of type varchar(8000). When I debug the SP via VS 2005 debugger and step through the SP code, the value of @var1 is ...
Score Remote Query
Kenny - 16 Sep 2005 5:05 AM - 3 messages
Hi, I would like to know why SQL Profiler return the output shown below and is it possible to tune and avoid this problem? declare @P1 int set @P1=7 exec sp_prepexec @P1 output, N'@P1 varchar(255)', N'SELECT Tbl1019."Name" ...
Score data import using wizard
SQLbeginner - 16 Sep 2005 4:00 AM - 8 messages
Hello, I'm having problem importing a simple comma delimited text file into a simple 3 fields table.  I used the DTS wizards, I got to pick my source text file, but on the following step,  it gave me the following error message. ...
Score SQL Help
Chris - 16 Sep 2005 2:05 AM - 4 messages
Given this simple table: start_date end_date event And this single record: 9/28/2005 10/2/2005 Conference Can I get this recordset? 9/28/2005    Conference 9/29/2005    Conference 9/30/2005    Conference ...
Score SQL Query dump to Excel
Joe Smith - 16 Sep 2005 1:24 AM - 3 messages
I have a SQL Query which I would like to have run and populate an Excel Sheet everytime Excel opens  a document.  Anyone know what the best way to do this? Thanks. ...
Score Server Performance Problem?
Greg C - 16 Sep 2005 1:22 AM - 6 messages
Here are the server's specs: HP Proliant DL580G2 4 x 3.0ghz Processors 3.6gb RAM 2 x 146gb Local Hard Disks 4 x 250gb 2gbps FiberChannel SAN Disks 2 x Power Supplies 2 x 1000mbs Network Interfaces Here's the SQL: ...
Score Loggin Error
Rizwan - 16 Sep 2005 12:59 AM - 3 messages
I am writing a stored procedure to perform a proces. This stored procedure will be scheduled as a sql server job to be run every hour. It is also possible to run it manually in Query Analyzer. Or even call it from EJB (but ...
Score Help, select multiple values on a list
silver_celica73 - 16 Sep 2005 12:46 AM - 4 messages
Hi all, I have a question as follows: i have a look up table, which contains these values. lookup_id 1 2 3 4 5 Let say, i have another table which has record that has 1,2,3,4 references from this look up table. ...
Score How to: CrossTab or Pivot
JDP@Work - 15 Sep 2005 10:58 PM - 5 messages
I need a single row output with respective counts for each column, currently I put my raw data into a temp table and re-populate the final output table. Details... Don't ask for  a DDL or similar beyond what's provided, it's not ...
Score DateDiff question
Willie Bodger - 15 Sep 2005 10:53 PM - 5 messages
Technically, what is the difference between these two pieces:     datediff(day,ONYX.dbo.Individual.dtInsertDate, getdate())>=365     datediff(y,ONYX.dbo.Individual.dtInsertDate, getdate())>=365 I know one does day and one does day of year and their results are slightly ...
Score Need to convert Date from "YYYY-MM-DD 00:00:00.0000" to "MM/DD/YYYY"
Robert G via SQLMonster.com - 15 Sep 2005 9:44 PM - 10 messages
Hello, I was asked to run a query to retrieve some data for my boss.  The query works just fine, however, my boss wants to import the data into his excel spreadsheet, and the date values as displayed in the result set in ...
Score ToolStripContainer and MDI applications?
Carl Mercier - 15 Sep 2005 9:24 PM - 2 messages
Hi, I have an MDI container form (Form1) that has a MenuStrip and a ToolStrip embedded in a ToolStripContainer.  Form1.MainMenuStrip is set to MenuStrip1. The "Content" part has a ToolStripPanel docked to Fill the entire space.  I ...
Score Can I use a computed column for this?
james - 15 Sep 2005 9:03 PM - 6 messages
I have a table with two integers and I want another computed column like so IIF ( colX >= colY, 1, 0 ) but enterprise manager keeps telling me there is an error in my Formula but I do not see what it could be. ...
Score Debugger does not work after install xp service pack 2
matthewmark - 15 Sep 2005 8:18 PM - 2 messages
Urgent. can't debug while we could before the "upgarde". WE waited a year waiting for Microsoft to get all the bugs out. Well, guess the bugs aren't out yet. Anyone know how to solve problem. Using Windows 2000 Server, XP Pro ...
Score Calling Joe Celko (or anyone else that knows)
Mike Labosh - 15 Sep 2005 8:10 PM - 4 messages
(I think you were the one that posted this) Someone asked how to count two different things in one select statement. I had never seen it before and I was deeply impressed. A coworker is asking me how to do two different counts grouped by different ...
Score tried to change column definition
Britney - 15 Sep 2005 7:55 PM - 1 message
Hi Everyone, I tried to change a table column from case sensitive to case insensitive ---ORIGINAL Name VARCHAR(255) COLLATE Latin1_General_BIN NOT NULL , ---NEW CHANGE Name VARCHAR(255) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL but it told me that I can't change it because there is a replication setup ...
Score asp.net datareader+sql server+null fields=error
the friendly display name - 15 Sep 2005 6:28 PM - 3 messages
Following problem: I try to select records where a field is null. i.e.: MyCommandGeneric.CommandText = "select A, b from object where C is null"; MyDataReader = MyCommandGeneric.ExecuteReader(); If I try now to access the values (string bla = MyDataReader["A"]), I am ...
Score dynamic columns/aliases - Continue
romy - 15 Sep 2005 6:23 PM - 4 messages
Hi Following my previous question. Here is the implemetation. I have to design a report which display monthes as columns. The number of columns in the report depends on the range paramters. For example : if the Range is from 01/02/05  to 30/06/05 there ara 6 columns ...
Score Cannot insert the value NULL into column
Jeff Metcalf - 15 Sep 2005 6:18 PM - 6 messages
I have a view - vw_dispatch_owner SELECT DISTINCT CALLNBR, USERID, MIN(CREATDDT) AS C_date, MIN(CREATETIME) AS C_Time, FRMSTAT FROM         dbo.SVC00210 WHERE     (FRMSTAT = '') GROUP BY CALLNBR, USERID, FRMSTAT ...
Score Out of Memory Problem in VB 6.0/SQL Server 2000 Application.
Peri - 15 Sep 2005 6:17 PM - 6 messages
Dear All, I have developed an application which is memory hungry. All the information are stored in the memory (Using Array of Structures) and also in the SQL server database. All the process will be done in the arrays and the final ...
Score Field name question
Ghost Dog - 15 Sep 2005 6:12 PM - 3 messages
Why does SQL Server change the name of a field named Level to [Level]? Level is not a reserved word as far as I can tell, and this is creating a problem when trying to hotsync PDAs to a SQL Server database. ...
Score xp_sendmail only works if mail client is open
Jim - 15 Sep 2005 5:39 PM - 2 messages
Running SQL 2000 sp3a on Windows 2003 server. Outlook 2003 sp1 installed. POP3 and IIS SMTP service installed and working (I can send and receive email) xp_sendmail runs successfully however mail is only delivered if Outlook client is open. Have read: ...
Score Find duplicates
tshad - 15 Sep 2005 5:26 PM - 7 messages
I have a query that I used that was based on the following query that Hugo gave me yesterday (I added CheckNumber in for the problem). I had a problem with finding duplicate check numbers in the table (voids,re-issued checks etc).  It does show in my results, but out of ...
Score Trigger, Identity and error 8102 (URGENT)?
Henry - 15 Sep 2005 4:48 PM - 7 messages
Hi I have a trigger where I want to convert at copy some data from one table (alarm) to another tabel Alarmqueue. Using this query update alarm set alarmcount = alarmcount +1 Gives me this error Server: Msg 8102, Level 16, State 1, Procedure trAlarmsUpdate, Line 10 ...
Score When was a database accessed last
Fredrick A. Zilz - 15 Sep 2005 4:17 PM - 12 messages
I am looking for a way to query a database to see when the last time any of the tables were accessed (select, insert, update, or delete).   Basically I am trying to determine which databases are no longer being used. ...
Score Good or Bad practice?
DazedAndConfused - 15 Sep 2005 3:49 PM - 9 messages
Is it a bad practice to create small, one column tables to store list type data? like, nameprefix: Mr., Mrs., Miss, Dr., Sir name suffix: Jr., Sr, Esq., Md., Phd., I, II, II..... My thought is if you ever want to add to these lists you only have to do it ...
Score Travel Request System
NH - 15 Sep 2005 3:47 PM - 2 messages
Anyone come across a good application\system that can be used internally, just to allow employees to request flights\travel arrangements from the Admin department. Something that manages sign off from mangers etc. The actually booking of the flights\hotels etc is done manually. I just need a system to ...
Score sysjobhistory table
Sammy - 15 Sep 2005 3:45 PM - 1 message
I have  a  step  in  a job that hangs occasionally,  but this step does  not show any errors but I can be certain if the job has not not reached a  step  ...
Score Access Yes/No field equivalent in Sql Server
Jack - 15 Sep 2005 3:31 PM - 5 messages
Hi, I am building a table in sql server. One of the field is equivalent to Access yes/no field. This will have values Yes or No obtained from a form in Asp page. I am wonering what would be the correct datatype for this field. ...
Score substring of char field
TomislaW - 15 Sep 2005 3:31 PM - 7 messages
I have char (1000) field in my table It contains something like binary numbers i.e. 00111000100001000000111110000... I need to take substring (calculating start and length parameters based on some other fields and parameters) of that field and find out if there is any ...
Score Update
Barry - 15 Sep 2005 3:14 PM - 4 messages
Hello, I have a table containing some Account Numbers and I would like to update a column in that table with the total number of transactions for each account. The transactions are in a separate table. I don't want to use a cursor to do this - can anyone help me with the ...
Score Dynamic SQL Queries!
Arpan - 15 Sep 2005 2:48 PM - 4 messages
An ASP application retrieves the DISTINCT records from all the columns of a SQL Server DB table & populates them in drop-down lists. The no. of drop-down lists on the web page depends upon the no. of columns in ...
Score Select time frorm smalldatetime
Aleks - 15 Sep 2005 2:30 PM - 4 messages
How can I select the time only from a smalldatetime field ? Field is called 'dateinitiated' Thanks in advance, Aleks ...
Score Check if files exist Stored Proc
Test Test - 15 Sep 2005 2:21 PM - 9 messages
Hi, This stored proc code uses DOS Copy command and xp_cmdshell stored procedure to copy files form one location to another. See below the code. It is working fine!. What I need is to add a check if the files in ...
Score Precedence of MAX and WHERE
Andrew Webb - 15 Sep 2005 1:37 PM - 4 messages
Hi I'd like to create a query which returns the MAX of a group of dates so long as the number is less than a given date. For example : SELECT MAX(date), username FROM mydatatable WHERE date < '01/01/2005' ...
Score page is too processor intensive to render
PJ6 - 15 Sep 2005 1:21 PM - 3 messages
I thought I was clever getting my first client-side script-emitting grid working where mousing over pops up a little menu of actions in certain cells. It turns out that if I have a good chunk of data, say, 100 rows and 4 ...
Score Text datatype accepts only 8000 characters
Krishna - 15 Sep 2005 1:03 PM - 9 messages
Hi,         I am using sql server 2000.        I have written a stored procedure which takes argument of type text. In stored procedure i am splitting the text argument and printing it. The ...
Score combine text field with ntext field
Sam - 15 Sep 2005 7:32 AM - 3 messages
select textfield + N'-' + ntextfield as myfield from tbl results with error how i can combine text field with ntext field ? thanks ...
Score xp_sendmail
Nikola Milic - 15 Sep 2005 6:34 AM - 8 messages
Hi, Is it possible to save email message directly to Inbox of Outlook with xp_sendmail ? I want to get similar effect as when recipient is not valid. In that case Outlook creates immediately message with subject Undeliverable... placed in Inbox. ...
Score dynamic aliases/columns
romy - 15 Sep 2005 4:51 AM - 4 messages
Hi Is it possible to return a table that its aliases are changing according to varaiables ? For example:  I would like to use something like (ofcourse it doesn't work). declare @p1,@p2 varchar(30) set @p1 ='blhablha' set @p2 ='hghfg' ...
SP
Next »