Home All Groups Group Topic Archive Search About

SQL Server database programming

microsoft.public.sqlserver.programming
Score Any performance issues if we use BigInt
Bob - 3 Dec 2005 10:03 PM - 6 messages
In the past, I've always used "int" for the Identity field.  But as the application usage increases, it seems to demand for values that exceed the "int" scope.  I'm thinking of upgrading all my Primary Keys that were "Int" ...
Score queries filling up logfile
Santu - 3 Dec 2005 9:14 PM - 4 messages
There is a file in my c:\winnt\system32 by the name sysfile.log, and it contains what seem to be the queries a reporting tool uses, and its filling up on disk space real fast, is anyone aware of this problem ...
Score Administrative Tasks
PP - 3 Dec 2005 7:54 PM - 3 messages
Hi Can somebody please point me to good URL or may be some scripts that I can use to execute as part of DB health check. Also, I would like to see if the DB is well designed or thought of while it ...
Score unaccountable result for select
helmut woess - 3 Dec 2005 7:33 PM - 5 messages
Hi, I am using MSDE2000 sp4 and tried following: (you can copy it directly in QueryAnalizer) ----------------------------------------------------- declare @tbl table (   yyyymm  int,   id      int,   x       int ) ...
Score Help..........
Bpk. Adi Wira Kusuma - 3 Dec 2005 7:07 PM - 4 messages
I ve data like it: a            b ------  --------- 1            4 5            7 ...
Score SP clause - where (field = @Param or @param is null) is this fast?
yitzak - 3 Dec 2005 6:21 PM - 21 messages
Hi It would SEEM to me that this is a rather neat way to write SPs Create proc mysp @LastName   varchar(32) = NULL @Date           datetime As Select Fieldlist from tblOrders ...
Score order of columns in composite index
Bob Gabor - 3 Dec 2005 6:11 PM - 5 messages
I'm know that for composite indexes, the recommendation is always to specify the most selective column first, but can someone please explain why this makes such a huge difference in perfomance??  I have a table where column A ...
Score Delete invalid Details
Islamegy® - 3 Dec 2005 3:33 PM - 5 messages
I need to delete invalid records in child table while parent have 2 Fields PrimaryKey like this ================================== Delete From AH_TasnFakaraat Where Master_ID,Fakra_ID not in (Select Master_ID, Fakra_ID From SubMaster) ============================== (,) is not acceptable in Where clause so if i wrote it like this: ...
Score Delete Duplicate Record
Islamegy® - 3 Dec 2005 3:19 PM - 4 messages
I have Changed my database schema and transform Data with new keys using this Query : SELECT     Case_No, Case_Date, Ma7akem_ID, COUNT(*) AS Expr1 FROM         Master_Ahkam GROUP BY Case_No, Case_Date, Ma7akem_ID ...
Score Recover the data
Lara - 3 Dec 2005 10:06 AM - 3 messages
Hi, My appln runs on a remote server. A few minutes ago i accidently ran a 'Truncate table' command. Is there anyway to recover it thru Query Analyzer. The DB Recovery model is SIMPLE and i have the dbOwner permission. ...
Score SQL Server and Time Zome
Santosh - 3 Dec 2005 5:09 AM - 13 messages
Hi,     We are storing some date stamp values for our application in GMT. Based on the user logged in, we need to convert these values to the local time of the time zone specified by the user. Is there any direct function or user ...
Score Free MCAD/MCSD ebooks online
MCAD Poster - 3 Dec 2005 3:46 AM - 1 message
[link] is the best ebook community. ...
Score Find SQL solutions with free eBooks. Search the ebooks NOW.
MCAD Poster - 3 Dec 2005 3:41 AM - 2 messages
XML and SQL: Developing Web Applications [link] SQL Performance Tuning [link] ...
Score Excel file import to Sql Server problem
GB - 3 Dec 2005 12:13 AM - 2 messages
Hello: I need to import an Excel file to SQL Server. The .xls file has the column names which contains dot inside, like AAA.BBB. When I import this file in SQL using DTS Import/Export tool, it creates a table ...
Score Formatting numbers
jsnation - 3 Dec 2005 12:03 AM - 7 messages
Any help on this problem would be greatly appreciated. I have a field in my database that contanis numbers (i.e. 1, 2, 6, 7 etc.) I want to create a stored procedure to return these numbers, but formatted in such a way that they always show a full 10 digits. For ...
Score weekday or Weekend
Jim Abel - 2 Dec 2005 11:21 PM - 3 messages
I have a simple table the has 3 columns CDATE   NCout  RCount 11/26/05  423      3545 11/27/05  474      3597 11/28/05  636      3512 ...
Score SQL Server index low cardinality columns
Dave - 2 Dec 2005 10:29 PM - 11 messages
I am trying to understand when to index a column and when not to.  I have read several post and web sites on indexing, but I am still not clear on if I should index columns that only contain a few distinct ...
Score Differences between DISTINCT and GROUP BY?
Nicolas Verhaeghe - White Echo - 2 Dec 2005 9:35 PM - 5 messages
What is the difference between the two statements, besides the syntax? And in general what are the differences between the DISTINCT and the GROUP BY methods? -- Thanks select field from table group by field select distinct field from table ...
Score running stored procedures from SQL Agent
Gary - 2 Dec 2005 9:23 PM - 13 messages
I'm trying to understand some behavior I'm seeing running a stored procedure as a TSQL jobstep in a SQL Agent job. If I run the sp from query analyzer or osql, it completes as expected, but in the process may generate a few 3604 ...
Score The weirdest SQL problem you'll ever see.
Darren Mart via SQLMonster.com - 2 Dec 2005 8:54 PM - 10 messages
If you're able to shed light on the problem described below, you will be forever acknowledged as THE supreme being of all things SQL Server 2000. I have a stored proc (spGetMemberInfo) that accepts one int parameter, @AppID, and returns XML via FOR XML EXPLICIT. The output looks something like this:  ...
Score Ole object to illustrate the Enterprise manager VIEW designer in a WORD document
Mathieu Dumais-Savard - 2 Dec 2005 8:53 PM - 2 messages
Hi, Does something similar to the view designer in enterprise manager exist that I can integrate in word? Something like Insert, Database Shema... that shema would be binded to a database so if something change (let's say a field name) the corresponding schema would be changed (or at ...
Score need output where same column has more than one pirce of data
Chesster - 2 Dec 2005 8:45 PM - 8 messages
CREATE TABLE test (material int, col1 varchar(3), col2 varchar(1)) INSERT INTO test values(111,'a12','a') INSERT INTO test values(111,'d33','a') INSERT INTO test values(222,'a25','a') INSERT INTO test values(222,'g21','e') INSERT INTO test values(333,'a65','a') ...
Score Transfer Table Relationships
Mike Moore - 2 Dec 2005 8:27 PM - 2 messages
How can I transfer DB diagrams and referential integrity relationships between databases with the same structure. I copied dtproperties table from one DB to another but it copies diagrams without foreign keys. ...
Score CopyFile in DTS ActiveX Script Task
atchleykl - 2 Dec 2005 8:11 PM - 2 messages
I am trying to copy a file and giving it a name with a date behind it.  Below is my code I'm using in my DTS ActiveX Script Task.  I'm getting a "File Not Found" message on Line 25 (I marked it below).  Can someone see the problem ...
Score query help - "Most Helpful Review" idea
matt - 2 Dec 2005 8:05 PM - 9 messages
hello, i am working on a consumer-review website. in it, my users can write reviews for given products. in addition, other users can rate any given review as "Helpful" or "Not Helpful". how can i write a query to give me the "Most Helpful Review" ? meaning, ...
Score SQL Agent Mess
Mark - 2 Dec 2005 7:58 PM - 2 messages
Environment: SQL 2000 SP3a I have tired various things but not sure which route to go from now. I have a SQL Job which should be owned by non SA account as some of the members in the other team want to look at this job and by making this job ...
Score Hello, is there any intelligent life at M$?
noname - 2 Dec 2005 6:48 PM - 7 messages
I just installed the new MS SQL2005. I have been trying to get used to the new Management Studio. So, far I'm not impressed, albeit, I will admit I have not spent that much time with it. One of the first tasks ...
Score Endian problems with converting to varbinary
David Harris - 2 Dec 2005 6:15 PM - 7 messages
We are in the process of migrating from a DOS based binary file storage format to a relational database structure. However, for migration reasons we need to be able to export the relational data to the binary file structure for processing. I have accomplished this with a not-so-lightweight procedure ...
Score IDENTITY and Backup/Restore
Jeff - 2 Dec 2005 6:05 PM - 5 messages
SS2K: How to deal with IDENTITY property restore [from backup] situation? Specifically: table Foo has IDENTITY property which is also used as the primary key (yes, UNIQUE constraints are on the "real-world" key). Data entered on November 16 was deleted by user on November 20. It's now December ...
Score Help developing this project.
Star - 2 Dec 2005 5:58 PM - 16 messages
Hi, I'm about to start working on a new project and I would like to have some ideas from you guys. I already got an idea how to do it, but I'm not sure how good it is. ...
Score Finding the 2005 migration quite challenging
Richard K Bethell - 2 Dec 2005 5:43 PM - 7 messages
The first experiments we ran in the migration to SQL Server 2005 were quite successful. .NET written applications all worked pretty much flawlessly. However, when testing our most important internal application, we quickly discovered it did not do nearly so well. This is what we had done. ...
Score Merging tables
Kumar - 2 Dec 2005 5:17 PM - 4 messages
Hi, I had 3 tables Tets_06 Test_05 Test_04 I want to combine these 3 tables into one new table 'Test_combined' --I cant Use UNION ,bcoz the structure of the 3 tables is not same (Test_06 had two extra columns than test_04) ...
Score CLR Question (BASIC)
RSH - 2 Dec 2005 5:03 PM - 4 messages
I have Visual Studio .Net 2003...I am assuming that since it can't find System.Data.SQLServer that I need Visual Studio 2005 to develop CLR apps for SQL? ...
Score Connection Problem with Remote Server
Spike - 2 Dec 2005 4:58 PM - 2 messages
If I do this: select * from tblAmcareDetail I get my records back but as soon as try to specify column names I get: Server: Msg 207, Level 16, State 3, Line 1 [Microsoft][ODBC SQL Server Driver][SQL Server]Invalid column name ...
Score Inserting dummy lines and padding
Astra - 2 Dec 2005 4:46 PM - 3 messages
Hi All Can you please help me with a few queries on adding a header line and padding rows out. I apologise profusely for not providing the DDL for this, but I don't have it.  All I have is stored procedure that I'm trying to edit to make the ...
Score Newbie: Timeout On IN statement
Chuck - 2 Dec 2005 4:25 PM - 12 messages
I have a query which returns the Top 100 selling products for each of the 14 categories that we sell.  It takes 10 minutes to run, however.  Does anyone have a suggestion on speeding this up. SELECT     ProductID, CategoryID, Sales, Qty ...
Score How to get rowid of uncommitted record
Matt - 2 Dec 2005 3:58 PM - 6 messages
I have two tables - header, detail.  HeaderID appears in both, is an auto-incrementing rowID in the header table, and required also in the detail table.  It's a one-to-many relationship from the header table to the detail ...
Score Size of a row
Evan Camilleri - 2 Dec 2005 3:53 PM - 10 messages
How can I get (Programatically) the size of a row in a table in SQL stored procedure? Evan ...
Score DEADLOCKS
Gina Hernandez - 2 Dec 2005 3:34 PM - 2 messages
Hi: I have a .net web application and  I am getting a lot of deadlocks.   My system processes a lot of real-time transactions  daily.   In addition , there are like 3 DTS packages running.    The problem is that I am getting a ...
Score global temporary tables
HP - 2 Dec 2005 3:13 PM - 3 messages
When does a global temp table get dropped? i have a stored proc that creates a global temp table and inserts a record into it.say for eg. i run the stored proc first, the temp table gets created.if another user runs the stored proc ...
Score ReCompileReferences using System SP?
John Kotuby - 2 Dec 2005 3:08 PM - 3 messages
In SQL Server 2000 Online Help, the method ReCompileReferences (looks like C++ which I know nothing about) is mentioned. It causes recompilation "prior to the next execution" of any stored procedure on the referenced table. In a production system as part of the maintenance plan we reindex nightly. ...
Score Determining Roles from Windows Authenticated Login
richard.deyoung@gmail.com - 2 Dec 2005 3:01 PM - 1 message
I have a few database Roles that map to Active Directory groups.  Is there a way to determine from either system stored procedures or tables what Roles a logged-in user belongs to if the user is logged in with ...
Score Help with value
d4 - 2 Dec 2005 2:28 PM - 4 messages
Can someone please tell me the best way to handle this problem... I have the following SERVICES Server     Service -------       -------- S1          A,B,C,D,E,F ...
Score Connection string for 1 server and 2 databases
Bill nguyen - 2 Dec 2005 2:02 PM - 2 messages
Is there a way to access 2 databases simultaneously using a single connection string? server: SQLSERVER databases: gasstations customers I'm working on a VB.NET application. Thanks Bill ...
Score compatible ntwdblib.lib FOR ntwlib.dll in SQL Server 2000 SP4
Chandu - 2 Dec 2005 1:50 PM - 3 messages
Hi, I have a old VC++ application using DB-Library for connection with sqlserver 6.5. Recently I have migrated the sqlserver from 6.5 to 2000. during recompilation of the vc++ code, i have  a problem with ntwdblib.lib file. I ...
Score WHERE clause 'SET'
Amon Borland - 2 Dec 2005 1:40 PM - 5 messages
Is there an easier way to write the WHERE clause when the same column is compared over and over again?  I need to pull by 360 zip codes.  Instead of Where Zipcode = '12345' OR Zipcode = '54321' OR......and so on. ...
Score Design: bit on or off?
Lisa Pearlson - 2 Dec 2005 1:17 PM - 4 messages
I'm asking lots of design questions here.. but they are little ones, sometimes matter of taste, sometimes more than that. Imagine I have a table of "Keys". Some of these keys will be "active" and some will be "blocked". ...
Score SQL Query Help
Astra - 2 Dec 2005 1:10 PM - 1 message
Hi All Can you please help me with a few queries on adding a header line and padding rows out. I apologise profusely for not providing the DDL for this, but I don't have it.  All I have is stored procedure that I'm trying to edit to make the ...
Score I was wondering if....
Enric - 2 Dec 2005 1:05 PM - 1 message
Dear fellows, A couple of days ago, I asked if it was possible open a DTS from a external application such as Visio as if it were a conventional hyperlink. It might be very useful, going from there to DTS design screen. ...
Score attach db with a deleted log
Jason - 2 Dec 2005 12:31 PM - 2 messages
Hello, How can i attach a db where there is a log deleted. When i want to attach the db, i cannot click the ok button because a second log-file is missing. Anyway to work around this? ...
Score Database files (VS 2005) - usage?
Andrew Kidd - 2 Dec 2005 12:07 PM - 5 messages
I'm just getting to grips with the new SQL Database file concept in VS 2005 and have a couple of questions in the hope that someone can clarify my understanding. I understand that I can now add both the <dbname>.mdf and <dbname>.ldf files ...
Score Getting an unused number from a set of numbers?
Lisa Pearlson - 2 Dec 2005 11:57 AM - 18 messages
Hi, Imagine I have a set of numbers: 1, 2, 5, 6, 9, ....., 10000 I wish to fetch one number that IS NOT already in the set. I can do some kind of FOR/NEXT loop, taking id 1, checking if it already ...
Score Design: multiple columns for primary key
Lisa Pearlson - 2 Dec 2005 11:37 AM - 11 messages
Hi, A very basic question: Imagine I have a table with multiple fields, some strings, some integers etc. None of these fields are unique on their own, but all fields together is unique per record and thus can be used as the primary key. ...
Score EXISTS with EXEC
Evan Camilleri - 2 Dec 2005 11:28 AM - 3 messages
This works:     IF NOT EXISTS(SELECT qci_pk FROM tb_Qci WHERE qci_pk = @qci_pk) But since I may need to build the Sql statement I tried something like this, which did NOT work,     IF NOT EXISTS(EXEC('SELECT qci_pk FROM tb_Qci WHERE qci_pk = @qci_pk')) ...
Score one column causing duplicate rows - wrong join used?
Quackhandle - 2 Dec 2005 11:28 AM - 5 messages
Hi, Consider the following result set: PNID    PN_NUMBER    Date1        Date2    Status    PN_Name ================================================================ 27    2051        08 Sep 1941    NULL    Received   NULL ...
Score SQL Execution Error: Cannot call methods on int
rask - 2 Dec 2005 11:03 AM - 4 messages
I have run in to the following problem on MS SQL Server 2005: When I attempt to execute the following query in SQL Server Management Studio or Visual Studio 2005 Database project an exception is thrown. SELECT     CAST('2' AS INTEGER) AS Expr1 ...
Score Looping Query
Ivo - 2 Dec 2005 10:00 AM - 8 messages
I know I have done this before but for the life of me I can remember how' When I run the query below it loops and loops, how do I make it appear just once - missing something but brain freeze has taken over aaaggghhh.... ...
Score Date from datetime ...
Christian Donner - 2 Dec 2005 8:21 AM - 8 messages
Hello NG, we all know the problem of (date) equality checks on datetime fields preventing us from issuing a command like:    SELECT * FROM [MyTable]       WHERE [SomeDateField] = @SomeDateVariable As datetime contains time information down to the milliseconds this query ...
Score Status control of SQL Server Agent jobs
Christian Donner - 2 Dec 2005 8:19 AM - 8 messages
Hello NG, I need to start SQL Server Agent jobs frequently from my stored procedures by using the code fragment:    EXECUTE msdb..sp_start_job 'MyJob' If the job is still running though, I get flodded with (completely harmless but disturbing) error messages that tell me, that the job is running already. ...
Score CREATE VIEW w/ UNION
Patrick Rouse - 2 Dec 2005 1:52 AM - 4 messages
I have the following query that works fine when run manually, but I don't know how to create a view of the equivalent data.  When I uncomment the CREATE VIEW it errors out.  --CREATE VIEW vwCPA --AS ...
Score Login Failure with Linked Server
Lawrence - 2 Dec 2005 1:52 AM - 5 messages
Hi, I have both NT authentication on the two servers, and I'm getting the following error when I try to execute the statement: select * from Main1a.GondorMain.dbo.bds Error Message: Server: Msg 18452, Level 14, State 1, Line 1 ...
Score Syntax error converting datetime from character string.
GamingAngel - 2 Dec 2005 12:59 AM - 4 messages
Hi! I am new to this group, but I am running into a problem that I cannot seem to find a solution for. Table: The table is an Employee Health Table.  The field Last_PPD is a char type because the Nurses would like to put NA, or NC, or None in the ...
Score explanation needed - DECLARE CURSOR
cvetic - 2 Dec 2005 12:40 AM - 3 messages
hi! i need (preferably 0:)) short explanation about difference between declare cursor and declare cursor *with hold*. if i'm working in multiuser regime, and need to pay attention to locks, do i *have* to use declare with hold? -- cvetic ------------------------------------------------------------------------ Posted via [link] ------------------------------------------------------------------------ ...
Score char vs. varchar
Vern Rabe - 2 Dec 2005 12:31 AM - 5 messages
The company I'm contracting at has a guideline that table columns should be of type char if less than 20 characters, otherwise varchar. This guideline was just changed to a requirement. In my opinion, the choice between char and ...
Score Same process ID, multiple times
zdrakec - 2 Dec 2005 12:21 AM - 5 messages
Hello all: I have an application that uses threading to access my SQL Server 2000 database. It can produce, at most, 20 threads at a time. Yesterday and this morning, I was happily testing this app and it performed beautifully. Monitoring the threads via Enterprise Manager, Current ...
Score Whats Wrong with the Query?
vsr - 1 Dec 2005 11:52 PM - 10 messages
I am using this Query in application , its working fine with varchar column types when i use COLLATE in QUERY but its not working for Datetime columns types, any suggestions? SELECT TOP 10 * FROM #TempExt WHERE eFolderID NOT IN (SELECT TOP 20 eFolderID FROM #TempExt  ORDER BY service_requested ASC ...
Score CHARINDEX is not working
KL - 1 Dec 2005 11:33 PM - 8 messages
i am using the below code but its not working .. what could be the reason? CHARINDEX(@SPName,@DateAndIntCols) to CHARINDEX function i am passing to variables, cant i pass variables to CHARINDEX? ...
Score Automated Table Updates - Strategy Assistance Requested
Jeff - 1 Dec 2005 11:26 PM - 2 messages
I'm actually stuck! Can't believe it... so I'd appreciate some help. What I'm doing is enabling users of an ASP.NET 1.1 Web application to update a table in a SQL Server 2000 database. To make their life easier and to ...
Score multiple databases for multiple days
Johnny Ruin - 1 Dec 2005 11:22 PM - 9 messages
I'd like get some opinions on this matter before I go Godzilla in the next meeting. My application fills a database during the day, while a webservice reads from the data.   At the end of the day I update statistics, ...
Score TSQL Debugger Oddity
anon - 1 Dec 2005 10:09 PM - 9 messages
In query analyzer I wrote the code below. (Initially minus the debugging lines.) I had no problem running the create script. Then I went to debug with the TSQL Debugger. No matter how I tweaked, the debugger would only insert to the ...
Score Combining archive tables into a single table
Kumar - 1 Dec 2005 9:55 PM - 8 messages
Hi, I had a table in my database which will update every month ... so we used to update the table every month and stored the archieve tables in a seperate database. --ID is the primary key for this table and all historical of the record will ...
Score random numbers of param
Pohihihi - 1 Dec 2005 9:49 PM - 13 messages
How can I pass random amount of params in a SP? ...
Score DTS Connection Properties
RSH - 1 Dec 2005 9:47 PM - 1 message
I have a VB DTS Script I created that uses SQL Authentication as illustrated in the code below: 'SQL dts connection     ConnectionIndex = ConnectionIndex + 1     Set oConnection = oPackage.Connections.New("SQLOLEDB")     oConnection.ConnectionProperties.Item("Persist Security Info").value = ...
Score still problem with image
JFB - 1 Dec 2005 9:25 PM - 7 messages
Hi All, I have a problem storing a binary image coming from an xml file. The image has 39,000 characters. I my table I define the field as image but only store 0x. What is the problem? I try to store as text and doesn't work either, if I try varchar it works ...
Score Subscription error: The report is using user defined parameter va
Chris Patten - 1 Dec 2005 9:18 PM - 1 message
I have a simple report that is using one paramater.  I do have the default defined in the report builder, I did not set it in the published report.  When I try to create a subscription I get the following error.  Any ideas? ...
Score Sql Query
Mel Weaver - 1 Dec 2005 9:04 PM - 4 messages
Hello,      I have a vehicle database 100,000 records with  Year, Make, Model, Body,Vin, SRP text fields.  What I would like to do, is delete duplicates records with the lowest SRP field, example below.   Looking for any ...
Score SELECT question - need help
Dr Van Nostrand - 1 Dec 2005 8:45 PM - 4 messages
In SQL Server 2000: I have two tables. The first has user information in the form: UserID | Fname | Lname |  State |  Zip 37  | Jim | Jones |  NY | 19040 38  | Tom | Fredrick |  PA | 88888 39  | Bill | Thomson |  CA | 99999 ...
Score MS SQL 2000 Query Help
SJ - 1 Dec 2005 8:40 PM - 6 messages
I have patient data - am interested in patients receiving a certain diagnostic procedure. Need to find out on an average in the group of patients I am analyzing, on which visit they receive this procedure. Suppose there is a consumer X, who visits doc A - on the 5th visit the doc ...
Score sysdtssteplog not updated
4herbert - 1 Dec 2005 8:28 PM - 1 message
Hi, I have a package updating correctly the progresscount column in sysdtssteplog when run. However when I start this package from within another package using an active-x-script task, the new line is created (as expected), the target table is filled with 458 records, but the ...
Score Newbie:UNION with SELECT TOP
Chuck - 1 Dec 2005 7:19 PM - 11 messages
I have been trying to query the Top 100 selling items for each category to be one result set...all day.  I thought that this should work... SELECT TOP 100 productid, categoryid, sum(sales) as [Sales] FROM dbo.Sales ...
Score historical lookup query
ThievingScouser - 1 Dec 2005 7:17 PM - 2 messages
I'm having a dickins of a time with a particular query and am hoping someone here can help me. Using the following example; declare @SearchDate datetime set @SearchDate = '30 Nov 2005' declare @t1 table (t1id int, t1desc varchar(10)) ...
Score SQL query help
Dr Van Nostrand - 1 Dec 2005 7:17 PM - 2 messages
I have the following SQL query: "SELECT Fname AS First, Lname AS Last, Email, Address, City, State, Zip, " +       "Company, Phone, users_surveys.Datefield as Date, " +       "CASE WHEN questionID = 1 THEN answer ELSE NULL END AS Reseller, " + ...
Score Scripting foreign key relationship on a table
Mike - 1 Dec 2005 7:15 PM - 2 messages
I have created a couple of new foreign key relationship on my table using enterprise manager. I want to script these changes and send it to my client so that they can update the relationships on their end. how can I do it? ...
Score Calculation in sql
fniles - 1 Dec 2005 7:09 PM - 3 messages
We have a Result table with fields called QuestionID and Answer. How can I get a query result where the result is group by the answer and its percentage ? Thanks. For ex: Results table: QuestionID    Answer 1                    aaa ...
Score Help With Stored Procedure!
Nomad - 1 Dec 2005 7:09 PM - 9 messages
Hi, This stored procedure isn't working and I'm not sure why.  ANy suggestions would be greatly appreciated. CREATE PROCEDURE dbo.[proc_update_urn] @case_id as int, @service_area varchar(3) AS begin declare @max_id int set @max_id = (select max(sd_s_id) ...
Score Setting the database to"'use" dynamically...
RSH - 1 Dec 2005 6:41 PM - 2 messages
I am scripting a stored procedure and I need to change the perspective to a database that was just created in the script...kind of like this: use master go @db varchar(50); begin create database @db go use @db -- DOESNT WORK ...
Score Simple select
Aleks - 1 Dec 2005 6:39 PM - 5 messages
What is this statement missing ? SELECT id FROM Cases WHERE  Cases.tempcaselogid = CaseComments.tempcaselogid I get this error: Server: Msg 107, Level 16, State 3, Line 1 The column prefix 'CaseComments' does not match with a table name or alias ...
Score Preparing db for update of 200K records...
Eric - 1 Dec 2005 6:39 PM - 7 messages
I'm in the process of encrypting my database and need to add a new column and then populate it w/an encryped string from an existing column.  While I've begun to do this in my testing environment, I've noticed my log file to grow ...
Score Date Logic for a DTS package
Patrice - 1 Dec 2005 6:25 PM - 2 messages
Hello, I need to facilitate updating a data warehouse table with a DTS package that updates an accounting table for premium amounts.  I will do a one time run of all the accounting records and after that would like to 'grab' just the ...
Score return a Scalar value...
Evan Camilleri - 1 Dec 2005 6:24 PM - 3 messages
How can I return a Scalar value by calling PROCEDURE 2 from PROCEDURE 1. Something Like: SET @nextDataVersion = EXEC(pr_GetNextDataVersion 2) (this does not work!) ...
Score Append / Insert Into Question
John 3:16 - 1 Dec 2005 6:10 PM - 8 messages
When appending data from one table to another... If the structure is the same, do you need to list all fields in the query insert into t1 ( f1, f2, f3 etc..) Select f1, f2, f3 etc from t2 Thanks in advance, ...
Score Update query
Aleks - 1 Dec 2005 6:01 PM - 3 messages
I have the following task, doing it by hand would take just an increidible amount of time, perhaps a query can be done to update an entire table ? This is the scenario. Table A has a field called "UserId", this will be my source "Id" ...
Score Update questions
J-T - 1 Dec 2005 5:55 PM - 4 messages
I have an update statement as follow: UPDATE T2 SET       T2.field1 = T1.field1,       T2.field2 =T1.field2 FROM table1 T1       JOIN  table2 T2 ON T2.TAG_ID = T1.TAG_ID ...
Score Update a SQL table from an Access table?
Jason - 1 Dec 2005 5:50 PM - 3 messages
I've got data that was imported from an Access database into a SQL database. I've found the import didn't populate one field it should have, so would like to now update that field by linking the two DB's and running an update ...
Score truncate table thru a link server
culam - 1 Dec 2005 5:42 PM - 2 messages
I have 2 tables with 500K and 1Million records and need TRUNCATED/LOADED daily. I cannot truncate thru a link server. Ex. TRUNCATE TABLE linkedServer.DBName.dbo.tablename I am forced to use a DELETE command, but it takes too long.  Does anybody ...
Score Merge Replication
skg - 1 Dec 2005 5:35 PM - 2 messages
I am receiving following error while doing merge replication between sql2k5 sql servers. Can any one suggest what iam doing wrong. TIA Message 2005-12-01 17:33:01.528 [26%] [0 sec remaining] Applied script 'Customer_2.cft' 2005-12-01 17:33:01.731 {call sp_MSsetconflicttable (N'Customer', ...
Score Script to delete all objects
Michael Tissington - 1 Dec 2005 5:33 PM - 2 messages
Can anyone point me to script to delete all objects owned by a user before I delete the user from a database? Thanks. ...
Score Is it not possible to use UPDATE within a function?
Evan Camilleri - 1 Dec 2005 5:30 PM - 7 messages
Is it not possible to use UPDATE within a function?  I get the following error message for the following function: Evan - - - - - - - - - - - - - - Server: Msg 443, Level 16, State 2, Procedure fn_GetNextDataVersion, Line 10 Invalid use of 'UPDATE' within a function. ...
Score Criteria = Most Recent Date?
Jonathan Lecht - 1 Dec 2005 5:25 PM - 7 messages
I'm not a coder type (yet) and well I'm trying to use Enterprise Manger to produce a report from 2 tables. Bottom line is I'd like to return a row for only the most recent date. Does anyone have some example code for selecting the most recent date? ...
Score store image
JFB - 1 Dec 2005 4:55 PM - 12 messages
Hi All, I have a problem storing a binary image coming from an xml file. The image has 39,000 characters. I my table I define the field as image but only store 0x. What is the problem? I try to store as text and doesn't work either, if I try varchar it works ...
hi
Next »