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 > july 2003 > threads for wednesday july 30

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

Multiuser systems based on transactions
Posted by Vadym Stetsyak at 7/30/2003 10:49:16 PM
Hi there!!! Where can I get info about how to build the sql logic/statements while under multiuser mode. Under multiuser mode I mean that data in the tables is modified by multiple users and all the activity is performed in the transaction bounds. I am using rowlock to synchronize the acces...more >>


Batch Inserts
Posted by Ron Vecchi at 7/30/2003 10:13:22 PM
Is there a way to implement a batch INSERT. Currently in my asp.net code I perform a loop. As each loop runs through I construct my Insert command and execute it through ado.net. I was just wondering if you can construct some sort of a batch INSERT command. Mabey pass an array or hash of i...more >>

Newbie Database table design question (guid)
Posted by William Campbell at 7/30/2003 8:18:03 PM
I had posted this to microsoft.public.sqlserver.server a day and a half ago, with no response. I'm guessing I posted it to the wrong forum, because this should be a simple question for anyone that has ever had to design a database. Apologies if this is the wrong forum. Please direct me otherw...more >>

SQL Dates...
Posted by Paul O'Brien at 7/30/2003 6:19:42 PM
Hi I have a start date and an end date. I need a select statement that will, starting from the start date, return a recordset consisting of the date at X days interval upto the end date. Eg startdate 1-1-2004 enddate 1-2-2004 recordset should look like this where X=7 days... 1-1-2004 ...more >>

SQL Performance
Posted by Leandro Loureiro dos Santos at 7/30/2003 6:00:08 PM
Friends, Is there any problem with query performance when i have a query using IN or NOT IN in a SELECT statement. Thanks Leandro Loureiro dos Santos ...more >>

Autonumeric type?
Posted by Oscar Espinosa (Egaraset, S.L.) at 7/30/2003 5:51:09 PM
Hello, I'm doing a query with an SQLQuery to MSSQL 2000. I'm trying to make a list of the fields of a table and their types. I know the data types except one: autonumeric. When I design a table, an autonumeric field it's a integer field with the identity property. How can I know if an integer...more >>

SELECT
Posted by David NO[at]SPAM Work at 7/30/2003 4:39:46 PM
I'm looking for a way to add 4 'default' values into the beginning of a select statement in a stored proc select * from tbl_new where id = @id that would return 'me', 'you', 'something', 5 'me', 'you', 'something', 6 'me', 'you', 'something', 7 BUT, I would like to be able to have...more >>

IDENT CURRENT
Posted by Simon at 7/30/2003 4:35:23 PM
I have table with PK on 2 columns: ID and Date are columns for primary key. If there is only one column for PK, I can get the last PK with ident_current: select ident_current('tableName') How can I get the PK, if it's combined from 2 columns? Thank you for your answer, Simon ...more >>



Is Null returning incosistent results -- help!
Posted by jason NO[at]SPAM hob.com at 7/30/2003 4:23:50 PM
We have a very large database of customers and we are trying to do a count on whether a specific field in the customer table is null or not null. The numbers are changed for privacies sake but here is what's happening. SELECT count(*) FROM maillist result: ~4000 ---- SELECT count(...more >>

Find data not exist in tableA, but in tableB
Posted by Mindy Zhang at 7/30/2003 3:51:50 PM
Hi, I have two tables, tableA and tableB. They have a same column named, COLUMN11. Here are data in these tables. tableA COLUMN1 AAA BBB tableB COLUMN1 AAA How do I find data value BBB which does not exist in the tableB? Thank. Mindy ...more >>

Executing SP in Job
Posted by Gonçalo Boléo at 7/30/2003 3:46:48 PM
I'm using a job to execute a sp accross linked servers over the internet. In query analyzer the sp executes fine, but in the job i have the following error: Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection. [SQLSTATE 28000] (Error 18452). The step fail...more >>

Why would xp_cmdshell stop working?
Posted by Richard Sutterfield at 7/30/2003 3:02:13 PM
I have a stored procedure that stopped working today. The code that fails uses xp_cmdshell to run pkzipc.exe. I have reduced the procedure to the following code that is failing. Running this from cmd prompt works fine - from my sp, runs forever without doing anything. set @cmd = 'pkzipc -e...more >>

