Archived Months
January 2003
March 2003
April 2003
May 2003
June 2003
July 2003
August 2003
September 2003
October 2003
November 2003
December 2003
January 2004
February 2004
March 2004
April 2004
May 2004
June 2004
July 2004
August 2004
September 2004
October 2004
November 2004
December 2004
January 2005
February 2005
March 2005
April 2005
May 2005
June 2005
July 2005
August 2005
September 2005
October 2005
November 2005
December 2005
January 2006
February 2006
March 2006
April 2006
May 2006
June 2006
July 2006
August 2006
September 2006
October 2006
November 2006
December 2006
January 2007
February 2007
March 2007
April 2007
May 2007
June 2007
July 2007
August 2007
September 2007
October 2007
November 2007
April 2008
all groups > sql server programming > august 2003

Filter by Day: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31

Storing word docs in sql2000
Posted by vishal at 8/31/2003 10:43:05 PM
Hi Can you please tell me how to store the word documents in a table using SQL 2000. I also want to search with in teh documents. I will be very thankfull if you can provide some code for doing this. thanks Vishal...more >>


CURSOR FOR statement
Posted by Ragu at 8/31/2003 8:23:59 PM
Hi All, Can i use the cursor to join the Query statement like a table. Please see the following codes DECLARE XYZ_cursor CURSOR FOR SELECT ID, Lname, FName FROM XYZ OPEN XYZ_cursor SELECT A.Company, B.LName, B.FName From ABC A, XYZ_Cursor B WHERE A.ID = B.ID After run the codes, i...more >>

How about adding an identity column for each table?
Posted by Edward Yang at 8/31/2003 8:08:14 PM
We are developing a database project using ASP.NET/VS.NET. The database ends up with more than 200 tables!!! We have a headache here. In many cases we have to modify the values of primary keys (the customers ask for this)! The original design did not include an identity column for each ta...more >>

newbie backup question II
Posted by mark bixby at 8/31/2003 7:40:23 PM
I've been trying to configure a method to backup a single filegroup within our database but cannot get it to restore properly (db lands in 'loading' mode after a restore). The backup appears to work fine: BACKUP DATABASE mydb FILEGROUP = 'USERINFO' TO backupUserInfo BACKUP LOG Asy...more >>

ConvertSeconds to HH:MM:SS format
Posted by Anand at 8/31/2003 7:23:55 PM
Hi all Is there a built-in function to convert the seconds to HH:MM:SS format? Any sample script to do this??? Thanks in advance. Anand. ...more >>

select query with group by
Posted by priti at 8/31/2003 6:49:38 PM
Hi , I want to do something like this, i.e. select all the rows based on this criteria. select * from contract_selection group by lastname,fname having count(*) =3 Thanks for the help. ...more >>

Reset id
Posted by Arjen at 8/31/2003 6:24:36 PM
Hello, I can't remember the command any more. ;-( I have a table with an id field. The next record id will be 233. Now I want to reset this to null. How can I do that? Thanks! ...more >>

Converting varchar to float
Posted by vansick NO[at]SPAM gmx.net at 8/31/2003 5:10:23 PM
Hi! I'm using the following code in a stored procedure: 'A' = CASE WHEN B > 0 THEN B WHEN C is not null AND ISNUMERIC(C) = 1 THEN Cast(C as float(1)) END The procedure results in the error: 'Error coverting data type varchar to float' I used isnumeric(C) to ensure that only numeric va...more >>



Assignment in dynamic queries
Posted by LIN at 8/31/2003 3:51:51 PM
Hi I have a problem actually i want to assign a value to a variable using a dynamic query. How can i do this. Declare @SqlString as nVarchar(3000) Declare @Tot as Float Declare @CompanyId as Varchar(3) Select @CompanyId = 1 Select @SqlString = 'Select Sum(ReceivedAmt) from Receivables...more >>

Day of the week
Posted by Davef at 8/31/2003 2:37:39 PM
How do you pull the day of the week out of a smalldatetime field -- ______________________ David Fetrow HelixPoint LLC. http://www.helixpoint.com davef@helixpoint.com Interested in Affordable Email Marketing? Check out the HelixMailer at http://www.helixpoint.com/helixmailer.asp If y...more >>

getdate
Posted by Aurelio at 8/31/2003 2:01:42 PM
hello!! thank you for your answer but I couldn't get that... I know that I'm giving back both date and time through a SQL function called "getdate()" ex: date() 2003-8-31 data type (datetime) time() 14:30:00 data type (datetime) my question is: how can I have both date and time t...more >>

