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 > january 2004 > threads for thursday january 29

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

SQL Query problem
Posted by Gee at 1/29/2004 10:55:15 PM
I have a table listed below where I store a record everytime a user connects and another record everytime they disconnect. The ConnectDateTime is always entered but the DisconnectDateTime is only in the record when they disconnect. Problem: I want a query to see what the connections peeked ou...more >>


Query to group latest posts by author
Posted by Cyrill Vatomsky at 1/29/2004 10:30:57 PM
Here is a simplified version: Table Authors: AuthorID(int) Name(varchar) Table Articles artID(int), authorID(int, foreign key to Authors), Date (smalldatetime), ArtTitle (varchar) The trick is that authors publish randomly, one can publish every day, another once a week, yet another once ...more >>

Linked server querying
Posted by Hassan at 1/29/2004 9:52:11 PM
I am trying to run a query against a linked server and it doesnt seem to work properly This is what I ran select * from openquery(LS, 'declare @server sysname select @server = @@servername select @server select * from master..sysdatabases') This only return the value of @server and not...more >>

Help Getting started with DTS
Posted by John Rugo at 1/29/2004 9:17:30 PM
Hi All, I am just trying to figure out how to use dts. I've used the wizard in enterprise manager to export data to an Excel File; but I would like to take it further. Currently I am calling a stored procedure from a vb.net application that pulls in the data and then exports it out to an Exc...more >>

combining Columns
Posted by Gurra at 1/29/2004 7:28:02 PM
I have a table that looks like this: Now i want to make a Selection where i only get one of each uniquie value from column 1 and every value in column 2 combined when the have same value in column 1 I would also like to add some text between the merged columns if its possible. Table Colum...more >>

Migration from access to sql sever 2000 (problems)
Posted by RSK at 1/29/2004 6:51:40 PM
Hi, I use nttacplus (ISP accounting software). It use ODBC for accounting and it can use MS access or SQL server. when I'm using the access it works correctly but when i migrate to SQL server 2000 by exporting data from access and other required settings a problem occure: NTTacPlus must update...more >>

Query result into a .DBF format
Posted by Michael at 1/29/2004 6:48:55 PM
Is there an easy way to programmatically output query results from query analyzer or a stored proc into a .DBF format (dbase 4,5, foxpro)? Thanks! ...more >>

Save results of a query to a file
Posted by Heidi at 1/29/2004 6:33:44 PM
I want to setup a job that will send results of a select query to a file. Any ideas??...more >>



How to restrict the connection for certain application but not everyone ?
Posted by Ang at 1/29/2004 5:52:45 PM
Hi, I'm using JDBC to connect to MS SQL server. My Java code only need to = link to the url (eg : ) to access the data. But some data are sensitive = and I don't want any application and retrieve them. What can I do to = restrict only some certain application can retrieve them ? Thanks....more >>

Exists vs. In
Posted by Brian at 1/29/2004 4:02:27 PM
Hi all, I was wondering from a point of optimizing which was faster...using a = correlated subquery with exists or using in. Here are 2 examples... Option #1 select A.Column1, A.Column2 from TableA A=20 join TableB B on A.ID =3D B.ID where exists (select Column3 from TableC where ID =3...more >>

Bulk insert Format File
Posted by Nomi at 1/29/2004 3:57:36 PM
Hi, I am using bulk insert to populate a table from file.It works fine in SQL Server 2000. But in case of SQL Server 7 when i change the version no. to 7.0 in format file and execute the same statement it gives me the following error: Server: Msg 4823, Level 16, State 1, Line 1 Could not bul...more >>

Searching for ranges of values in ntext column
Posted by Mario Vargas at 1/29/2004 3:37:42 PM
Hello, everyone. What would be the best way for me to search for a range of values in an NTEXT column that has been full-text indexed? To be more precise, I have a table of newspaper classified ads. My table contains a full-text indexed column, called "AdText" of type NTEXT. I am able to su...more >>

