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
August 2008
all groups > sql server programming > august 2003 > threads for monday august 25

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

transpose row result data into columns
Posted by BS at 8/25/2003 10:43:03 PM
Hi all, bit new to this level of queries. I've data in a tables like below. The field names are in another table, and there is another table mapping fields to values so fields are not fixed in name/number. tbl_Fields FieldID Name 1 Title 2 FName 3 ...more >>


SQL Server 2000 Enryption and Decryption Capability
Posted by konay at 8/25/2003 9:51:56 PM
Does SQL Server support Encryption and Decryption of column? ...more >>

can use store procedure in trigger?
Posted by francis at 8/25/2003 9:26:32 PM
I have a trigger as follows CREATE TRIGGER trgMsgDD ON dbo.DemandDraft FOR INSERT AS declare @DDrCorpID varchar(10) declare @DDrRefNo varchar(8) declare @DDrRecNo varchar(8) declare @DDrCorpName varchar(40) declare @DDrBranchCode varchar(5) declare @DDrHostStatus varchar(1) SEL...more >>

DB Syncronization
Posted by Andrea Moro at 8/25/2003 9:22:32 PM
I need to implement a procedure to Sync some database's tables from one pc to another or viceversa ... simple selecting source and destination. I don't know from what to start for my search. I don't know if SQL server has some built in utiliti, dts package. Can anyone provide some usefull l...more >>

sum
Posted by u128845214 NO[at]SPAM spawnkill.ip-mobilphone.net at 8/25/2003 7:30:31 PM
Trying to obtain total number of books per class along with other fields. classA 1 fname1 8 ... classA 2 fname2 3 ... classA 3 fname3 4 ... How to modify the query in below to return all fields and sum number of books also?. select * #tempbook group by class,order,name,Books,.....more >>

Moving package and chaning sub package calls!
Posted by Steve at 8/25/2003 7:08:07 PM
Hi All, I have a process that runs weekly. It has some 140-150 ish DTS packages. These are essentially run from one packages that calls a series of sub packages and the like. Not all the packages are always fired, dependant on certain criteria. Basically the issue I have is that I want to...more >>

Using DateDiff to get time duration
Posted by Scott at 8/25/2003 6:53:47 PM
To get the time duration of downtime, I have 2 fields called STARTDATETIME and ENDDATETIME. Both are datetime type. I've been using FIGURE 1 statement to get the value in decimal of a hour, but I get incorrect totals when summing the downtime values because as you can see in FIGURE 2, some downt...more >>

Should This Produce Syntax Error?
Posted by Jonathan Chong at 8/25/2003 6:23:37 PM
Declare @TempParam int Select @TempParam EventID from masterEvent where Eventid=1 I was accidentally omitted "=" for statement above and the result as below. Eventid ----------- NULL Shouldn't it say "syntax error" or sort of? ...more >>



Security-problem Application role
Posted by Harry Leboeuf at 8/25/2003 6:12:56 PM
I'm having a problem with a given table. In the enterprise manager all allowed security settings are checked (SELECT, UPDATE, ...) for a given approle, but when setting the approle in the sql-analyzer and then selecting on the table i'm getting a permission denied. Anybody has seen a similar ...more >>

Best method to Version a database
Posted by ES at 8/25/2003 5:19:54 PM
What would be the best way to version a database if several different versions are running in production? The problem is the database name never changes so it is hard to keep track of which version of database a particular application version is running. Thanks, Enoch ...more >>

When do I need a clustered index
Posted by Bob at 8/25/2003 4:33:38 PM
I have a developer asking to add a clustered index to a table with only 895 rows. How can I tell how many pages my table is using? How can I determine if a clustered index would increase performance? Is there a minimum and maximum rows/pages threshold used for a clustered index? Here is the ...more >>

Partition Views Vs Dynamic Queries
Posted by LIN at 8/25/2003 4:23:24 PM
Hi, I have an Parition View like this Create view PartitionView as Select * from Table1 Union All Select * from Table2 .... Select * from TableN and I am using this view for the querying purpose. In my earlier post Mr. Andrew John (Member of this group) has replied that atmos...more >>

performance on remote client v.s. local client
Posted by Jeff Kish at 8/25/2003 3:11:26 PM
Greetings. Can someone make a suggestion here on either what the problem could be or where I should look/investigate? I have a client server app that uses an ms sql database (2000). The app does a lot of reads from a local file (the file is local in both cases) and the database, and analysis...more >>

Selecting 1 random row from each of n random groups
Posted by noroominhead NO[at]SPAM hotmail.com at 8/25/2003 3:11:10 PM
I am constructing an exam. There are pools of questions, some number of questions per pool. I draw first question, at random, from pool #1, second question at random from pool #2, etc. Based on other posts, I've created the following query: SELECT TOP 100 PERCENT NUMORDER,QUESID,QUESTION FR...more >>

