Home All Groups Group Topic Archive Search About

SQL Server database programming

microsoft.public.sqlserver.programming
Score Logical Design!!!
Adam J Knight - 14 Jan 2006 11:20 PM - 3 messages
Hi all, I have a table called students, with the following structure: Students: - StudentID - InstitutionID - AccountID - FirstName - LastName - Phone - Mobile - Email - StreetAddress - Suburb - PostCode - StateID I have different types of students that will be stored in the db table: Mature age students are required to provide all info in the respective ...
Score Need help with trigger -novice-
Merrill - 14 Jan 2006 8:57 PM - 3 messages
I am trying to prevent the deletion of records in a child table if the record in the parent table has a date in a date field. Every thing is being deleted from the w_schActivityPatients table regardless if there is or isn't a date in the Parent ...
Score repost on subtracting date range data between tables
peter walker - 14 Jan 2006 6:45 PM - 6 messages
Hi everyone. I posted this previously but made an error in my original posting. So i am posting again with corrections in place, in hopes someone might shed light on a possible solution. What i have is two tables containing date range date. I need to find the ...
Score problem with filtering data
hubmei75@web.de - 14 Jan 2006 3:55 PM - 7 messages
Hello, I have a simple table containing adresses. A sample view of the table is    id    name     city    --------------------------------    100   Meier    New York ...
Score trying to implement simple while loop
hazz - 14 Jan 2006 2:44 PM - 3 messages
why am I getting the TSQL error "Incorrect syntax near the keyword 'begin'." can you see what I am trying to do? I want to print out counts for a date based query as I decrement the date with each loop. ...
Score saving value of COUNT function result
hazz - 14 Jan 2006 2:10 PM - 9 messages
using the following example, how would I save the value returned by the COUNT function so that I can use the result in a subsequent loop. thank you.  -greg USE AdventureWorks; GO SELECT COUNT(DISTINCT Title) FROM HumanResources.Employee; ...
Score Update and Delete command
Ali.M - 14 Jan 2006 1:42 PM - 6 messages
Hi All I have two tables that I want to can delete or update some records of them with compairing with each other.I mean I want to chech if field1 from table1 is or isnot equal with field2 from table2 I can delete or update that records. ...
Score newbie openquery question
arch - 14 Jan 2006 7:29 AM - 2 messages
How do I use openquery to create a table in an oracle database.  Any sql string that I pass thru fails as it doesn't return any rows. ...
Score Outer Join and WHERE clause strange behavior
Mark Williams - 14 Jan 2006 7:06 AM - 19 messages
I am writing a stored procedure to get aggregrate data out of a web site log table by joining it with a view DDL for the table: CREATE TABLE w3cexlog (   pacifictime datetime,   [cs-method] varchar(20),   target varchar(8000), ...
Score MINUS operation between table date ranges, is my algorithm sound?
peter walker - 14 Jan 2006 2:55 AM - 6 messages
Hi everyone, i was hoping someone could help me. i am looking to implement a MINUS operation between two tables which contain date ranges. table a: [start] [finish] [group] 1   10    0 18 19    1 ...
Score Possible to get column number on a bcp_sendrow failure?
kdd21 - 14 Jan 2006 1:18 AM - 6 messages
I've tried SQLGetDiagRec, which tells me that there was an invalid date format on a column, but there's no indication of *which* column, and my table has several date columns in it. I then spotted some references to SQLGetDiagField with ...
Score Moving a database
Dean - 13 Jan 2006 11:26 PM - 2 messages
I have a small customer with a 2GB database. They recently added a RAID 5 array and RAID10 array to their server. I want to move the data files to the RAID 5 and the log files to the RAID 10. Is there a script/command I can use ...
Score Verify existing Child Data
tarcila@infomercial.tv - 13 Jan 2006 11:15 PM - 4 messages
Hello, Does anybody has any clue if its possible to verify if a record has any related data? Let me try to explain these a better, i'd like to show the delete option only when no data related with the specifc Record is available ...
Score SQL for custom paging solution
jonefer - 13 Jan 2006 9:49 PM - 4 messages
When I try to compile this (complete Store Procedure below) I get the following error: The select list for the INSERT statement contains fewer items than the insert list. I know what is causing this to bomb is the complex Grouping (which I've ...
Score Dynamic SQL and @@Rowcount
dpc - 13 Jan 2006 9:47 PM - 3 messages
How can I get the RowCount of a SQL that has been executed in a dynamic SQL. @@RowCount appears to return the rowcount for the EXEC of sp_executesql. T.I.A. E.g.: DECLARE @TblGen Table   (relation nvarchar(50), ...
Score Signalling between two applications
Ryan Pedersen - 13 Jan 2006 9:15 PM - 3 messages
I have two applications that pass data in one direction via a MSMQ. "Scheduler" application looks at the database and finds records that need to be worked on. It creates object for those records and puts them in the message queue. The "Worker" application is monitoring the ...
Score Selecting Duplicates - all data
Simon - 13 Jan 2006 8:50 PM - 5 messages
Hi all, I have found many solutions for selecting duplicates with the most popular being: SELECT ColA, COUNT(ColA) FROM SomeTable GROUP BY ColA HAVING count(ColA) > 1 However, what I am after is a query that returns all of columns and all ...
Score Most recent data point?
Michael Bray - 13 Jan 2006 8:34 PM - 4 messages
I have a table that stores data points for several different data sources.  The general format is: DECLARE @Data TABLE (         DataID int,         TimeCollected int,         DataValue decimal(9,9) ...
Score Replce SPACES in values
Mike Kansky - 13 Jan 2006 8:26 PM - 6 messages
I have a task before me that i need help with. I have values in table that look like this: 'MY TASK' [random_operator] 'VERY ANNOYING' I need to replace SPACES that are inside quotes with '_?' Only values  that have quotes around them should have their spaces replaced ...
Score "did you mean" feature
Fabio Cavassini - 13 Jan 2006 7:46 PM - 11 messages
Having a list of words in a table...haw can I make with SQL a "did you mean" search? for example.. Having a table with these data: hello hallo hi lup hai If I look for "hollo" it should return "hello", "hallo" ...
Score "No more data available to read" error
MittyKom - 13 Jan 2006 7:43 PM - 2 messages
Hi All "No more data available to read" error is thrown by database driver when connections max out on SQL Server.  Does any one know what this means and how can i resolve this issue? An application developed in Java uses SQL Server ...
Score Help! Query Question.
Yoyo - 13 Jan 2006 7:18 PM - 8 messages
Hi all, I'm new to SQL programming, and I am having a hard time figuring this one out. I have a table containing the following information: Activity    Cost Account    Hours 1    A    100 ...
Score DB Change Deltas HELP!!!
Tim Greenwood - 13 Jan 2006 7:08 PM - 5 messages
I know there are tools that can look at two different versions of a database and generate a script to take one to match the other.  I cannot seem to find anything suitable.  I thought Visio could do this but I'm not seeing ...
Score Performance of UPDATE commands on individual records
Josh McFarlane - 13 Jan 2006 6:41 PM - 3 messages
Ok, I'm at a crossroads in my program. I've got a program that needs to throw an SQL update command to update some individual records. differently if the field is the same as the old field? IE Is it worth doing a string comparision on old vs new data in the ...
Score Standard Deviation
Bahman - 13 Jan 2006 6:10 PM - 2 messages
Hello! I have a problem with my sql server. When I run: select stdev(sales), avg(sales) from salestable I get: standard deviation: 65, average: 63 Which is garbage. What would be the correct syntax to get the stdev? What would I have to tell ...
Score generic audit trail best practice questions
jason - 13 Jan 2006 4:56 PM - 15 messages
hello everyone, so i have the need for an audit trail for certain activities. ideally i would like a generic audit trail table, that denotes the kind of activity, the entity reference it was performed on, and the entity reference it was performed by. ...
Score sp_OAGetProperty procedure is giving error
vineet.jsl@gmail.com - 13 Jan 2006 4:49 PM - 2 messages
i am encountering a problem when calling a web service from the stored procedure. the sp_OAGetProperty procedure is not running fine. at this line the error generated is 0x80020006 ODSOLE Extended Procedure Unknown name. do anyone have any idea about how to solve this problem. i need help. ...
Score append a string to all the values in a column SQL
gtg974p - 13 Jan 2006 4:42 PM - 11 messages
Sub: Append a string to all the values in a column SQL Hi all, This might be a very simple query. But I am new to SQL programming. Hope someone can help me. I have a table --- 1634        Fred       los angeles ...
Score BCP IN: create table on-the-fly
Test Test - 13 Jan 2006 4:32 PM - 5 messages
Hello! I have a BCP file (.BCP) and I want to do a BCP IN but I don't have a table associated with it. (Lets say table got dropped). I am curious if there is a way to create a table on-the-fly while doing BCP IN? Any neat ...
Score Alter a constraint?
Rick Charnes - 13 Jan 2006 4:28 PM - 10 messages
Is there a way to add a column to a PRIMARY KEY constraint (without deleting and recreating it?)  Thanks. ...
Score SQL Syntax Question
Greg Smith - 13 Jan 2006 3:51 PM - 6 messages
Is it possible to pass a table name to a stored procedure? I have a ton of stored procedures that do the same basic thing, just on different tables. Can I pass a table name, and, if so can you give me an example? ...
Score Constraint
Olav - 13 Jan 2006 3:48 PM - 5 messages
Hi, we want to check the paystatusid in the table Treatement CREATE TABLE [Treatement] (     [treatementid] int IDENTITY(1,1) NOT NULL ,     [customerid] int NOT NULL ,     [paystatusid] int NOT NULL , ..... and CREATE TABLE [Paystatus] ( ...
Score Moving tempdb
Emma - 13 Jan 2006 3:31 PM - 3 messages
How do I move tempdb to another drive on the same server? Thanks Emma ...
Score Statistics Deadlocking
JI - 13 Jan 2006 2:58 PM - 5 messages
I have a statistic that has been created by SQL Server automatically that is deadlocking. I understand how it deadlocks but would like some advice on the best fix. My thoughts are dropping the statistic or creating an index on the ...
Score Why SQL2k and SQL2005 Return Different Order for sysindexkeys?
Mac - 13 Jan 2006 12:56 PM - 10 messages
I have an exact table in both SQL2000 and SQL2005. But the return order of 'colid' for the first key is different! (only the first key, not the others). My select query is: "SELECT [indid], [colid] FROM AWT..sysindexkeys where [id] in ( select [id] from AWT..sysobjects where [name]='VendorItem' ...
Score Obtaining different timings for the same process??
Enric - 13 Jan 2006 12:49 PM - 4 messages
Dear fellows, The following loop bring me differents results, execute one after one (among them a truncate table, of course): DECLARE @loop as integer set @loop = 1 while @loop < 10000        begin         insert into A_test(id,nombre,ape) values(@loop,'a','aadfasdf') ...
Score Is OR so bad?
tonicvodka - 13 Jan 2006 12:30 PM - 7 messages
Hi all ! I have the following query which runs ok: SELECT estates.l_memberID, member.l_memberID FROM estates left join companies on estates.l_companyid=companies.l_companyid left join multimedia on multimedia.l_estateid=estates.l_estateid and isnull(N_INDEX,1)=1 left join member (NOLOCK) on estates.l_memberid=member.l_memberid ...
Score MTS Query
lara169 - 13 Jan 2006 11:08 AM - 2 messages
Hi, This is a silly question 1. What the precausions we need to take care while coding a procedure, if we have an MTS. Do we need to explicitly mention the Transactions in the sps ? And  what about setting the Value of 'XACT_ABORT' . ...
Score handle errors in trigger
Vikram - 13 Jan 2006 10:21 AM - 13 messages
How to handle error in trigger. i m inserting record in other table in after insert trigger. but if insert statement in trigger has error, procedure quits with error and i cannot use @@error to check it ...
Score Obtaining total of partial
Enric - 13 Jan 2006 10:11 AM - 3 messages
Dear all, I was wondering how do I for obtain the total for the field 'parcial' in the same query, of course: SELECT MONTH(DIA_HORAESCRITURA) AS MES,DAY(DIA_HORAESCRITURA) AS DIA, COUNT(*) AS partial FROM ABS_DIARIOHISTO WHERE DIA_SUCURSAL = 81 GROUP BY MONTH(DIA_HORAESCRITURA),DAY(HORAESCRITURA) ...
Score Extracting from linked tables into pivot
CyberFox - 13 Jan 2006 9:56 AM - 6 messages
Hi there, I've managed to come this far and I need a bit of help to finalise. I'm extracting records correctly using the following: select substring(D.MStockCode,1,3) as Style,     sum(case month(D.MLineShipDate) ...
Score What's a good SQL server naming convention
CharlesA - 13 Jan 2006 9:56 AM - 36 messages
Hi folks, I wonder if any of you in all your wisdom happen to know the URL of a published web article on a really decent SQL server naming convention I've obviously googled it, but have come across nothing that has ...
Score SQL profiler
SimonZ - 13 Jan 2006 9:26 AM - 3 messages
I would like to see what's happening on the database which I'm database owner. But when I open SQL profiler it requires that I'm a member of sys admin server role. What now? I'm dbo of that database(I created it) but I can't see what's happening ...
Score Insert into table with union?
Lasse Edsvik - 13 Jan 2006 9:21 AM - 4 messages
Hello I was wondering howto insert into a new table with a union query, something like: SELECT * INTO #New FROM SELECT SomeNmbr FROM #A   UNION SELECT SomeNmbr FROM #A ...
Score Max question
Lasse Edsvik - 13 Jan 2006 9:18 AM - 6 messages
Hello I was wondering if you guys could help me with a simple max select, Im trying to find the max value where SomeNmbr doesnt follow the increment step of 1. And no, im not trying to fiddle with the IDENTITY(1,1) thing :) ...
Score set theory operations on two tables containing date range data
peter walker - 13 Jan 2006 9:01 AM - 3 messages
Hi everyone, I was hoping anyone came across implementing set theory operations on two tables containing date ranges. In specific the tables are set up as so: Table A [client] [start date] [ end date] a   1   3 ...
Score complicated Join - duplicate row problem
Jeff User - 13 Jan 2006 6:38 AM - 4 messages
Hi I had a similar problem awhile back and it was solved here. Now it has gotten more complex. I have removed uneeded stuff here to keep this simple.: I am sure I know why I am getting the results I am, but don't know ...
Score question on inserting a record on sql server with identity column as key
Hongyu Sun - 13 Jan 2006 5:55 AM - 2 messages
Hi, All: Please help. I use sql server as back end and Access 2003 as front end (everything is DAO). A table on SQL server has an identity column as the key. We have trouble on adding records to this table using the following SQL. ...
Score Journal table for a database
Senthilkumar - 13 Jan 2006 5:38 AM - 5 messages
Hi, I am using a SQL Server 2000 database with a VB.net program and uses Integerated security. I want to log all the changes made to any table data(whether addition, deletion, updation) to a single table by all the ...
Score Update Query!!!!
Adam Knight - 13 Jan 2006 2:14 AM - 2 messages
Hi all, I have the following query that returns a two column result set. SELECT     s.standard_id, si.standard_item_id FROM     standards s INNER JOIN     standard_items_bk si ON     s.parent_id = si.standard_id ...
Score Inserting same identity value into two linked tables
Amir - 13 Jan 2006 1:09 AM - 3 messages
Hi, I have two tables which has 2 linked fields, as David Portas posted in 'Field value determines whether there is extra info that should be held about that record': CREATE TABLE events (event_no INTEGER NOT NULL PRIMARY KEY, event_type ...
Score Indexing datetime field for selecting dates ranges
Amir - 13 Jan 2006 12:53 AM - 3 messages
Hi, I have a table with a smalldatetime field. Some of the queries in my application are using range searches over that smalldatetime field, such as selecting all the records within a date range. None of these queries are selecting records from a specific date/time. They all work on ranges (e.g. ...
Score User Function Date parameter
AkAlan - 12 Jan 2006 11:54 PM - 3 messages
I'm trying to create a User Defined Function which will return only records with a date earlier than the current date. I tried using ,GETDATE() in the criteria block of the date field but when I try to save the function I get ...
Score Optimizing an IN clause
Roger Garrett - 12 Jan 2006 11:50 PM - 20 messages
I have a fairly straightforward SELECT query that includes the following: MembersTable.MemberID IN ( SELECT ZipcodesTable.MemberID FROM ZipcodesTable.Zipcode IN ( '01234','03631','55902' ...   '03036' ) That is, it's looking for entries in the ZipcodeTable where the Zipcode ...
Score Can not create trace file
Sourabh - 12 Jan 2006 10:48 PM - 1 message
Hi All, I am trying to create AS trace file programatically. I am using following code:             TraceServer reader = new TraceServer();             TraceFile writer = new TraceFile(); ...
Score Advanced Sql-Shape Query - Help
doar123 - 12 Jan 2006 9:47 PM - 2 messages
Hi, This is my basic sql shape query: ------------------------------------------------------------ SHAPE {select * from tbl1} APPEND({SELECT * FROM tbl2 where field1=1} AS RS2 RELATE field TO field) ------------------------------------------------------------ With this query i get a RecordSet (RS1), who handle all the records from table tbl1, and a secondary RecordSet (RS2) who handle all the ...
Score NULL issue
Npeart1 - 12 Jan 2006 8:34 PM - 2 messages
I have a PHP web form that takes data and posts it to the SQL database. Instead of a record number being assigned to the first column of each row, the database displays <NULL> in the column. How can I get the record number ...
Score IF UPDATE ( column)
Abraham Andres Luna - 12 Jan 2006 8:28 PM - 6 messages
hello everyone, the documentation doesnt specify so i'm just gonna guess, but how would i specify multiple columns using the if update syntax IF UPDATE (Column) is documented i'm gonna try IF UPDATE (Column1, Column2) hope it works ...
Score SQL 2k5 vs 2k - different results on same execution? ORDER BY prob
Catalin NASTAC - 12 Jan 2006 8:28 PM - 13 messages
Hello, I've got suprised that I had to change the code for a sample of my code, upgrading from 2k to 2k5... I have something similar with this code, which give me also different results (of course, supposing that I have 2 identical Dbs, one in 2k and ...
Score one ado connection object - multiple spids?
Pedja - 12 Jan 2006 8:26 PM - 2 messages
Hi, We have asp application (ado connection) which connects to the sql server 2000 (sp3). There is one asp page which sequentially executes set of 6 stored procedures. When I execute same set of stored procedures in query analyzer, I get response in less than 1 second.When application does that, ...
Score grouping a few columns
J055 - 12 Jan 2006 7:55 PM - 4 messages
/* Hi I need to query this table to get results where ids are found with every searchNum, i.e. the results of this would be: id ...
Score Looking for Query
Tim Morrison - 12 Jan 2006 7:54 PM - 4 messages
SQL SERVER 2000 I have to tables Students: StudentSysID (INT) PK StudentName (VCHAR 100) NumTeachers (INT) Classes: SysID (INT) PK StudentSysID (INT) TeacherID (INT) I am looking for a query to do the following UPDATE Students SET NumTeachers = (SELECT DISTINCT COUNT(TeacherID) FROM ...
Score Division question
Paul fpvt2 - 12 Jan 2006 7:52 PM - 3 messages
When I do the following query: select convert(decimal(8,2),(1/3))  -- > returns .00 When I do the following query: select convert(decimal(8,2),convert(float,1)/convert(float,3)) -- > returns ..33 Is there a better way to do the division other than converting each number ...
Score DeadLocking
JI - 12 Jan 2006 7:39 PM - 4 messages
I need help. We keep having deadlocking. The deadlocking trace points me to a statistic update. The KEY: 5:242972092:25 index lock it points to is a SQL Server automatically created statistic. It is on a foreign key column. ...
Score Searching a datetime field by time
Andrew Chalk - 12 Jan 2006 7:25 PM - 10 messages
I have the time of an event stored on each record as a datetime field.It includes the year,month,day, etc. Suppose my user wants to search the table for all events over the lunch hour, say between11am and 1pm. How do I ...
Score Add the end date to record
AshleyT - 12 Jan 2006 7:18 PM - 6 messages
I have records with a start date.  I would like to add a column that is the end date, or the next record's start date. So if I had Store, startdate, retail 1, 10/15/2005, 2.50 ...
Score Searching on partial match in a text field
Andrew Chalk - 12 Jan 2006 7:11 PM - 9 messages
I have a customer who wants to SELECT records based on a partial match in a text field. For example, in a list of telephone numbers they want to search for all records that contain the digits '777' in any part of the string. How ...
Score Subquery Problem
scott - 12 Jan 2006 6:41 PM - 6 messages
Although I know there is a better way to achieve the same results, I'm just using the below queries based on Northwind so I didn't have to post a DDL. Problem: If you run the code in SUBQUERY PROBLEM below on Northwind, it ...
Score Override Checking...?
rmg66 - 12 Jan 2006 6:35 PM - 2 messages
Is it possible to create a view in TSQL that references a table that cannot be verified. Is there some sort of override. I need to create a view that refences a table in another db. The other db cannot be available during creation. ...
Score scientific notation and CAST or CONVERT
Martha Hoffmann - 12 Jan 2006 5:51 PM - 5 messages
Is it possible for me to return a very small number (5 or more decimal places) as a string NOT in scientific notation using the CAST or CONVERT function?  I want 0.0000769 not 7.96e-005. Thanks, Martha Hoffmann ...
Score 1. print current count 2. decrement date 3. subtract previous count from new count
hazz - 12 Jan 2006 5:09 PM - 2 messages
declare @today  datetime set @today  = '2006-01-12' select count( var1 ) from customer where var_DT > @today 1. Print or capture the counts for var 1 given  'where var_DT > @today' 2. Decrement @today  (@today - 1) ...
Score Installing SQL 2005 Beta
Dee - 12 Jan 2006 4:31 PM - 5 messages
I am having a problem install the software, it tells me the install is already running, or it gets hung on checking IIS. Any help available. Thanks Dee ...
Score Retrieve list of tables without triggers
scuba79 - 12 Jan 2006 4:31 PM - 5 messages
I need to do some db cleaning, how can I get a list of tables within the database that do not have any triggers. Thanks in advance ...
Score upgrading to 2000 from 7.0
Enric - 12 Jan 2006 3:56 PM - 4 messages
Dear fellows, I would like to know how do I figure out which collation is established in a DB created in a Sql Server 7.0. I need to migrate to 2000 but I don't know how to see this information. ...
Score Connecting to SBS SQL via Remote VPN (VB Application)
TIM - 12 Jan 2006 3:21 PM - 2 messages
Hi, Dont really know if this is the place to ask but here goes.... I have written a VB application that talks to various SQL2000 Tables. But i need to expand the VB App to work on a laptop thats remotely connected by VPN. ...
Score Pivot Table
CyberFox - 12 Jan 2006 2:51 PM - 3 messages
OK, I've now read a lot about the pivot table funcationality within SQL, but I need some help: (btw I'm running on SQL 2000, which according to my knowledge does not have the PIVOT function) I need to pivot information as follows: ...
Score ASC/DESC as SP Keywords?
Chris Ashley - 12 Jan 2006 2:42 PM - 3 messages
Can I do something like this: CASE WHEN @orderBy = 'ASC' THEN ASC ELSE DESC END So I can order by asc or desc depending on a stored procedure parameter? ...
Score What is this called, and how to do it?
Ian Boyd - 12 Jan 2006 2:42 PM - 10 messages
It's a very common question: Input Item    Detail ====    ====== A    red B    green B    blue C    red C    blue ...
Score Create record each day from time frame
AshleyT - 12 Jan 2006 2:29 PM - 2 messages
I have a table that has cost records for a specific item for a specific start date. Start, cost, item, PromoCode, end date 01/02/2006, 2.45, 1234, R, 01/05/2006, 2.00, 1234, P, 01/08/2006 ...
Score BACKUP DATABASE
Wes - 12 Jan 2006 2:02 PM - 3 messages
DECLARE @Name varchar(50) DECLARE @Disk varchar(255) SET @Name='Databasename' SET @Disk = 'Drive:\path\' + @Name +'.bak'     BACKUP DATABASE @Name to DISK =   @Disk     BACKUP LOG @Name     WITH        NO_LOG ...
Score assign truncate rights to a user
Vikram - 12 Jan 2006 1:49 PM - 3 messages
i have a user who has delete rights on a table, but when i call truncate table statement it says not enough permission. how to assign truncate rights ...
Score Syntax please
marcmc - 12 Jan 2006 1:27 PM - 6 messages
I just can't seem to get the apostraphes right in this piece of dynamic sql. Any ideas? declare @marc varchar(4), @marc1 varchar(8) select @marc = 'marc' select @marc1 = 'QUINN_WH' EXEC('INSERT INTO marc_QMR_SNAPS_bug_Fix VALUES(' + @marc + 'Table Index created, getdate()') ...
Score How do I use ADO in VC++ 7.0 to get the size of the database
Kjell Arne Johansen - 12 Jan 2006 12:43 PM - 5 messages
How do I use ADO in VC++ 7.0 to get the size of the database. I know that sp_helpdb <database> returns size information. But how do I retrieve this information in my code? In my code I'm using _ConnectionPtr to execute commands, ...
Score Query Problem
Ricky - 12 Jan 2006 12:13 PM - 7 messages
Hi I'm sure there is simple answer to thsi trivial problem, but I am completely stuck. I have got a table which contains 1000's of transactions of Claims, however I need to run a query of all closed claims. ...
Score bcp issue
Enric - 12 Jan 2006 11:52 AM - 5 messages
Dear all, I've got a little issue and I can't work out with it. Using BCP in order to export the contains of a .dat file into a table: C:\OFI0501>BCP abs..ABS_OF501 IN 20050726.DAT -e enric.txt  -n  -Sserver -U ...
Score Drive capacity
Venkat - 12 Jan 2006 10:44 AM - 3 messages
Hi folks, I need to find out Drive capacity and free space, I do not have access to Windows. I just have sa access to the SQL Server. I used xp_fixeddrives to find out the free space, but how do I know the ...
Score Sql Server 2005 possibilities
Enric - 12 Jan 2006 9:57 AM - 3 messages
Dear fellows, We are accostumed to work a lot of time with ETL processes such as DTS. We have got nearly 1,200 among three servers. Question is easy: Sql2005k provides us a powerful tool inlayed the own application be able to execute ...
Score Index
Guru - 12 Jan 2006 9:31 AM - 3 messages
Hi all How to findout which column(s) in the tables requires index. Any method to follow?? Thanks in avance Guru ...
Score CREATE TRIGGER on system tables
Yaniv - 12 Jan 2006 8:50 AM - 12 messages
I need to be notified of each sp that is beeing added or altered. I would like to create a trigger on sysobjects for this pupose. When I run the CREATE TRIGGE the following error msg received: CREATE TRIGGER permission denied on object 'sysobjects', database 'ABC', ...
Score Is there an easier way to programitcally create a new database and login user
Tony - 12 Jan 2006 8:18 AM - 6 messages
I'm thinking there MUST be an easier way to programmatically create a new database and login than the following steps we are doing below. If so, I would appreciate any info you could provide. Thanks, Tony 1) connect to master using sa credentials ...
Score Stored Procedures Permissions
Prasad - 12 Jan 2006 7:32 AM - 4 messages
Hi,     This is for the SQL 2005 (Yukon) Server.     Can anybody tell me what the permissions "References" means on the Stored Procedure.     Even if it is not possible to assign the "References" permission ...
Score convert hex string to hex literal
JTL - 12 Jan 2006 5:56 AM - 4 messages
how can i tell sql server to execute the "convert" function using the literal hex value, 0xC0, rather than the string value '0xC0'? for example, this works: declare @myhexint as int set @myhexint = 0xC0 select convert(int, @myhexint) but this does not: ...
Score Access 2003 and SQL Server Development - Best Practices
Johnny Liner - 12 Jan 2006 5:18 AM - 1 message
Hello, I have been developing Access DB solutions for a while now. While I would not call my self an expert, I do know a good bit about coding and table design. Most of my applications has been one to user DB apps, were I have a ...
Score SQL Server vs the Competition
Jeff - 12 Jan 2006 5:03 AM - 17 messages
I'm looking for some brief summaries or comparisons that support an IT management decision to implement a new system with SQL Server as the database and not an alternative db (oracle, informix, whatever). Specifically looking for things like return on investment (ROI) and total ...
Score MS DTS Object Package Library
Joe Delphi - 12 Jan 2006 3:24 AM - 2 messages
Hi,        I am trying to execute an MS SQL Server DTS package from my Microsoft Access form.    Here is the code I am using: Private Sub cmdImportScats_Click() Dim pkg As DTS.Package ...
Score Filter on view Problems
Oded Dror - 12 Jan 2006 2:57 AM - 2 messages
Hi there, This is a view base on Northwind database SELECT      dbo.Orders.CustomerID,                    dbo.[Order Details].UnitPrice AS NewUP, ...
Score select * from inserted
Desmond - 12 Jan 2006 1:48 AM - 8 messages
Hi, In trigger, there's this sql statement, select * from inserted & select * from deleted. May I know what're their purposes ? Any links for additional info ? Thanks ! ...
Score Stored Procedure Error - Newbie
Anthony D. Law - 12 Jan 2006 1:13 AM - 6 messages
I am trying to create the following SP: ***************** CREATE PROCEDURE [dbo].[SUBJECT_Update_Properties] (        @PROJ_KEY varchar(4),     @CDKey varchar(10),     @UIKey varchar(8),     @ProjectName varchar(50),     @Builder varchar(50), ...
Score MSAS Meta Data
GB - 11 Jan 2006 11:52 PM - 1 message
Hello: In MS SQL Server 2000 how can I get meta data about OLAP database objects (cube names, dimension names, etc)? Thanks, GB ...
Score create a temporary table
Frank Dulk - 11 Jan 2006 11:45 PM - 3 messages
How to create a temporary table where the name of the table is the user's ID. #@IDUsuario ...
Next »