SQL / Stored proc help
Posted by vf at 7/30/2003 2:27:15 PM
Hello, I'm hoping someone can help with this. I'm looking for a sql statement to get me my results. If somehow I can use a stored proc, that'd be cool too, but I know nothing about them (I am doing this to display on the web with ASP). I have a games table. table: GAMES game_id game_...more >>

Generating a Rank column
Posted by Neil at 7/30/2003 2:26:06 PM
I have a written a SQL query which extracts a subset of data and sorts into order, e.g. SELECT cust_id, cust_name, cust_total_spend FROM cust_data ORDER BY cust_total_spend DESC Within the select statement, I would like to generate a 'ranking' column that simply increments from 1 to 'n' ...more >>

reorganizing a data / table by SQL
Posted by Tulga Kalayci at 7/30/2003 2:25:38 PM
Hi, I have some data in a table (in 3 columns) as follows: Type Month Amount Advertising July 150.0 Banking Charge July 980.0 Food July 1560.0 Advertising August 120.0 Banking Charge Aug...more >>

Dynamic Query and Quotes
Posted by Ale K. at 7/30/2003 2:06:44 PM
i'm creating a Dynamic Query inside one of my stored procedures, and i got the following question... if i use quotes for setting my Dynamic Query inside a string, how do i set a text inside the Dynamic Query: EX: Select @Sql = 'Select * From Teams where Category = ( i want to use here quotes fo...more >>

How to... Query??
Posted by Ale K. at 7/30/2003 1:35:28 PM
Hi, i need some help designing a query. let's say i got 2 tables from a Soccer Tournament DB, TEAMS PLAYERS TeamID---------------I PlayerID TeamName I----------------TeamID Etc..... ...more >>

Converting City/State field
Posted by Andy Williams at 7/30/2003 1:34:54 PM
I'm trying to convert a combined City/State field in one table into separate City and State fields in a destination table using the following method. Let's say that: Table1.CityState = "Columbus, OH" and I want: Table2.City = "Columbus" Table2.State = "OH" so I'm trying: ...more >>

Problem with the Date Format in SQL Server
Posted by sumathi at 7/30/2003 1:18:30 PM
Hi My Application is designed for 5 languages.English,Spain,France,Japan and Germany. It works fine for all other 4 languages except France.The Problem is When Retreiving data from the database i get an error "Arithmatic Overflow of data of datatype DateTime. The same Application it wor...more >>

Stored Procedure Bug?
Posted by Keith at 7/30/2003 12:56:34 PM
The following procedure produces impossabe output according to BOL for the RETURN statement. Proc ================== CREATE PROCEDURE dbo.StoredProcedure1 AS Print 'Here 1' RETURN (Select Count(*) from INFORMATION_SCHEMA.COLUMNS) Print 'Here 2' RETURN (Select Count(*) from INFORMATI...more >>

convert a varchar value to money
Posted by jt at 7/30/2003 12:39:14 PM
is it possible to convert a varchar(10) value to datatype of money (sql server 2000)?? i have a value stored as '0000008752' in my db, but i need to convert it to money so it will appear as 87.52 - any help with this would be much appreciated. another ex. '0000010000' would become 100.00...more >>

Updating fields
Posted by Raul Romero at 7/30/2003 12:04:49 PM
Good morning ... I have this scenario ... TableA (Col1(PK), Col2, Col3, Col4(FK recently added from TableB)) TableB (Col4(PK), Col5) TableA has 10000 rows and TableB 20. Col4 in TableA has Null value on all the records. I need to randomically fill Col4 in TableA with the values of Co...more >>

Error running ftp script from xp_cmdshell
Posted by geekchk NO[at]SPAM geekchk.com at 7/30/2003 12:02:12 PM
Hi All, My programmers have asked for my help in troubleshooting an ftp issue we're having when calling an FTP command from a DTS but I'm stumped. I'm not a programmer myself so hopefully I provide you with enough info. Basically, we have a DTS that runs nightly - goes out to a client FTP si...more >>

alternative way to use trigger
Posted by hngo01 at 7/30/2003 12:00:39 PM
Hi all, what is the alternative way to use trigger (insert, delete, update) that have column data type (text)? I don't want to recreate my table. Thanks a lot...more >>

Select a student with the highest GPA
Posted by Your Friend at 7/30/2003 11:46:38 AM
Hi friends, I have a Students table that contains student information (name, DOB, GPA, etc.). I want to use a single SELECT statement to select the name, DOB, GPA of the student who has the highest GPA. What should the statement look like? Thanks!...more >>

Updateable partitioned view problem
Posted by Rekha at 7/30/2003 11:24:19 AM
Can I use multiple constraints to partition my tables and if so, can I insert into the partitioned view? Here's my script: --Energy July 2003 if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[PMO_Energy_07_2003]') and OBJECTPROPERTY (id, N'IsUserTable') = 1) drop table...more >>