question
Posted by u50415039 NO[at]SPAM spawnkill.ip-mobilphone.net at 8/31/2003 5:27:59 AM
#temptable got order,fname and age. trying to find two high maxes per each order. query returns (1) but (2) is correct answer. supposedly, max(age2) < max(age1). **** select d.order,case d.t when 1 then s.fname else null end as fname, case d.t when 1 then s.age else null end as age1, case d....more >>

Change 1299.99 to 1,299.99
Posted by Ericsson at 8/30/2003 9:36:52 PM
Hi All, Please kindly tell me how to change the number to a format with comma in store procedure of transact sql. Thanks in advance. Ericsson ...more >>

Query Help Needed
Posted by Larry Gibson at 8/30/2003 7:03:09 PM
Well, guys and gals, here I am again with a problem I can't quite figure out. Anyone give me a push in the right direction? I have two tables in a database, one contains a list of services given and the other has a list of people and their addresses. I've stripped these two down to the essenti...more >>

Updatable Cursor in T-SQL
Posted by JB Casse at 8/30/2003 3:08:24 PM
Hello, I am having a problem updating a table through a cursor in a stored procedure. I think that I am missing some syntax. It compiles fine and runs without error but my table has not been updated. I use the following code: DECLARE patientCursor CURSOR FOR SELECT PatientName FROM Fac...more >>

Primary keys for one-to-one tables
Posted by Robert at 8/30/2003 1:52:43 PM
I am designing a database for storing mutliple types of information relating to members of a particular medical group. For various reasons I want to keep the main table with the members names narrow and therefore need to create a number of additional tables to hold other information that is in a...more >>

country flags
Posted by Arda at 8/30/2003 1:33:53 PM
Firstly hi to all, I have collected countries short names into SQL Country column.(e.g. US-United Sates, RO-Romania,TR-Turkey). I want to combine them with the country's flag picture.(e.g. US.jpg,RO.jpb,TR.jpg) I mean I want to make a datagrid which shows the Country column with the flag pic...more >>

2 fk constraint in 1 field
Posted by Helena at 8/30/2003 11:42:11 AM
I have ONE FIELD in the child refering to 2 parents. So, for me to enter a value in this child fk field, the value must exist in BOTH parent. Otherwise I get a fk violation error message. OK. However this is what I'm try to do: If "some_other_field" in the child table = 'X' only consid...more >>

UDF deoptimizes query
Posted by JXStern at 8/30/2003 11:18:48 AM
I have code like: select whatever from mytable1 t1 inner join mytable2 t2 on t1.x=t2.x and myudf(t2.y)=1 This replaces code that read: select whatever from mytable1 t1 inner join mytable2 t2 on t1.x=t2.x and t2.y in (1,3,7,11) It should be obvious what the UDF does: CREATE FUN...more >>

problems with simple SQL statement
Posted by Branko Kaucic at 8/30/2003 11:18:21 AM
Hi all! I am using c# and MS SQL server and by performing this statement: CREATE TABLE tabela3 (id INT(10) AUTO_INCREMENT, ARFNRA ARCHAR(2),ARARTA VARCHAR(20),ARABZ1 VARCHAR(21),ARABZ2 VARCHAR(21),ARGLAG VARCHAR(6), ARGBAG VARCHAR(30),ARGLLI VARCHAR(6),ARGBLI VARCHAR(30),ARGLWA VARCHAR(6...more >>

Number generator - how?
Posted by Lars Dybdahl at 8/30/2003 10:44:58 AM
I'm migrating a database from Borland Interbase and cannot find out how to create a number generator in Microsoft SQL Server 2000. I tried the obvious: create generator mygenerator; (Generator is the same as postgreSQL's sequence) As far as I can see, the only thing that can generate un...more >>

Are StoredProcedure ad hoc queries possible?
Posted by rooster575 at 8/30/2003 7:15:00 AM
I have may places in my web application where a web form is used to query the database. I would like to take advantage of stored procedures to make results faster and overhead lighter, but I don't see how I can use them for these "ad hoc" style queries. For example, if you can select: Regi...more >>

Adding a new populated column in a table
Posted by Emu at 8/30/2003 1:00:02 AM
Hi, I added a new column into a populated table and then via INSERT INTO dbo.tblExpired (Mod) SELECT 'TURI' I tried to populate it with the word TURI but I get this error: Cannot insert the value NULL into column 'AlreadySaved', table 'Warranty.dbo.tblExpired...more >>

