|
database
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
SQL Server database programmingmicrosoft.public.sqlserver.programming
Large Database Development Considerations
Anubis -
11 Jun 2005 11:58 PM - 2 messages
Hello All, I'm currently in the process of developing a large database platform (both software and hardware wise). I have several distinct departments each that have their own set of data, however each department must be able to ...
Dynamic SQL
Mike Labosh -
11 Jun 2005 7:27 PM - 2 messages
I have this code here that has its WHERE clause dynamically built... -- Calling Code DECLARE @matches INT SET @matches = 0 DECLARE @whereClause NVARCHAR(4000) IF @clmrKey IS NULL SET @whereClause = ' WHERE ...' ELSE SET @whereClause = ' WHERE ...' ...
Error 2812
Robert -
11 Jun 2005 7:23 PM - 3 messages
I am the owner of a database. I am listed as an owner as is dbo. All of the stored procs were owned by dbo. There is a user on the database named EDUser. EDUser was granted execution rights and everything was good. That ...
About automatic process at midnight
Kenny M. -
11 Jun 2005 5:41 PM - 8 messages
Hi I have a table1 which hold a field (amount) with 1000 rows The amount in the 1000 rows is consumed by clients during the day The next day the amounts have to return to their original values (at this ...
kill logged in processes to a database
Joseph -
11 Jun 2005 4:35 PM - 5 messages
How do kill all the processes in a database? Here is my situation; I copy a database called “Active†into a database called “Training†once a week. If there are still students logged into the Training database the job fails and ...
all from one table to another
Alur -
11 Jun 2005 3:14 PM - 5 messages
I know one way (but it is complicated (using fetch)) copiing all data from one table to another table with the same fields, but with different table name. Could you tell me the easiest way to do that ? ...
Disabling constraints
Frédéric Mayot -
11 Jun 2005 3:04 PM - 5 messages
Hi, I need to disable all the foreign key and primary key constraints in a table and reenable them at the end of my commands. I can use ALTER TABLE to do this but I was wondering if it is a good practise. It is not maintenance ...
LEFT out join question
Steve Wonderful -
11 Jun 2005 1:34 PM - 2 messages
How to interprete the result set from this query (the filter: AND E.deptno IS NULL in the ON confuses me): Result: Deptno deptname empid empname deptno jobid ...
Attaching without ldf file
Alur -
11 Jun 2005 1:11 PM - 20 messages
I tried to attach mdf file without ldf file. However: "Error 1813: Could not open new database 'GJIRB'. CREATE DATABASE is aborted. Device activation error. The physical file name 'C:\ ...\db_name.LDF' may be incorrect." Then: "Attaching database has failed." ...
Query Problem
Werner -
11 Jun 2005 1:09 PM - 2 messages
Hi, I have a table like this: StringID,LanguageID and StringValue. The table contains strings in different languages. Strings with the equal meaning have the same StringID but a different LanguageID. Here is a example: LanguageID 1 - english 2 - german ...
dropping a table on a linked server
arch -
11 Jun 2005 11:52 AM - 12 messages
What is the SQL for dropping a table on a linked server? Using: DROP TABLE LINKEDSERVERNAME..USER..TABLENAME doesn't work. ...
Query batch completed with errors...
Sam -
11 Jun 2005 11:15 AM - 4 messages
Hi, I am executin a stored procedure which contains a sequence of Stored procedures. One of these stored procedures is a cursor-stored procedure (basically a cursor). At the end of the execution of this Stp(cursor), it gives me "query batch ...
Using uniqueidentifier as URL parameter
Arjen -
11 Jun 2005 10:10 AM - 3 messages
Hi, Do you see the following sample as "smart". ---------------------------------------------------------- ID is the key. I use this key also as foreignkey in other tables. I want to use Code as an id for the URL. What do you think about this? ...
Cannot truncate logfile in SQL server 2000
Nilkanth Desai -
11 Jun 2005 8:35 AM - 2 messages
Nilkanth Desai nsde***@tis-world.com I am using SQL Server 2000. In this case database size is 750 MB and since last 10 days its logfile is constantly increasing its size. Since last 2 days it has crossed 14GB. Thses logfiles are having extension of .ldf. I have ...
Using insert/update/delete statement in UDF
Tod -
11 Jun 2005 7:24 AM - 2 messages
Hi, When I use insert/update/delete statements in UDF I get error: CREATE FUNCTION FOO(@DUMMY VARCHAR(128)) RETURNS BIGINT AS BEGIN INSERT INTO MY_TABLE (MY_FIELD) VALUES ('xxx') ... ... ... ...
returning date without time part
Kenny M. -
11 Jun 2005 1:27 AM - 2 messages
Hi I have a simple select like this Select MyDate, MyID From Sales The select is returning the date like this: 01/06/2005 12:00:00 a.m. 02/06/2005 12:00:00 a.m. I'm showing it on a Datagrid in my app, my question is can I modify the ...
Returning Date without
Kenny M. -
11 Jun 2005 1:26 AM - 2 messages
Hi I have a simple select like this Select MyDate, MyID From Sales The select is returning the date like this: 01/06/2005 12:00:00 a.m. 02/06/2005 12:00:00 a.m. I'm showing it on a Datagrid in my app, my question is can I modify the ...
How to identify unused databases
Kumar -
10 Jun 2005 11:47 PM - 2 messages
Hi Folks, client company has around 25 sql servers . Each server has got 5 to 10 databases. Some of the databases are old. We don't know whether any applications using old databases or not. Is there any way we can find the unused databases in past 3 months or past 1 ...
tempdb not shrinking
AM -
10 Jun 2005 11:43 PM - 3 messages
Hi all My tempdb data file increased upto 45Gb and it is 99% free. I try to shrink it but it was not shrinking. But after some time suddenly it shrinks. Why this happens? Why it was not shrinking before? ...
Can't get fn_get_sql to work
pshroads -
10 Jun 2005 11:02 PM - 4 messages
I can't seem to get the fn_get_sql function to work. Here's the script I'm using: declare @spid int DECLARE @Handle binary(20) declare active_spids cursor for select spid, sql_handle from master..sysprocesses where status not in ('background', 'sleeping') ...
Passing a table to a SP
Chris Lieb -
10 Jun 2005 9:11 PM - 3 messages
I am making an SP that uses a table as an array. I want the user to pass the table to the SP, where I will then iterate through it and pull out all of the IDs and place them into a string that I can use with the IN keyword. Once I ...
Sysindexes
Alterego -
10 Jun 2005 8:31 PM - 4 messages
Hi all, I am trying to determine some index characteristics from the system tables. 1. I assume when a sysindexes.indid = 1 that index is the clustered index, true? 2. How do I dermine which index is the primary key? ...
Fast "bulk" inserts...
lmcphee -
10 Jun 2005 8:11 PM - 2 messages
I have an app that must insert batches of transaction records every 30 min. Typically only a few hundred each time. We found that just appending a hundred or so INSERT commands together in a single query sent to the server ...
Different port
Marcin S. -
10 Jun 2005 8:01 PM - 2 messages
Hi, I have a MSSQL server on port 1434, the default is 1433 anyone who know how the should connectionstring looklike to connect to the post 1434? ...
Duplicate order nums in Orders
Saga -
10 Jun 2005 7:58 PM - 3 messages
Hi all, We have a third party application that allows users to take customer orders. This application has all the bells and whistles of the Titanic. Since we wanted our customers to be able to place orders themselves, we built a smaller ...
BizRule implementation
J-T -
10 Jun 2005 7:49 PM - 5 messages
I have a table with follwoing feilds: 1)ClientID 2)EmailAddress 3)AddressDescription 4)Primary 5)BizRuleFlag there could be multiple address for each client ,but each client **MUST** have atleast one address with "Primary" flag set to "Y" (which mean that one ...
READPAST - please help me
hngo01 -
10 Jun 2005 7:09 PM - 3 messages
Hi, There are some rows been locked by other users…. In one window (Query Analyzer) I run: BEGIN TRAN SELECT * FROM NorthWind..employees WITH (XLOCK) WHERE employeeid = 1 WAITFOR DELAY '00:01:00' COMMIT TRAN In other window (Query Analyzer) I run: ...
Changing table colon's properties
huseyin_akturk -
10 Jun 2005 7:06 PM - 4 messages
Hi, I have got approximately 100 tables. Their all attributes are same. But, I want to change their one attribute. Such as my table; NAME nvarchar(50) SNAME nvarchar(50) SALARY float I want to change SALARY's property from float to money. It is possible to th ...
I don't understand it
Enric -
10 Jun 2005 6:21 PM - 2 messages
Dear all, I'm executing a DTS which own a sql server task that launch a stored procedure. This stored procedure run a WHILE sentence and then launch a bcp command dinamically. Well, everything works debugging that stored procedure or simply launch it ...
transferring data to an Oracle linked server
arch -
10 Jun 2005 5:11 PM - 4 messages
I wanted to use a "SELECT INTO" sql statement to transfer a table from sql server to a oracle after creating a linked server to the oracle database (I didn't want to use DTS). A website told me that it can be done using the ...
updating a column based on values in another column in the same ta
sharman -
10 Jun 2005 5:08 PM - 5 messages
I am new to SQL. I want to update a field based on values in another field for the same row in the same table. For example, if I have a table like this: FieldA FieldB FieldC FieldD ...
Retrieve Stored Procedure Code
Chris F -
10 Jun 2005 4:43 PM - 4 messages
Hi, I am trying to retrieve the code for some stored procedures. I was able to select the routine definition from the information_schema.routines for the procedures that had less than 4000 characters, but I can't get the larger ...
table information query
Random -
10 Jun 2005 4:21 PM - 3 messages
What's a way I can determine the last time any record in a table was updated? Is there a table property I can get this from or do I need to establish a field in the table that I can query from? ...
MSDE and clustered indexes.
Bob Castleman -
10 Jun 2005 3:58 PM - 3 messages
We have this weird problem with our customers using MSDE. They keep running up against the 2 gig size limit and their database stops functioning because it can't allocate any more space. But if you examine the database, 75% of ...
Enterprise Manager and its particularities
Enric -
10 Jun 2005 3:55 PM - 9 messages
Dear all, I'm fed up with this problem. I hate that behaviour. When I create objects from a query analyser session in my own workstation, then these objects doesn't visible from my MMC. A lot of times I am obligated ...
List Available Sql Servers
chinn -
10 Jun 2005 3:46 PM - 3 messages
Hello, I am trying to find the list of all available sqlservers...with something like this and making it a .vbs and running it from the command promt on my windows 2000 and write to text file. can anybody help me with that. ...
osql with proxy account errors
jmeyers -
10 Jun 2005 3:31 PM - 3 messages
I've got a proxy account set up that is working fine for DTS packages, etc. I've also got an environmental variable set up for osql setting the user to the proxy account. The problem I'm having is within a scheduled job, when I ...
Killing xp_cmdshell
NeilDJones -
10 Jun 2005 3:28 PM - 2 messages
Hi. I have run xp_cmdshell from within a stored procedure, and it has hung. Is there any way to kill the process, other than rebooting SQL Server? Cheers Neil ...
Help with 1toMany update/case stmt?
xnews user -
10 Jun 2005 3:13 PM - 2 messages
Hi all, Looking for a way to do this in the minimum # of stmts I can. Basically, this is doing a table1(1) to table2(many) update join. When the t2 row has myindex = 0, then update column t1.c1. ...
Test the impact of an index
JohnnyMagz -
10 Jun 2005 3:06 PM - 4 messages
I would like to add an index to a table that my application writes to/reads from and change an existing stored proc. Before I do, I would like to take some measurements on the existing table structure and proc. Specifically, I'd ...
Dynamically creating variable names
Andy -
10 Jun 2005 2:51 PM - 2 messages
Ok, here it goes. I'll try and explain my situation as best as I can. I would like to dynamically create variable names. We store our data in monthly partitioned tables.........table_200501, table_200502.... I am creating a view that is a union of all of the partitioned tables. So ...
Uniqueidentifier or int32
Arjen -
10 Jun 2005 2:13 PM - 4 messages
Hello, I always use int32 as keytype. Now I see (asp.net 2.0) that there also is an uniqueidentifier type. Can somebody tell me a little bit more about this? For example: I have a website with news. When you select the title you can ...
Rand function
Hardy Wang -
10 Jun 2005 1:58 PM - 5 messages
Hi, I run query in Sql server 2000 below: select rand(datepart(ms, getdate())), datepart(ms, getdate()) Everytime I run it, I only get 0.7xxxxxxxx as random result. Is it thw way how it is desgined? If yes I will think the number is NOT so random. ...
Q: NB on the Insertion command.
Visual Systems AB (Martin Arvidsson) -
10 Jun 2005 1:29 PM - 4 messages
Hi! I'm not a good friend with the insert command. What I am trying is the folowing... The insert statement: INSERT INTO MyTable(field1, field2, field3) VALUES(?, ?, ?, ?) Data to be inserted. '1', 'Customer data', 'Hi, this is a sample text to be inserted' ...
Duplicating rows in tables...
Brad Pears -
10 Jun 2005 1:18 PM - 3 messages
I am working on an application where I want the user to be able to "Duplicate" a Contract item. To do this I have to duplicate the row in the master table and duplicate all related rows in the related "children" tables (of which there are twelve..) ...
Warning: The query processor could not produce a query plan from the optimizer because the total len
Tom -
10 Jun 2005 12:52 PM - 3 messages
Here is my problem: I am trying to generate stored procedures that will handle filtering and ordering on all columns. I almost had it working but I ran into problems with the case statements; I would get conversion errors. ...
simple query
lara -
10 Jun 2005 12:21 PM - 3 messages
hi, this is a simple Qn My Employee_Salary table contains EmpID, DeptID, and Sal I want to find the top 2 Employees from each dept, who are taking the highest sals in each dept regards Lara ...
2ND POST: Is there a way to insert a record using another as a template?
SA Development -
10 Jun 2005 11:53 AM - 8 messages
Hi, I am currently inserting a record using: insert into TABLE(FIELD1,FIELD2) values ('%s',%d) But, the problem I have is that the table I am connecting to can either have 46 fields or 47 fields depending on its version. Is there a command that ...
How to Transfer data from Excel to SQL SERVER 2000
Ahmad Jalil Qarshi -
10 Jun 2005 11:28 AM - 6 messages
hi! i want to transfer data from MS Excel Sheets to SQL Server. is there any way. Thanks Ahmad Jalil Qarshi ...
SQL Server Mail box - xp_readmail
Sevugan -
10 Jun 2005 11:20 AM - 5 messages
Hi, I executed xp_readmail stored procedure. It brought some records as result. I do not know from where it brought those records. Those were not available in my inbox. It is supposed to retrieve the first unread message in my inbox. ...
sp_OAMethod methods
NeilDJones -
10 Jun 2005 11:06 AM - 6 messages
Hi. I am looking for a list of all methods available to sp_OAMethod. Is there such a thing? Cheers, Neil ...
Join and duplicate values
Fabri -
10 Jun 2005 10:22 AM - 5 messages
Executing a LEFT JOIN and preserving values from select "on the left" I have this problem: If I have left table with for example column A = 'PIPPO' and in right table PIPPO is not present, of course I have NULL value because of the ...
VAT decimal places
Ian Oldbury -
10 Jun 2005 10:19 AM - 7 messages
Hi All, What is the correct storage type for VAT 2 or 4 decimal places?? ...
Importing text file
Reggie -
10 Jun 2005 10:06 AM - 5 messages
HI and TIA. I posted this to a vs.net NG but after looking thought it might fit in here better. Using VS.Net 2003 I built an ASP.Net Web application using VB.Net. I connect to an SQL db(SQL Server 2000) and am setup to ...
Reset Identity
Alessandro -
10 Jun 2005 9:55 AM - 4 messages
Hi, there is a way to reset identity field of many tables via storeprocedure ? i try with the scripts below, but they don't work ! BACKUP LOG test_dbWITH TRUNCATE_ONLY DBCC shrinkdatabase (test_db) and also with create table #table( idTabella int, ...
Problem with varchar(max) in SQL Server 2005
Dinesh Priyankara -
10 Jun 2005 9:44 AM - 3 messages
Hi All, I am having a small problem with varchar(max) type variable. Please look at the code below. DECLARE @varcharmax varchar(max), @varchar varchar(8000) SET @varcharmax = REPLICATE(‘D’, 10000) – this will end up with 10000 ...
Finacial function
Eric -
10 Jun 2005 9:38 AM - 8 messages
I'm looking for financial function in T/SQL. I need to implement the Rate-Function like in VBA. Thanks Eric ...
Changing table properties
huseyin_akturk -
10 Jun 2005 9:19 AM - 2 messages
Hi, I have got approximately 100 tables. Their all attributes are same.
But, I want to change their one attribute. Such as my table; NAME nvarchar(50) SNAME nvarchar(50) SALARY float I want to change SALARY's property from float to money. It is possible
to this operation manually. But I need to this operation automaticallay
via programming language or via query analizer. ...
Moving data and log files
len -
10 Jun 2005 9:18 AM - 4 messages
Hi there. Is there an easy/correct way to move a database's data and log files(.mdf, ..ldf) to a new location? I know there must be a simple way (system stored procs or something) - I've just been stumbling around manually copying, ...
T-SQL and primary key
Marius -
10 Jun 2005 9:07 AM - 2 messages
Hi, I need to create a primary key on my already existing tables. But there are some (just a few) rows in my desired primary key columnt that contain duplicate values. Do someone know how to find duplicate values and what values, so that I can ...
Error 8152
Samuel Bernard -
10 Jun 2005 8:58 AM - 4 messages
Hi, I have the following problem. I create a small request to truncate a column (see below). When I run it, I get an error 8152. I don't understand why. I have no null value into the table. I would appreciate any help ...
Inner Joins
Richard Garner -
10 Jun 2005 8:55 AM - 2 messages
I have a table that gives a hierarchical representation of a master table. It has two integer keys ID1 and ID2 providing the hierarchy, where ID2 is the child of ID1. What I am trying to do is to create a query that will get all ...
Changing table properties
huseyin_akturk -
10 Jun 2005 8:44 AM - 3 messages
Hi, I have got approximately 100 tables. Their all attributes are same.
But, I want to change their one attribute. Such as my table; NAME nvarchar(50) SNAME nvarchar(50) SALARY float I want to change SALARY's property from float to money. It is possible
to this operation manually. But I need to this operation automaticallay
via programming language or via query analizer. ...
RDO resultset performance problem
Marko Erzen -
10 Jun 2005 8:19 AM - 4 messages
Hi to all, I have a big performance problem with looping threw rdoresultset. I made some very complex sql queries. They link like 5 tables and uses a couple subqueries. The number of returned rows is something like 1000. Query ...
Adjusting Employee Hours
ninel -
10 Jun 2005 6:00 AM - 2 messages
I wrote a post earlier, but my manager has asked that I do it
differently. I have a table with employee hours for particular
projects. (I work for a telemarketing company)
Table1:
Project Task Emp Hours
A1 TPV 1 5
A1 TPV 2 2
A3 AUDIT 3 4
TOTAL: 11
A2 ITM 4 10
A2 ITM 5 15
TOTAL: 25
I need to figure out the adjusted hours for these employees. The end
result should look like this:
Project Task Emp Hours AdjHours
A1 TPV 1 5 0
A1 TPV 2 2 0
A3 AUDIT 3 4 0
A2 ITM 4 10 14.4
A2 ITM 5 15 21.6
I need to add the hours for the TPV and Audit records and adjust
against the ITM records by doing the following calculation:
Emp1, 2, 3 hours (tpv and audit) = 11 hours
Emp4, 5 hours = 25 hours
Employee 4: 10 (hours) / 25(project A2) = .4 * 11 (total TPV+Audit
(project A1+A3)) = 4.4 + 10 (emp4 hours). Adjusted hours for emp4 =
14.4
Employee 5: 15 (hours) / 25(project A2) = .6 * 11 (total TPV+Audit
(project A1+A3)) = 6.6 + 15 (emp5 hours). Adjusted hours for emp5 =
21.6
I cannot hardcode anything. I need to use the table2 to figure out the
projects I am totaling and the projects to adjust against.
Table2:
Project Task AdjProject Billable PercentBillable
A1 TPV A2 1 100%
A2 ITM 0 0
A3 AUDIT A2 1 100%
Billable = 1 tells me that projects A1 and A3 need to be adjusted
against project A2.
Please, can anyone help?
Thanks,
Ninel ...
Backup from server 1 and restore to server2.
Tri -
10 Jun 2005 5:28 AM - 3 messages
Hello . I use sql enterprise manager to do backup for the database from the server 1. the file is under .dat. can i use this file and restore it to another database server ( server2)? If it yes, can you show me how to do ...
Query Help
Ellis Yu -
10 Jun 2005 4:37 AM - 2 messages
Dear All, I have a single table name "Remark". It contains the item code, date, status and remark. If I want to build a query that select items out which the latest status is still in "pending" for example. How do I make it? ...
Filter remaining rows
sharman -
10 Jun 2005 4:34 AM - 3 messages
I am learning to write SQL Queries. I have two exactly similar tables - first has 1000 rows and the second has 100 rows. Out of these both the tables have 90 rows in common (Which I ca find using the INNER JOIN). How can I filter ...
string filteration
Kriste L -
10 Jun 2005 4:08 AM - 4 messages
Hi Everybody, I need to filter out string value that containing "_." or "._" Based on the following test sample, it should return only row 1 and row 2 but somehow the like clause is not working. select * from ( select 1 as row, 'sfsdf_.sdfsdf' as t union ...
Nullable Unique Constraint
WJ -
10 Jun 2005 2:55 AM - 4 messages
I have a table and want to put a unique constraint on a nullable column. I don't think I can do this and I think I will have to check for uniqueness on an Insert / Update trigger (selecting from the inserted buffer where column is ...
Hierarchical Result Set!
AJ -
10 Jun 2005 1:07 AM - 6 messages
I have the following table structures. question - question - text question_opts - question_opt_id - opt_text One question can have many options. When i want to retrieve a result set containing a question with all its options i get a copy of the question with each option retrieved. ...
trigger doesn't seem to work w/cursor
Keith -
9 Jun 2005 11:15 PM - 10 messages
Hi The purpose of this trigger is this; When "UNITNBR" gets updated, I want to change the ID field to a concatenation of the new UNITNBR and some other fields. So, this is what I've got: =============================== CREATE TRIGGER TRG_UPDATE_ID ON dbo.tblRESULTS ...
Too much to join
Zeng -
9 Jun 2005 9:56 PM - 7 messages
Hi, I'm very sure this is a classic performance/design problem that every experienced db designer knows about. Basically in an application with a feature that requires to frenquently join 3-4 tables together to return a list of something useful, it will run into performance problem including ...
Duplicate Column Names - A Good Trick to Avoid Temp Tables?
steveeisen -
9 Jun 2005 9:42 PM - 13 messages
A data base administrator objects to a select query I wrote, on performance grounds, because it uses a temporary table. So I simplified it, cutting elapsed time by 85%. However, before going into production, I wanted to run this by someone -- say, someone here -- ...
update statement
J-T -
9 Jun 2005 9:22 PM - 4 messages
I'd liekt o compare one record from one table with another exactly identical record (Schema wise,not data) from another table and if they are different in 3 fields (feild1,feidl2,feild3) then I update the second one.The problem is that is ...
stored procedure and views
Calvin X -
9 Jun 2005 9:00 PM - 2 messages
Hi All, Is it possible to use a stored procedure (one with parameters) result as the value for a column in a view. I know you can do this for UDF's but I cant make my stored procedure into a udf because I am building a dyanamic SQL ...
subquery help
Jen -
9 Jun 2005 8:01 PM - 2 messages
Hello, I need help building a query: I have Multiple single items with different statuses (one item can have several diff. statuses). The items and statuses are in different tables. I just want to have a recordset with each unique item and latest status. ...
SELECT for consecutive runs ofvalues
Joel Reinford -
9 Jun 2005 7:57 PM - 4 messages
I am looking for a way to extract starting and ending points for a run of values for a given foreign key. Given this scenario: CREATE TABLE Intervals ( PkValue int identity, FkValue CHAR(10) NOT NULL, StartYear INT NOT NULL, ...
Case setup for multiple fields
tshad -
9 Jun 2005 7:54 PM - 4 messages
I am trying to return some text to describe some bit fields. For example, I have the following table: CREATE TABLE [dbo].[TestStatus] ( [id] [int] IDENTITY (1, 1) NOT NULL , [FullTime] [bit] NULL , [PartTime] [bit] NULL , [Temporary] [bit] NULL , [Seasonal] [bit] NULL , ...
Primary Key, bigint or char?
Tim Baur -
9 Jun 2005 7:45 PM - 14 messages
Hey guys, just a quick question for you. I think I know the answer, but I would like to get the expert's opinions... I have a primary key called RequestID that is to be constructed of the year, month, day, and a four-digit sequence number with leading zeros. An ...
create table with dynamic constraint
Dave -
9 Jun 2005 7:09 PM - 6 messages
I am trying to create a table with the type of constraint I don't see in any of the help resources. Say the basic table structure for table t1 is (colType int, colDesc varchar(10), colMiscellaneous varchar(100)) I want to limit the combination colType-colDesc thusly: ...
Grouping by defined number of days.
Jack -
9 Jun 2005 7:05 PM - 3 messages
This is a question about custom grouping by a defined number of days. I would like to have a start date, then group the data in 3 day blocks. Is this possible ?? Ideally, I would like to have a start date, end date, and ...
Just a concept
Enric -
9 Jun 2005 7:05 PM - 4 messages
Dear all, What does 'federated databases' mean? I haven't idea if I'm currently using them in our Microsoft' international environment I've got SQL remote servers but.. Thanks a lot for your support, ...
update query
FRR -
9 Jun 2005 7:05 PM - 5 messages
Hello - Is it possible to update a char field to include only the first 5 characters? Can I use the left function to accomplish this? The problem is zip codes for a customer db were incorrectly loaded with four trailing zeros. ...
Address Selection Query
Chuck Reif -
9 Jun 2005 6:59 PM - 3 messages
I've been wondering if there was a better way to accomplish the following task, and any help or suggestions would be welcomed. I work on an application in which customers can have multiple address rows, which each customer having at least one row, marked as their default ...
How to optimize this query
gsinthoju -
9 Jun 2005 6:47 PM - 4 messages
In following code online_test_responses contains 16 million records and i have bundled it into stored proc and try to execute it it never runs. It runs 40-50 hrs but nothing happens. I have indexed the tables properly too. INSERT INTO objective_difficulty(code, correct, incorrect, skipped, ...
dynamic sql w/sp_executesql - servername parameter issue
andrew007 -
9 Jun 2005 6:31 PM - 2 messages
I know that we can't pass serername/tablename as a parameter to sp_executesql as follow... But I have to work around sql injection vulnerability too.... I want to use some type of paratertize way but...can't find a solution yet. ...
Case Syntax
vvenk -
9 Jun 2005 6:27 PM - 5 messages
I want to update teh columns of a database if the value is either 0 or ''. I tried using the statement below: UPDATE [medDRA].[dbo].[HLT_PREF_TERM] SET [HLT_CD_N] = CASE [HLT_CD_N] WHEN 0 THEN NULL ELSE [HLT_CD_N], ...
importing delimited files...
M.Smith -
9 Jun 2005 6:27 PM - 4 messages
Hi, I am importing a batch of comma delimited files. The process reads several files and then moves them to an archive folder. The process reads each line of each file into a temp db, but it does not parse the line out onto fields. It just dumps the whole line into the table. ...
Release date of SQL Server 2005
John Baima -
9 Jun 2005 6:09 PM - 3 messages
I don't know if this is interesting or not, but if you are interested in SS 2005, you may want to check out: [link] -John ...
Making a view
John Baima -
9 Jun 2005 6:08 PM - 2 messages
My brain is locking up again. I would like to make a view with the Tech_ID and the most recent, non-null value of TechWOProduct_WorksheetNumber. Thanks for any help -John CREATE TABLE [tblTech] ( [Tech_ID] [int] IDENTITY (1, 1) NOT NULL , ...
Need advice for publishing SQL DTS Packages / Automating changes for prod
Sean Aitken -
9 Jun 2005 5:59 PM - 2 messages
Hi, We are trying to simplify our lives a bit and be able to develop a DTS package in dev and have it pushed to test and stage, with the minimal amount of modification to the packages. It seems that the client 'alias' option works well for SQL connections, ...
Why is Insert causing duplicate records?
Earl -
9 Jun 2005 5:52 PM - 6 messages
Hopefully this is obvious because I cannot see why I am creating duplicate records with this Insert. The Staging table has 25,000 records, but after I do the Insert, I have 30,000+ records in the Prospects table. INSERT INTO dbo.Prospects ...
Primary key at the beggning of each record
J-T -
9 Jun 2005 5:32 PM - 6 messages
Are primary keys always the first columns in each record? What's the disadvantage of having them for example in the middle of the records? what happens? Thanks ...
Weird resuld from SP
Chris Lieb -
9 Jun 2005 5:30 PM - 6 messages
I have a SP that sets a flag on some records in a table. Whenever I run it in QA, it says: (... row(s) affected) (3 row(s) affected) Since I have only one UPDATE statement that is fired only once, why am I ...
Select statement
Aleks -
9 Jun 2005 5:18 PM - 3 messages
Hi, I have a table with fields "userid1" and "userid2" Those are int fields and have numbers, most of the times different like userid1 = 34 userid2 = 35 But sometimes they have the same values in a record, like: userid 1= 34 ...
Proper Case Syntax on Name Column
Lontae Jones -
9 Jun 2005 5:17 PM - 4 messages
Hello, I have a Column called Name varchar(50). Data was imported from an excel spreadsheet in all caps. How can proper case all fields in this column that is in CAPS? ...
Database adapter?
Bob Castleman -
9 Jun 2005 5:00 PM - 7 messages
So what exactly is a database adapter? There is a company that wants to provide reporting services to our customers using a proprietary technology, but all they will tell us is they use an adapter and a listener through ODBC. Seems to me that an adapter is just a fancy way of saying a wrapper ...
Time Math
Steve Murphy -
9 Jun 2005 4:54 PM - 2 messages
I'm trying to do a calculation of the time between a start time and an end time and represent the result as a real. What is the best way to approach this in a query? Thanks, Steve Murphy ...
unable to open web project. Gives the following error "The connection with the server was terminated
Is there something wrong with my index, or am I misunderstanding how an index on multiple columns is
Next »
|
|||||||||||||||||||||||