Need help with a Tricky Update statement
Posted by Tomer at 8/25/2003 3:06:49 PM
Hi All, I’m trying to do an Update statement, but I figured that it is little bit tricky so, I need your help. I have two tables: XsourceTable and XTargetTable (The creation script is attached.) I need to update periodically the XTargetTable with new values I found in XsourceTable. Plea...more >>

finding sequential number of specific record in ordered recordset
Posted by Mia Johnson at 8/25/2003 2:13:42 PM
Hello, I am wondering if anyone knows of a slick way to find the sequential number of a specific record. I have a table of properties and then a table of buildings and sections that are included in that property. I know the autonumber of the section that has been chosen but what I need is t...more >>

Peforming a Exec on every Inserted Row
Posted by Harry Leboeuf at 8/25/2003 1:52:37 PM
Hey, Is this the right way to start a procedure for every insert on a table (even multi-row insert), OR is there an easier way ??? DECLARE @New_Comp_Id VARCHAR(5), @New_Hall_Id INT, @New_Capacity INT, @New_Twin INT, @New_WheelCha...more >>

isolation-level
Posted by Frank Dulk at 8/25/2003 1:17:17 PM
Does some set form exist SQL Server isolation-level for a standard value, out of the transact sql? I have more experience with MySQL, the one where I configure the isolation-level in the file of initialization of the server. would like to do the same with SQL Server Thank you very much. ...more >>

Accessing Campos ntext, text and image
Posted by Frank Dulk at 8/25/2003 1:15:53 PM
I am working in a project that uses MSSQL as server of content of a website of an extranet. My doubt is on the form of recovering the content of a field ntext (16) in a page ASP VBScript. Nowadays, all the fields of the registration appear less the ntext (that was imported of a field memo o...more >>

execute a string as a logical expression
Posted by John Winterbottom at 8/25/2003 1:10:19 PM
Using SQL Server 2000. I have a table of logical tests in the form of strings ---------------------------------------------------------- create table tests ( test nvarchar(255) not null primary key ) go insert into tests (test) values ('(0.5 <= 1.0)') insert into tests...more >>

DELETED Table
Posted by Eric at 8/25/2003 12:34:15 PM
Hi, I don't quite understand how the DELETED table works in conjunction with referential integrity. Let's say I have two related tables. I delete a record in the the primary table, hence deleting the related records in my sub table. How does the DELETED process function? Does it creat...more >>

How to get a 0 for value field when no records exist for that datetime..
Posted by Ricky at 8/25/2003 12:34:01 PM
Hi all In my tableA I have tagkey,datetime and value fields. Tagkey is not the PK. Records look like 12,'2003-07-01 00:00:00',23.4 12,'2003-07-02 00:00:00',24.5 12,'2003-07-03 00:00:00',25.43 12,'2003-07-07 00:00:00', 26.12 12,'2003,07-09 00:00:00',26.39 .... .... I need a select qu...more >>

Automating SQL Script Generation
Posted by Eli at 8/25/2003 12:20:55 PM
Hello, I was wondering if anyone know where I can find a proc or something that will automate my sql script generation? Instead of manually right clicking on your database and selecting generate sql script, I want to be able to schedule a job or something that runs a proc to script all t...more >>

Howto get a row by its number (as reported in a DTS imp/exp error)
Posted by Sebastian Aleksi at 8/25/2003 12:14:47 PM
Hi, I'm running the import/export wizard (sql 2000 sp3), to copy a table from one database to another, but the task ends up with an error: error in row 25332. Now I would reallt like to know how can I use a select statement (or similar) to get the contents of such row, by specifiying the row numb...more >>

White Space Problem
Posted by Carlo Razzeto at 8/25/2003 12:05:03 PM
First of all, sorry about cross posting but I wasn't sure which group this question was more appropriate for... I am having a problem with Microsoft SQL Server or SqlDataReader (most likely the former) apparently appending white space to the end of database results... The code I have looks lik...more >>

transaction logs-too large?
Posted by Lee at 8/25/2003 11:57:12 AM
Hi, My transaction logs are unbelievably getting large, even larger than the databases. Is there any kind of routine SQL can do to trim it down? Thanks Lee ...more >>

Can not shrink a Database!
Posted by george d lake at 8/25/2003 11:51:52 AM
Hi, I am running SQL 2K I have a DB that is 6GB. out of that, 5.5GB is the Trans Log. I did a backup of the Data and the log. Now it shows 5.3GB unused, but I cant get that free space to go away! When I creaded the DB it was 10MB? so I know that is not the problem ...more >>

How do I do it?
Posted by Raanan Avidor at 8/25/2003 11:21:17 AM
Hi. I need to run a stored procedure "x_sap_get_worker_heirarchy_by_email" on a daily basis. This stored procedure gets 1 parameter - email address I need to send the stored procedure a set of e-mails selected from a table (select email from workers where e_level = 10) and run the stored proc...more >>

datetime
Posted by KP at 8/25/2003 11:02:37 AM
I am trying to insert a row into a table where one column is of type datetime(8). How do I insert the date value into that column? I tried to enter it as string in single quotes, cast, convert nothing worked for me. Please help me in this regard. thanks KP...more >>

INSERT INTO on a function
Posted by Andrew Retzlaff at 8/25/2003 10:42:22 AM
Hi, 1) Anyone know how to use a INSERT INTO in a function? 2) or the second option is fix the next problem: a function call the procedure but I get the next ERROR: Only functions and extended stored procedures can be executed from within a function What is wrong in have this on the fun...more >>