Question on bcp
Posted by Meenal Dhody at 7/30/2003 11:21:40 AM
If I am using bcp to queryout an sp any temp table in the sp would have to be a global temp table or can it be regular temp tables? thanks Meenal ...more >>

Grouping technique
Posted by Jason Evans at 7/30/2003 9:20:30 AM
Hi there. I have a table in the following format TaskID AttributeKey AttributeValue 1 SomeText 23:30 1 MoreText Daily 2 Text Monday 3 Text 03:45 3 TextAgain Saturday Basically I have a table with some schedule details for an a...more >>

Other than cursors
Posted by Jenise at 7/30/2003 8:52:25 AM
Hi, I have db driven form on an asp website with three drop- down boxes that are mapped to one table. I'm having trouble in finding a way to update the boxes other than using cursors. Data can be supplied in either some or all of the boxes. So I am either updating, inserting or deletin...more >>

Database model samples
Posted by Nikola Milic at 7/30/2003 8:43:12 AM
Hi, Is there good site where I can find database model samples? I need model for sending reports with many options, like enable/disable sending, groups, time schedules, history, ... I'm using SS2000 Enterprise edition SP3 on Win2000 Advanced Server SP3 Thanks in advance Nikola Milic ...more >>

Simple insert within SP isn't working
Posted by John Beavers at 7/30/2003 8:38:25 AM
I have a stored procedure that simply insert a row into a table and it doesn't insert properly. Below are the table definitions as well as the sp. The problem is that the AppID read from the tblCounters table is not being read correctly. The update portion of the stored procedure is workin...more >>

Why can't I use the ROLLBACK command?
Posted by Suresh Kumar at 7/30/2003 8:24:53 AM
Hi folks, When we do an UPDATE on one of our tables (say TableA) through Query Analyzer(QA) it will not give us a chance to roll back the transaction (even though our IMPLICIT_TRANSACTIONS is set to ON). We get a message "The ROLLBACK TRANSACTION request has no corresponding BEGIN TRANSACTION...more >>

Restore Database
Posted by Michael at 7/30/2003 8:19:40 AM
Is there an option I can add to the RESTORE command in sql server that if it finds bad media, or something doesn't work right, it will keep the database like it was. My company has remote locations only connected to us by modems, and when they get kicked off, the database they were uploading t...more >>

REAL!! BUT SIMPLE SQL COMMAND
Posted by Sender at 7/30/2003 8:17:06 AM
I have two tables: TableA, TableB. The structure of TableA is exactly same as of TableB. TableB is empty. TableA has 1234 records. The structure of these tables are as under: Field1 int Field2 int Field3 int Field4 chat(3) ............. ............. ............. Field89 TIMESTAMP I...more >>

Data From INSERT In Stored Procedure Does Not Appear In Table
Posted by Leonard at 7/30/2003 7:54:30 AM
I have a table (say, Table1) defined as: Column Type ------ --------------- ID indentity int(Primary key) nameData varchar(32) In a stored procedure I want to query for a record with a particular value for nameData. If it is there, I want to retrieve its ID. If not, ...more >>