How to find no. of Fridays in a month
Posted by Muhammad Usman at 8/29/2003 10:36:21 PM
Hi Our Week ends on Friday. We want to calculate the Weekly average on the basis of total no. of Fridays in a month. Is there a way to calculate No. of Fridays in a month? Thanks in advance Muhammad Usman IFFCO musman@iffco.com...more >>

where can I find sql server system tables poster. thanks.
Posted by sunita at 8/29/2003 10:13:16 PM

date and time
Posted by Aurelio at 8/29/2003 7:18:44 PM
Hello to everybody! i've just a little question... how can I have updated time and date so that they are distinguished with two different functions in SQL 2000 server?? thanks a lot!! aurelio ...more >>

Problems applying SP3a
Posted by Venkat Venkataramanan at 8/29/2003 6:38:34 PM
When I tried to apply SP3a, the window said "Validating password. Please wait..." Well, I waited until it timed out and I got the error message. I made sure that I am able to start SQL Server and sign with the sa credentials I supplied during the above process. Can somebody guide me...more >>

FULL Cascading a delete to itself: Reflexive relationship
Posted by James Cooke at 8/29/2003 5:54:12 PM
Hi all, I have a single table that is related to itself. It is called Navigator. [Tree] [int] IDENTITY (1, 1) NOT NULL , [ParentTree] [int] NULL , [NodeName] [char] Each Navigator.ParentTree has 0:Many Navigator.Tree. ie Tree ParentTree NodeName 1 0 ...more >>

Problem Grouping Date Data
Posted by Alastair MacFarlane at 8/29/2003 5:17:00 PM
Dear All I have a Table with 2 Columns among others: ReadingDate - smalldatetime (Default Value: gatdate()) ReadingValue - tinyint (Values from 1 to 200) I am trying to create an output like the following: Date Total 30/08/2003 - 100 29/08/2003 - 110 28/08/2003 - 3 27/08/2...more >>

converting varchar to integer
Posted by Helena at 8/29/2003 5:06:19 PM
I have this data as a varchar datatype - 001 002 01 03 25 78 How do I load this in a integer field without loosing the zeros on the right of the numbers?...more >>

Update from PriceList..?
Posted by Kent Johnson at 8/29/2003 4:26:38 PM
Hi all, I have a table with Prices and I would like to update the Statistic table with the prices: PriceTable Price FromMonth ToMonth 10 1=January 10=October 20 11=November 12=December The price 10 is valid between January and October Between November and December the price i...more >>

Server Registration Indicator (Red Squiggle)
Posted by Kirby at 8/29/2003 4:02:35 PM
Hello All, While doing a re-boot of one of our servers, the MMC console icon changed. What usually is an Icon of a Mini-Server and a Right Facing Triangle was replaced with a Mini-Server and a Red-Squiggle. Does anyone know what this means, I looked up Status, Indicator, Red, and several ot...more >>

Query to combine two 'many:one' tables
Posted by Jon Maz at 8/29/2003 3:40:47 PM
Hi, I'm hoping someone can help me with an SQL query (SQL Server 2000). There is a many:one relationship between my Cases table and my Clients table (a Client can have n Cases). I'd like to combine the Cases and Clients table to give the following result set: ++++++++++++++++++++ TARGET...more >>

To create SP to Exclude data of All tables
Posted by Frank Dulk at 8/29/2003 3:38:30 PM
I have more than 150 tables in my bd and I need to clean all of them, as I can make that through a stored Procedure. ...more >>

Prob with a table
Posted by Martin vom Bruch at 8/29/2003 3:06:25 PM
Hallo i have a problem with a table. In this table is 1 column stand this: @J >3p2000002359FF8000000100000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000 @J >3p2100002359FF8000000500000000000000000000000000000000000000000000000000000 0...more >>

Does anybody know how to use ADO in Extended Stored Procedure?
Posted by Jasper at 8/29/2003 2:41:52 PM
Please, I've tried everything I can think of to get the ADO Open connection method to work within a VC++ unmanaged .NET AppWizard generated Extended Stored Procedure. If anyone has gotten this to work, please feel free to share. I do not want to resort to dblib (actually cannot use dblib i...more >>

Help with developing my idea
Posted by Yaheya Quazi at 8/29/2003 2:41:28 PM
Hi, I have this query that I run here is a sample run from that query.. order_num item user 1 A A 2 B A 3 B A 4 A B 5 A B I run a pretty complex query to get the result as the above. Now my question is I want to send an email to User A with all the rows that has the User A in it. Em...more >>