Problem with BULK INSERT on an empty file
Posted by David N at 8/25/2003 10:37:48 AM
Hi All, I have a T-SQL program that uses bulk insert to insert data from a text file into a temporary table. The program works fine unless the bulk insert text file is empty. When the text file is empty, the process bombs out with the following error message: >>erver: Msg 4866, Level 17...more >>

Comparing column by column
Posted by Louis at 8/25/2003 10:26:41 AM
This is I am trying to do: I need to detect changes in column value in table1 relative to table2. table1 and table2 are same table with different names. table1 has current data table2 has historical data. If there is at least one column value change in table1 I need to update the match row ...more >>

How to list all tables of a SQL database
Posted by rahul at 8/25/2003 10:19:18 AM
Hi: I found out the query for listing all fields from SQL database which is : select * from sysobjects. But I am looking for listing of all the tables from sysobjects.Any ideas as to how to do it? Thx Rahul...more >>

retrievral problem from SQL Server
Posted by david wilton at 8/25/2003 9:33:35 AM
Hi all, I confront a text size problem when I link table from SQL Server 2000 in Access 97. The lengthy "ntext" column type turns out to be a "text" type rather than a "memo" type in Access 97. Therefore, I couldn't retrieve certain records with lengthy content in excess of maximum length ...more >>

select query with computed column
Posted by mahesh at 8/25/2003 9:16:52 AM
Hi, pls help with following query. create table (id varchar(10) ---id+id2+ id3 is the primary key id2 varchar(10), id3 varchar(10)) Data is a s follows: id1 A34 8000 id1 A12 8001 id1 a45 8002 id2 A33 8003 id2 A14 8004 id2 a42 8005 output should look like this de...more >>

Stored Procedure Syntax
Posted by Meerkat at 8/25/2003 9:16:20 AM
I have been struggling over this for a long time but now I need help. The syntax of the last line of the following stored procedure is wrong. I would be extremely grateful to anyone who can help me with this. Many thanks, Meerkat. USE Northwind IF OBJECT_ID('dbo.SP_WWV_TEST') IS NOT NULL...more >>

Modelling a SuperClass/SubClass relationship properly in SQL.
Posted by Chris Dimms at 8/25/2003 9:07:22 AM
Hello, This is my first post here so I apologize in advance if I've posted this question in the wrong forum. I'm looking for some advice on the optimum way to model my database schema to represent a superclass/subclass type relationship. In specific, I want to create a table Users tha...more >>

IDENTITY not working
Posted by kamlesh2000 NO[at]SPAM yahoo.com at 8/25/2003 8:39:20 AM
Hi, My stored procedure calls another stored procedure in a CURSOR and inserts data into a Temporary table. When I do this, I try to update a new column by making the use of IDENTITY column, but its not working properly. I am giving the snippet of my code below. Can someone tell me why ...more >>

newbie question
Posted by tafs7 NO[at]SPAM yahoo.com at 8/25/2003 8:24:33 AM
I am very new to SQL Server, and was currently assigned a project to switch a MySQL db to MSSQL. So I thought...I can just go to phpMyAdmin, get the dump that creates all the tables and inserts the data. Create a database in SQL Server, then use the Query Analyzer to run the SQL statement from...more >>

Is this Code Reliable enough ? pls give comments..thanks
Posted by Krist Lioe at 8/25/2003 7:51:19 AM
Hi SQL Guru, I maintain stock availibility in a Table, by doing a checking in a Trigger. an Order Item should Not be inserted if stock is not enough. (DDL & Trigger attached below) In my Trigger code below , the questions are : 1) Can I always rely on @@ROWCOUNT to determine whether all O...more >>

Data file question in BULK INSERT
Posted by Zero at 8/25/2003 2:04:02 AM
Hi, MUST the data flat file parameter in BULK INSERT sql statement be located in SQL server computer? If the data flat file is saved in one of workstations, how to construct the BULK INSERT sql statement? Thanks....more >>

To find a last date of given month
Posted by Umer at 8/25/2003 12:27:10 AM
Hi, How can I get the last date of a month, by a Select statement. i.e if I have system date '12/01/2003' (dd/mm/yy). Then the result should be like last_date ---------------------- 31/01/2003 Best Rgards Umer Minhas...more >>


DevelopmentNow Blog