Copy BLOB within TSQL ?
Posted by Donald Welker at 1/29/2004 3:34:32 PM
I have two tables that each contain a column of type Text. [I have to = use Text because all of the strings are over 8K (but not so long that it = isn't worth putting them into SQL.)] A situation has arisen whereby I = need to copy Text values from a set of records in one table to their = coun...more >>

Synchronize record in another table after record is updated?
Posted by Tim Burblehoff at 1/29/2004 3:27:27 PM
How is this done? I need to be able to do this for specific records only.. so if record A in table 1 gets updated, record A in table 2 gets the same update also. Thanks ...more >>

select field name base on condition
Posted by culam at 1/29/2004 3:24:34 PM
Hi, Please help, I am trying to select different field for different month base on the below conditions. Ex. curbudjan, curbudfeb... are fields name. The codes below give me value not field name... Help! Your help is greatly appreciated, Culam select field1, CASE MONTH(GETDATE...more >>

Distinct Left Outer Join Multiple table Headache
Posted by mblacky2000 NO[at]SPAM hotmail.com at 1/29/2004 2:51:23 PM
Hi, I've written the following query to determine if a person who has approved a purchase order has also approved the receipt for that purchase order. The query returns fields from po and postatus that have the same ponum and also from ServRectrans where the ponum is the same as postatus and...more >>

How to create a global variable that can be used in stored procedures
Posted by Erik Huisman at 1/29/2004 2:43:20 PM
Hello, When a user logs on in our application (created in c++) i want to create a global variable for this connection that i can use in stored procedures. In Sybase SQL Anywhere i do this with: CREATE VARIABLE APP_COUNTRY CHAR(10); SET APP_COUNTRY = 'NL'; It is now possible to use AP...more >>

How to pass a search string in a stored proc like google
Posted by GhislainTanguay at 1/29/2004 2:13:24 PM
Hi everyone, i want to pass a undetermined number or words in a sp, each one separate by a comma. What I have to do with my sp for this search to work. Ex.: Somedody want to search on "Man,Company,Print" and a another want a search on "Toto,Apple" Stored Proc FindWord @strSentence /...more >>

String or binary data would be truncated. Field length checked.
Posted by m_evergreen NO[at]SPAM yahoo.com at 1/29/2004 2:02:17 PM
Thank you ahead for any help. I am programming in asp.net(vb.net), using a stored procedure, trying to update a record in sql table. Please advise me if I should be posting this question somewhere else. The column in the sql table was originally a varchar(10), my program was set to send varc...more >>

referencing a table by variable
Posted by Rob at 1/29/2004 1:56:10 PM
Hi I'm trying to create a function that takes a table name as a parameter. I want to execute something like the following INSERT INTO @destTableNam .. where @destTableName is a variable that stores the name of a predefined table, e.g. [PCADatabase].[dbo].[People]. I tried setting...more >>

User Defined Functions
Posted by Rick at 1/29/2004 1:55:05 PM
If I have a User Defined Functions set up and I need to pass a variable = from TSQL i.e. a select statement what is the syntax I use to pass that = variable. I cannot get this code to work. Please help if you can... Select field1, field2, ud_Myfunction(myverable) from mytable THANKS IN ...more >>

.Net Framework 1.0.3705 and SQL Reporting Services
Posted by Adrian.Biljan NO[at]SPAM bnwsoftware.com at 1/29/2004 1:34:43 PM
Hello all, We have a windows client application project that is built with the ..Net framework 1.0.3705. I understand Reporting Services uses the 1.1 framework. This application calls a web service to run its business logic, and subsequently uses SQL Server 2000 to store data. We would like ...more >>

Advice on coding
Posted by brianke NO[at]SPAM yahoo.com at 1/29/2004 1:32:34 PM
I have been asked to develop a web based timecard submission program for our department here at work. I have been working on this for about a month and would like to get some feedback on where my coding may be less than optimal. I have pasted two small asp pages below and and mainly concerned ...more >>

Running a script file thru ADO
Posted by Adam Right at 1/29/2004 12:59:02 PM
Hi, I need to make some changes on database and scripted every change in a sql server script file. But what I need is to run the contents of this file using a VB program thru ADO. Is there a way to do this without imbedding entire text file to code and running every line one by one ? ...more >>

'cursor threshold' problem
Posted by J Y at 1/29/2004 12:57:52 PM
I have a stored procedure which has a cursor c_Emp. Inside this cursor we declare 7 cursors (1 for each day), c_Day1, c_Day2, ..., c_Day7. Then we look at @@CURSOR_ROWS for each of these 7 cursors to see how much data is there for each cursor and then process it. Problem is @@CURSOR_ROWS is retu...more >>

date retrieving from sqlserver using ASP
Posted by Girish at 1/29/2004 12:44:13 PM
I have date in this form stored in sqlserver 2004-01-29 10:24:41.000, when I retrive it using formatdatetime vb function I get output as 12/30/99.. Any ideas please... ...more >>

Displaying user permissions
Posted by Eric D. at 1/29/2004 12:29:18 PM
Hi, I would like to know how to view the current users permissions. Here's is something that I tried to accomplish, but was to no avail: declare @username VARCHAR(20) set @username = (select user) sp_helpuser @username This just gives me an error. TIA, Eric...more >>

converting float data type to "datetime" data type
Posted by mitra fatolahi at 1/29/2004 11:44:07 AM
Hello Everyone, Our java application stores date and time of day in a SQL Server 2000 table using float data type, e.g this value "1075401269682" for this date and time of the day "1/29/2004 10:34:34 AM". In the same table we have a different column that our application stores the date...more >>

Adding entry to DB and getting unique ID at the same time
Posted by alex NO[at]SPAM totallynerd.com at 1/29/2004 11:36:34 AM
Hi all, I'm writing a website with Cold Fusion and when a user submits a request and it's stored in the MS SQL database, I want the unique ID (Identity field in table) to be given to the user on screen plus emailed to user. Now can I store data to the database (where the ID is created) and ...more >>

Profiler - sp and long query
Posted by Hutch at 1/29/2004 10:41:08 AM
If I can recall you can’t see individual queries inside a SP using Profiler, correct I want to start looking for queries that are running more than 30 seconds. Most of the “bad” queries I think are in SPs. What I’m thinking is that if I profile with a filter on duration greater than 30 se...more >>

Stored Procedure Input\Output variable
Posted by Kelly at 1/29/2004 10:16:15 AM
How do you define a parameter in a stored procedure as an input\output variable....more >>

Problems setting sqlagent proxy account
Posted by Rafael Wittek at 1/29/2004 10:07:41 AM
hi, i have a problem setting the SQL-Agent Proxyaccount. I always getting the errormessage: "Error executing extended stored procedure: Specified user can not login" The error messege appaears both in Enterprise Manger and in xp_sqlagent_proxy_account I have already set an win2k-account as...more >>

Help Editing a View
Posted by Tony Schlak at 1/29/2004 9:58:22 AM
I have a view that looks like this: SELECT tblDirectory.DirID, vwDirListByLastFormal.Name, tblDirectory.Pic_Loc AS Photo, tblDirectory.Email, vwDirStudents.Active FROM tblDirectory INNER JOIN vwDirListByLastFormal ON tblDirectory.DirID = vwDirListByLastFormal.DirID INNER JOIN...more >>

SQL Query Linking Question
Posted by MJ at 1/29/2004 9:42:42 AM
I would like to write a SQL query fo a VB application and I'm affraid that I am having problems. In an example where you have two tables of Departments and Employees where each employee record is linked to their department. I need to create a recordset which contains departments that have no l...more >>

date time conversion to chinese problem
Posted by hkjamjam at 1/29/2004 9:41:11 AM
Can i convert the date time in ENg from Database to CHINESE easily?? or I have to map all 12 months??? thx ...more >>

SQL Oddity
Posted by Cliff Harris at 1/29/2004 9:38:05 AM
Not sure if this is the place for this post, but it involves a SQL query, so I'll try here first.. I have a sql query that loops through all of the records in master.dbo.sysdatabases and then I loop through each database and using an exec statement, I check to see if the database has a specifi...more >>

formating tapes
Posted by ee at 1/29/2004 9:37:26 AM
Hi, Is it possible to format backup tape (sql server) through T-SQL statement? Thanks...more >>

Appending
Posted by Skip at 1/29/2004 9:22:50 AM
Hi, What's the easiest way to append data from a query to another table? I have an existing query that returns data from multiple tables. The result of that query is data that I'd like to append to another table. Now, please note that all the columns involved in both the result and t...more >>

Not Exists
Posted by anonymous at 1/29/2004 9:16:59 AM
In first query I am getting result back.Second query should get the same data back (just different syntax). I can't see where my error is, but my second query is not returning any result back.Pleae help 1.select a.lastname from Table1 a Left join table2 b On a.lastname=b.last 2. select ...more >>

Not Exists
Posted by anonymous at 1/29/2004 9:16:46 AM
In first query I am getting result back.Second query should get the same data back (just different syntax). I can't see where my error is, but my second query is not returning any result back.Pleae help 1.select a.lastname from Table1 a Left join table2 b On a.lastname=b.last 2. select ...more >>

Joining warehouse table with many child lookups
Posted by Alexander Dumas at 1/29/2004 8:40:26 AM
Hi... I have a fact table with over 30 keys referencing other tables. I remember some time ago, that there were issues with trying to join over 8 or 10 tables. I'm using SQlServer 2000 and don't know if it is still an issue. In any case, what is the best way to construct the sql statemen...more >>

Counting mths back frm today's date
Posted by J. Joshi at 1/29/2004 8:36:42 AM
How would I populate a temp table datetime column that would include 25 rows? The values required are today's date - (minus) 1 month back, 2 months back, 3 months back, etc etc throuough 24 months back in a datetime format? However, the months back should always appear as of the 15th of a ...more >>

Ordering question...
Posted by Greg at 1/29/2004 8:08:01 AM
I have a test table with 2 columns, a varchar column and an int column. I'm trying to order the results so that it first orders decending by the int column but group together the related varchar column. Here's an example of what I mean: data in table: Apples, 2 Apples, 1 Oranges, 5 Apple...more >>

help with IDENTITY and INSERT
Posted by ChrisH at 1/29/2004 7:31:09 AM
Note: I am new to the SQL environment so please excuse any "newbie" mistakes I may make.. Am currently converting an Access app to SQL back end and have run into a problem. Tables are set up to retrieve monthly data and then copy to a history store. Users can re-process a past month, so the logic...more >>

export image
Posted by Warren at 1/29/2004 7:12:31 AM
I'm new to images and wondering if this is possible. I have a table containing an ID and an IMAGE. I have 2335 pictures of people with unique ID numbers. Can i export all of these pictures to JPG's to a folder with the ID number as the file name? is this possible? thanks, Warren...more >>

Help with Stored Procedures
Posted by brian at 1/29/2004 6:31:29 AM
Does anyone know of some good internet resources on writing stored procedures. The language confueses me as I have been trying to learn them through my own and looking at examples. I use views for everything and I know that some of the stuff I do S.P. would be more beneficial. I have ...more >>

Production Version of SQL Reporting Services Error
Posted by jtwright NO[at]SPAM tycovalves.com at 1/29/2004 6:30:49 AM
I have installed the MSDN version of SQL Reporting services. During the installation I got an error from InetInfo.exe. Event Type: Information Event Source: Application Popup Event Category: None Event ID: 26 Date: 1/29/2004 Time: 8:20:48 AM User: N/A Computer: PC2194 Description: Ap...more >>

string from select result set
Posted by sivrik at 1/29/2004 6:11:11 AM
Hi all, Is there anyway to make a string from a select statement or series of statements where the result set is more than one record? I was trying to avoid a cursor or loop. Here's what I mean: Say I have the table "Name_List" with one column "FName", VARCHAR(20), and the table contains the f...more >>

Access Report + SQL Server SPROC
Posted by Steveo at 1/29/2004 5:48:17 AM
Server = SQL Server 2000 SP3 + Windows 2000 SP4 (MDAC 2.8) Client = Access 2000 SP3 + Windows 2000 SP4 (MDAC 2.8) I have a sproc as the record source for an Access Form, which is fine. I have an Access Report which is based on the same sproc, but it is not fine. Every time the report loa...more >>

Business Logic Object as Data Source in SQL Reporting Services
Posted by janne.hasslof NO[at]SPAM stenaline.com at 1/29/2004 4:23:52 AM
Hi all, I'm running SQL Reporting Services and my question is: Can I connect the datasource of my reports to a business logic object that returns a dataset instead of using a direct connection to a SQL Server? Anyone that knows if and how this can be done? Regards -Janne Hasslöf...more >>

Can I put my SQL database in Source Safe?
Posted by SVD at 1/29/2004 2:46:38 AM
Hi, I'm developing an app in C#, but I'm new to database development. I designed my tables visually, put in some default table data, and was wondering if I can check my database into Source Safe. If so, how, and what files get checked in. In general, how is database development typically ...more >>

Schema Binging Of Views
Posted by Sunny at 1/29/2004 1:58:38 AM
Hi What is the schemabinding in views? what is the purpose why and when should it be used Sunny...more >>

Using 'like' in sql statement
Posted by ezree at 1/29/2004 12:26:11 AM
Hi all I have a problem of getting a correct information from my database, I have a table call PM_Ref and one of the column is PM_Desc. If I'm using the statement belo select count(* from PM_re where pm_desc like 'Close There are some record but when I use like belo select count(* f...more >>


DevelopmentNow Blog