long running distributed query
Posted by Rob at 7/30/2003 7:46:57 AM
Hello: When I run the following distributed query, it takes several minutes to complete as opposed to running the same query on the remote server, where this query runs in a second. -- query start select Account_ID, sum(case portfolio_num when 1 then Income_Commission_Amt else 0 end...more >>

Writing direct to filestore from a stored procedure
Posted by Terry Bailey at 7/30/2003 6:49:30 AM
This is what I would like to achieve, I need to extract from a db a set of information which has been written to various tables during the course of a day. This information needs to be encoded in the form of XML and then written to as an ordinary file on the server. This needs to be writt...more >>

Job Scheduler
Posted by Satish at 7/30/2003 5:23:23 AM
Hello All, I want to setup a scheduler for a job. But the scheduler should not start the job if it is already running. Can we do something to accomplish this? Or is it automatically taken care by SQL Server. Thanks in advance Satish...more >>

Executing packages under a new user
Posted by limivorous NO[at]SPAM hotmail.com at 7/30/2003 4:34:03 AM
Hi, I have built a collection of procedures which act on a number of tables. These work successfully using the "sa" user and now i want to use a new user to execute the packages and modify the data (DML). For my new database i have enabled the db_datareader and db_datawriter options but i canno...more >>

distributed partitioned view??
Posted by chet gwin at 7/30/2003 3:05:58 AM
it seems that i have something missing when updating a distributed partitioned view...using sqlserver 2000 ent edition, win 2000 server.... i get ==> union all view 'customers' in not updateable because the defintion contains a disallowed construct (42000,4416) has anyone had this problem?...more >>

When I compare two string in Unicode format
Posted by Laurent Liegeois at 7/30/2003 2:54:54 AM
Hi, I have a funny Error in our sql server 7 & 2000. When I compare two string in Unicode format. I receive that it is the same when I add new nchar. I don’t understand why? Could you help me ? declare @str nvarchar(128), @str2 nvarchar(128) Set @str = nchar(21121)+ncha...more >>

When I compare two string in Unicode format.
Posted by Laurent Liegeois at 7/30/2003 2:44:49 AM
Hi, I have a funny Error in our sql server 7 & 2000. When I compare two string in Unicode format. I receive that it is the same when I add new nchar. I don’t understand why? Could you help me ? declare @str nvarchar(128), @str2 nvarchar(128) Set @str = nchar(21121)+nc...more >>

Identify Citrix User
Posted by simond NO[at]SPAM mailbox.co.za at 7/30/2003 2:29:27 AM
Hello all I need to find out which user is current using the sql database. I can't use multiple login names, as this is out of my control. So far I have been querying the sysprocess table using @@SPID and working back from the host name. eg. select distinct(hostname) from master.dbo.sysproc...more >>

Date & Time on SQL
Posted by jehan at 7/30/2003 1:58:22 AM
I want to date the creation as well as the last modified entry in a sql table. How do I do that? Where may I find information about working with Date and Time in SQL? I know the "Now" in Access but I don't know the equivalent in SQL and how to use it. Thanks...more >>

Using xp_sendmail
Posted by ile.ilenia NO[at]SPAM libero.it at 7/30/2003 1:40:41 AM
Hello! I have a problem about xp_sendmail. I must send an email using an Intranet address. If I use this syntax: exec xp_sendmail @recipients = 'ilenia', @message = 'hello', @subject = 'Test' where 'ilenia' is the name of account Intranet mail, or even if I try to use my Internet personal...more >>

UDF Variable parameter lists?
Posted by jejnicholas NO[at]SPAM hotmail.com at 7/30/2003 1:27:31 AM
Dear all, I am wanted to write a UDF where the number of parameters is not known until runtime. Any ideas on how to do this? I have looked on BOL and the web and can't find any answers. Many of the UDF's that come with SQL Server display similar functionality. Such as CHECKSUM() which can als...more >>

Problems with system functions
Posted by Andy at 7/30/2003 1:05:58 AM
I have an audit table which includes some columns with defaults based on system functions - but these do not always work.. table definition.. CREATE TABLE dbo.Audithistory ( event_time datetime NOT NULL DEFAULT getdate(), event_type int NOT NULL, dbname varchar(10) NOT NULL...more >>


DevelopmentNow Blog