Very simple query...
Posted by Sender at 8/29/2003 2:32:01 PM
Using DTS Wizard I have created (and saved package) which copies data from a notepad file to a SQL Server Table. I want to run this saved package (package name mypackage) from a stored procedure. Please tell me in simple steps... ...more >>

Stored procedure, insert, trigger...
Posted by Miroo_news at 8/29/2003 2:08:07 PM
Hi, Is there a possibility to find out inside a trigger if insert/update is inside a stored procedure or is it standalone (e.g. in Query Analyzer)? Regards, Miroo...more >>

Problem Using Parameter in ALTER TABLE Stored Procedure
Posted by Larry Stinson at 8/29/2003 2:04:41 PM
I want my application to have the capability of adding columns to an SQL table by providing parameters for the table name and the column properties. I successfully wrote a stored procedure that adds a column to a table where the column name and properties are stated directly in the SQL script. Bu...more >>

fill factor
Posted by PCH at 8/29/2003 1:41:59 PM
When you are creating or editing an index, you can set the fill factor % which controls how much room on the page that sql should leave before splitting. my question is... if you give a value of 10%.. does that mean that only 10% of the page is used, and 90 available, or that 10% is left free ...more >>

Datetime based error checks in store procs
Posted by Joshi at 8/29/2003 1:34:09 PM
Hello all, I am re-thinking an existing buildout on a query which is embedded within an application and need some help. Here is what the query is supposed to do: Get Sales details from the fields [1]. "FROMDATE" by user- defined date range and; [2] "PAIDDATE" by user defined Paid Da...more >>

UDF...thi is really difficult...
Posted by fabriZio at 8/29/2003 1:30:59 PM
How can I write an UDF that does this work first input --> '0x800000000000000000000000000000' second input --> '1' output --> 'CAST(SUBSTRING(Column,1,1) AS INT) & 128 > 0' I pass to UDF binary value and it returns me the clause CAST... according the first bit is ON in mask. Thx very...more >>

Query Processor Error
Posted by Mark Frank at 8/29/2003 1:05:36 PM
Hi all, I got the following error I haven't seen before and am not sure how to avoid it or how to remedy it. Any ideas would be greatly appreciated. Thanks in advance. Internal Query Processor Error: The query processor ran out of stack space during query optimization. Mark Frank...more >>

MSSQL2000 problem -view not working
Posted by Arthur Hoornweg at 8/29/2003 1:00:27 PM
Hello all, sorry for the double-posting; I have just found out that my problem is MSSQL specific and not ADO specific because it happens in Enterprise Manager also. I have a VERY VERY weird problem (MSSQL 2000 SP3 on Windows XP pro SP 1) In order to implement row-level security I have ...more >>

NText > Money
Posted by Henry at 8/29/2003 12:22:36 PM
What is the best way to convert a value stored in an NText column to Money. Thanks Henry ...more >>

breakpoints not working
Posted by jay at 8/29/2003 12:18:37 PM
When I attempt to debug a stored procedure in SQL2000 using Query Analyzer, my single step buttons are disabled and breakpoints are ignored. SQL is not running on a system account, and the procedures are owned by the dbo with no duplicate names. Obviously I'm missing something but I ca...more >>

T-SQL Weirdness
Posted by DaMan at 8/29/2003 11:54:50 AM
I have an SQL statement that I have abbrev. for example but it still blows up. I essen. select data between 2 times in format HH:MM:SS. the @tmpvariables are NVARCHARS. Here it is: insert into mytable SELECT * FROM alarmevents WHERE (convert(nvarchar,alarmevents.EventTime,108) between @t...more >>

sql performance
Posted by Joel Russell at 8/29/2003 11:43:02 AM
Thanks in advance for the help. I've got a query that runs <1 second in Query Analyzer but takes +10 seconds in my ASP page. I'm connecting via ADO using a server side, open static, lock read only recordset type. I've tried different combinations but nothing seems to work. The SQL is used for a...more >>

How do I insert a character in front of some data?
Posted by Sam at 8/29/2003 11:13:41 AM
Hi, I wanto to insert some dashes "-" in front of category names. I know how to insert just one dash. But the number of dashes I will insert also comes from the database. CategoryName -- Depth Autmobile -- 0 Accessories -- 1 Batteries -- 1 Brand A Batteries -- 2 Brand ...more >>


DevelopmentNow Blog