Home All Groups Group Topic Archive Search About

SQL Server database programming

microsoft.public.sqlserver.programming
Score The case of the inadequate case function
Daniel Manes - 31 Dec 2005 10:05 PM - 23 messages
In most programming languages, there is a way to branch your code in multiple directions depending on the value of some switch variable. My situation right now is that I have a variable, @PostType, that determines which stored procedure should be called. I tried to use the ...
Score Appending Text to a SQL Text Data Type
bobnunny - 31 Dec 2005 8:19 PM - 3 messages
I am trying to use a cursor to create a mass Text field with the results from the selections from a series of VarChar(8000) values.  I know I need to use UpdateText, but it only seems to store the 1st one it reads.  Can anyone help? ...
Score How to fetch AutoANSIToOEM, RegisteredOrganzation, etc. in SQLServer?
Mark Findlay - 31 Dec 2005 7:23 PM - 2 messages
I have both default instances and named instances of SQLServer. My reporting program is able to read the AutoANSIToOEM, RegisteredOrganization and UseIntlSettings properties from the registry under the HKLM\SOFTWARE\MICROSOFT\MSSQLSERVER\Client\DB-Lib key - but only for the DEFAULT instance. ...
Score SELECT Min Date
Scott - 31 Dec 2005 6:09 PM - 4 messages
My below code selects the last 10 days of data from Northwind, how can I set that variable to the min date or dtStartDate variable? To be clear, my results below are fine, however, I need a SET dtStartDate = "The min date that below CODE is using as it's start date where criteria." ...
Score T-SQL 258 XML Iteration Boundary?
LvBohemian - 31 Dec 2005 5:47 PM - 10 messages
T-SQL 258 XML Iteration Boundary? Here is the scenario… I have to get a set of particular records for a particular time frame in a MSSQL 2000 table, then I have to pass them one at a time to a web service ...
Score HAPPY NEW YEAR !!!
john - 31 Dec 2005 3:50 PM - 1 message
HAPPY NEW YEAR !!! Hello friends, I´m Happy !!! I ordered the programm and it really functions. I EARNED OVER 850 DOLLAR IN ONE WEEK !!!! READ THIS: For everyone, who needs really money. Are you on the search for a lucrative source of income?  Would you like to ...
Score SELECT INTO PROBLEM
Savas Ates - 31 Dec 2005 2:08 PM - 4 messages
I have two tables.. They are both identical.. I want to select some fields from one and insert to another one. How can i do it ? SELECT urunadi INTO  [AlisverissaatiXML].[dbo].[urunler]  FROM [Kangurum].[dbo].[urunler] WHERE urunadi='ROMANSON PHIL MEETY' ...
Score MD5 Hashing rows?
Edgars Klepers - 31 Dec 2005 9:06 AM - 7 messages
I'm trying to implement some sort of security checking against database modification.   I'm thinking to store a list with Hash values for row sets. i.e.   [pseudocode] byte[] returnHash = MD5Hash( SELECT stuff FROM database WHERE junk ) ...
Score SID to dotnet SecurityIdentifier
Edgars Klepers - 31 Dec 2005 9:00 AM - 5 messages
From my research, SID's are supposed to be stored in an SQL database as a varbinary(85). What is the best way to translate the SID to the dotnet 2.0 SecurityIdentifier type?  I am working in C# but can probably translate VB code over as well if that ...
Score performance problem
Roy Goldhammer - 31 Dec 2005 8:56 AM - 2 messages
Hello there I have table with more then 30,000,000 records. When i do simple select on 3 fields who are indexes, i see on the execution plan 90% on bookmark lookup. What can cause this? ...
Score Cursor is the only choice?
Frank Lee - 31 Dec 2005 6:38 AM - 9 messages
If I want to do a process in a sequence order, is Cursor my only choice? for example, ------------------------------------------------------------ declare @ID uniqueidentifier declare MyCursor cursor local for select id from table where created>thedate order by created for read only ...
Score insert a un-ordered data to a clustered indexed column, what would happen?
Frank Lee - 31 Dec 2005 6:13 AM - 3 messages
Q1, If a column is clustered indexed and there are more than 500000000 records in the table.  Now, if I insert a data which should be inserted to about the 10th location according to the clustered index, what would happen? ...
Score Union duplicates
tshad - 31 Dec 2005 2:08 AM - 5 messages
If I have 2 tables (actually it would be the product of multiple joins) and I am getting the same data out of both tables and unioning them, how would I say if a person was in both tables I only wnat the data out of table x. ...
Score Storing Richtextbox data In Sql
den 2005 - 30 Dec 2005 11:31 PM - 13 messages
Hi everybody,    What is the datatype in sql for storing  data from RichTextbox? How do I create a sql Insert statement for this data? The data has format like indentation, Butted list, Font Style and others. Thanks. ...
Score need to know the detail about cursor.
Skywalker - 30 Dec 2005 10:51 PM - 5 messages
Hi, I have a Table1( C1,C2,C3) DECLARE T1_cursor CURSOR FOR SELECT C1,C2 FROM Table1 WHERE C3=1 Tabel1 has multi-millines records. Say if the snap-shot of the T1_cursor has 10000 records when the cursor start running (Fetch), I add more records to ...
Score Stored Procedure Output Parameter Woes
Denis - 30 Dec 2005 10:19 PM - 4 messages
I have written a stored procedure with several output parameters. eg @Vendor bit OUTPUT When I execute this stored procedure via query analyzer it thinks I have declared this as input/output. Is this a feature or is there something ...
Score CAN'T SOLVE SELECT GROUPING WITH MAX FUNCTION
rlueneberg - 30 Dec 2005 10:10 PM - 8 messages
Here is the scenario ACCOUNT       CONTACT           DATE account A    CILXFA000HJ6    4/6/2005 16:05 account A    C15467XXXXXX    7/27/2005 12:22 ...
Score T-SQL does not support breakpoint Conditions
LvBohemian - 30 Dec 2005 9:00 PM - 2 messages
When attempting to select the breakpoint condition from within the VS05 RTM IDE I get the following error message: "T-SQL does not support breakpoint Conditions" What's up with that? Also, why the heck would you not be able to debug TSQL from "SQL Server ...
Score Scripting of database objects in SQL 2005
Edward - 30 Dec 2005 8:28 PM - 4 messages
I've written scripts to generate the tables, functions, indexes, keys, views and stored procedures but I can't find any information for triggers.  The sys.triggers table contains no entries even though I've created a trigger.  ...
Score Case in Join
tshad - 30 Dec 2005 8:10 PM - 9 messages
Can you put a Case statement in a Join? My problem is that I have 2 possible fields I want to join to the same table.  If one is null, use the other. For example: Create Table Position (     UserID1 int, ...
Score how to install multiple instances of Reporting Services?
=== Steve L === - 30 Dec 2005 7:39 PM - 2 messages
background: sql 2000 with reporting services 2000. from reading the MSDN, looks like one can install multiple instances of reporting services 2000 on the same machine (for qa testing and production and so on), but when I started the reporting services 2000 ...
Score Design Question - SQL 2000 to 2005 App Upgrade (CLR?)
Craig S - 30 Dec 2005 7:32 PM - 4 messages
I'm upgrading an app I wrote from SQL 2000 to 2005 looking for some high-level design advice, just to determine how much should be T-SQL vs. CLR, and the best approach to take for performance.  For background, I'm a ...
Score Field value determines whether there is extra info that should be held about that record
Amir - 30 Dec 2005 5:14 PM - 17 messages
Hi, I would like to have your advice in a little DB design issue. I'll try to demonstrate it by an example: Guess I have DB to hold information about rooms that are in a house. Each record represent a room, and has many fields like: width, height, wall color ...
Score Picture insert
vul - 30 Dec 2005 4:34 PM - 2 messages
Access allows to insert manually an image into OLE Object type field very easy. I was wondering if there is a simple way to insert an image into image type field in SQL Server using Enterprise Manager (not programmatically) Thank you ...
Score five connection limit
Igor Solodovnikov - 30 Dec 2005 4:10 PM - 3 messages
Hi! Everybody know that MSDE (based on SQL Server 2000) has five-connection  limit after which its performance degrades. Do SQL server 2005 Express  edition also has five-connection limit? Or this limit was dropped? ...
Score Profiler event class question
SSM - 30 Dec 2005 2:52 PM - 3 messages
When capturing tuning data in SQL Profiler, what are the key differences between event classes 10 (RPC Completed), 12 (TSQL Batch Completed), and 45 (SQL Stmt Completed)? ...
Score getting per case info from 1:n related case and log table fast
zu - 30 Dec 2005 2:48 PM - 5 messages
I neeed to search through the CASE table and get all records with case created between two dates. A lot of info is in related tables and the case table only has the id. So there are quiet some Joins, but that's not the big ...
Score Changing capital letters
Roy Goldhammer - 30 Dec 2005 1:20 PM - 1 message
Hello there is there a simple way to change first letter on string to capital letter? ...
Score sql statement formatting
bringmewater - 30 Dec 2005 1:17 PM - 18 messages
What is a good way to format this nested sql statment?  Are there any good sites showing other examples?  Thanks ! SELECTMerchandise.Description, Users.Name FROMUsers INNER JOIN (Sales INNER JOIN (Merchandise INNER JOIN Types ON Merchandise.TypeID = Types.TypeID) ON Sales.MercID = Merch andise.MercID) ON Users.UserID = ...
Score change first letter to capital
Roy Goldhammer - 30 Dec 2005 1:13 PM - 1 message
Hello there Is there a simple way to transfare the first letter on string to Capital? for example roy = Roy ...
Score I LOVE THIS JOB !!!
I LOVE THIS JOB !!! - 30 Dec 2005 12:37 PM - 3 messages
I LOVE THIS JOB !!! For everyone, who needs money. Are you on the search for a lucrative source of income?  Would you like to work of at home out of, without yourself you someone makes directions?  Would you yourself like to ...
Score Using input parameters differently for different values
Mark Rae - 30 Dec 2005 12:09 PM - 5 messages
Hi, I have the following table in SQL Server 2000 which contains accounting ledger data: ACCNT_CODE varchar(10) ACCNT_NAME varchar(50) ACCNT_TYPE char(1) TRANS_DATE smalldatetime PERIOD int D_C char(1) AMOUNT numeric The PERIOD field indicates which accounting period the record belongs to - ...
Score Mapping from flatfile to SQL server database...
Christian Johansen - 30 Dec 2005 10:22 AM - 3 messages
Hi! Im trying to find existing software to map from flatfiles (mostly .txt) to a database running on MS SQL Server. The files are recieved by mail, and made available to my program, and are supposed to be read and processed in a way ...
Score AntiVirus Software
Lan - 30 Dec 2005 9:57 AM - 5 messages
We have McAfee VirusScan installed on our database server. I would like to configure the system not to scan *.bak, *.mdf, *.ldf.  My question: 1. Is this the right configuration ? 2. By doing so, any potential security breach ? 3. By doing so, will the SQL box performance improve a bit? ...
Score Log File Error
Ricky - 30 Dec 2005 9:50 AM - 6 messages
Good Morning We have a nightly DTS job, which uploads data, to a number of tables (35 tables).  However the DTS job failed last night, due to the following error returned : **** Error Source: Microsoft OLE DB Provider for SQL Server ...
Score handling parameters that could be missing
jonefer - 30 Dec 2005 8:13 AM - 7 messages
I have a search app that I'm developing in ASP.NET It has 5 parameters MRN, Name, Sex, DOB, SSN All or any combination can be used. what is the best way to handle the non-supplied parameters? i.e. if the user selects only supplies 'Name' and 'MRN' ...
Score SQL Server locking
Abhay Sobti - 30 Dec 2005 7:18 AM - 8 messages
Hi friends, I have an issue here. 1. Two users are adding Slips [vouchers] from two different terminals. 2. The Slip numbering scheme goes as follows : TR/00001 , TR/00002.... and so on. 3. When these two users click on the SAVE button simultaneously , the ...
Score Query
Manoj - 30 Dec 2005 6:26 AM - 2 messages
Dear All I have a query is:- select A.AllocatorId,a.CustomTypeId,a.CustomId,a.ScopeTypeId,a.ScopeId,a.ActivityTypeId,a.PriorityId from allocation a Out put is AllocatorId CustomTypeId CustomId    ScopeTypeId ScopeId     ActivityTypeId ...
Score How to get the Column Name of primary key of a table?
Frank Lee - 30 Dec 2005 5:17 AM - 3 messages
How to get the Column Name of primary key of a table? Thanks. --Using SQL 2005 dev ...
Score Trouble using sql IN statement with list of datetimes
JavaJeff@gmail.com - 30 Dec 2005 3:25 AM - 4 messages
I would like to pass in a list of dateTime stamps in a nVarChar parameter like so: --Example input data: '2005-12-21 15:55:26.053, 2005-12-21 15:41:35.600, 2005-12-21 15:23:21.647, 2005-12-20 19:15:27.180' ...
Score network error
tin - 30 Dec 2005 2:58 AM - 1 message
hi all, i am having a clr table-value function that gets a web page and parse some integer values, then populates an ArrayList, which will be exposed as a table.  it was fine, it would returns a table with one column, populated with some ...
Score Use of NULL and DEFAULT
Gerard Marshall Vignes - 30 Dec 2005 2:16 AM - 9 messages
I have a rule of thumb which I would like to get opinions about. RULE: Provide Data or Go Meta SCOPE: Designing SQL Tables, UDFs and Stored Procedures MEANING: A good database design will restrict the occurrence of NULL. An ...
Score Need to Execute SQL Script after SysPrep or after first boot
Scott Townsend - 30 Dec 2005 12:51 AM - 3 messages
I'm ghosting a few classroom machines that have a SQL server on them.   We are using one base image and pushing it out to 12 machines. I'm looking for an automated way to execute the sp_dropserver and ...
Score Using Case Conditions in WHERE clause
HP - 29 Dec 2005 9:06 PM - 8 messages
Can i use case conditions in where clause? does it affect the performance? eg. select fldnames from table where type = case when @ctype = '1' then 'quote' else 'order' end Thanks ...
Score SQL Server :
Sirisha - 29 Dec 2005 8:31 PM - 5 messages
Hi,   I have created a table valued user defined function CREATE FUNCTION Testting (@labrunid int)     RETURNS TABLE AS RETURN     (         SELECT    *          From  labruns ...
Score Select Calculations
Vishal - 29 Dec 2005 7:57 PM - 4 messages
Hi, I have a problem here, please help me I am sure it can be done but just can't figure out how. The table structure is something like this : ID           Store_id      Year        Month        Sales ...
Score Developing CLR Objects - Visual Studio Requirements?
Craig S - 29 Dec 2005 7:14 PM - 8 messages
I have SQL 2005 Express & Visual Studio 2005 Standard on my XP workstation, and SQL 2005 Standard installed on my Win2k3 server.  I can't find anywhere on either system's VS installation the option to create a new Sql ...
Score Record locking within a stored procedure
G18LLO - 29 Dec 2005 7:03 PM - 14 messages
Hi I'd like to be able to lock a record in a table, row locking, update some fields, then release the lock when finished. I'd also like to be able to attempt the row lock for a specified amount of time, if, for example, another ...
Score How to decide whether trigger is a good idea?
dotnetlover - 29 Dec 2005 6:43 PM - 9 messages
Can any one give me some TIPS to decide whether trigger is a good idea or not, i have one table say TABLE1 and wanted to create update trigger on this table which updates data in another table say TABLE2 , the update statement ...
Score SCHEMA - primary key - SQL problem
Jeff User - 29 Dec 2005 6:03 PM - 4 messages
Hi I posted this in another group and got no reply. Hope someone here can help. Perhaps this is more of a SQL programming issue than a schema or PK  issue, as the actual problem is duplicate records: I have reviewed previous posts about finding primary key, table schema ...
Score Transform while Importing Data
gwomick - 29 Dec 2005 5:43 PM - 6 messages
I have a flat text file containing phone numbers. They are formatted as ###,####### and I would like change it to ###-###-####. What SQL statement would I need to use? Thanks for the help. ...
Score if condition and batch statements
sqlster - 29 Dec 2005 5:30 PM - 8 messages
Is it possible in tsql ? How can I do the following? if ( 1 = 1) begin       print 'condition was true'       return --exit the script completely -- how do I do that??? end ...
Score NewBie Question: SQL Server AddNew and ASP
mac - 29 Dec 2005 5:12 PM - 3 messages
I'm new to VBscript and SQL Server.  I want to add a row to a SQL Server table.  I establish the database connection.  I set up an recordset.  I then Open the recordset.  At this point I get an error.  Is this because I must ...
Score Question about the best way to relate some tables.
Star - 29 Dec 2005 4:55 PM - 6 messages
Hi, I am creating a database that contains persons, vehicles, addresses and some other information. A person may have several addresses. The same with vehicles. That's why I'm going to put all the information in different tables. I don't store ...
Score dts to update table
helpful sql - 29 Dec 2005 4:42 PM - 2 messages
Hi,    I am writing a dts package to update a sql table using data in a csv file. I know that dts updates all mapped columns regard less of the column's value has changed or not. I need to perform a special action when dts ...
Score Service Broker Error : Cannot find the remote service
SQLpro - 29 Dec 2005 4:41 PM - 3 messages
Hi there, quite a long script to make a complet internal example of SB... This test is made on ONE PC with 2 instances... At the end, I have the error message in the title (copy at the end of the ...
Score Help with cursor and decimal values
Ram - 29 Dec 2005 4:32 PM - 4 messages
The following table when using a cursor gives 0 for decimals where the values are below 1. I am trying to use this to apply a factor and always get a zero if the factor below 1, as a result my logic fails. ...
Score data import question
helpful sql - 29 Dec 2005 3:51 PM - 3 messages
Hi, I am writing a script for a client to update TableA using the data in TableB. I know how to write an UPDATE query to do this. But the client wants an ability to add or remove fields that they update using this script. I ...
Score Long running DTS package
Patrice - 29 Dec 2005 3:28 PM - 3 messages
Hello, I have a DTS package that took 52 hours to run.  Within the package is a task that runs a sproc which is a procedure to calculate premiums recvd and has to run through over 2 million records.  The procedure uses a cursor to ...
Score bulk insert problem
Kevin - 29 Dec 2005 2:22 PM - 4 messages
hi guys,  I have a data file that I like to import to a table. the column delimiter is @,  row delimiter is \n, line feed. But here is the problem, we have a column called "comment", basically user can enter any characters to it,  so if "comment" column ...
Score design question
ChrisR - 29 Dec 2005 2:20 PM - 6 messages
For the record, no I dont have a ton of design experience. So in advance please forgive my ignorance on this matter. If I was an expert I wouldnt need to post questions here. I have been tasked with redesigning some of our DB's. ...
Score compare '002' and '00²'
Gene Vangampelaere - 29 Dec 2005 1:39 PM - 10 messages
does anyone knows why '002' = '00²' in sqlserver 2000 ? create table Test2 (veldnaam varchar(10),veldnaam2 varchar(10)) go insert into test2 values ('002','00²') go select * from Test2 where veldnaam=veldnaam2 I did not expect to find a record ! ...
Score Limitation of sql standard
Roy Goldhammer - 29 Dec 2005 1:12 PM - 5 messages
Hello there In one of my clients who have SQL Standard has past the 2Gb data file. In this office there are approxsimatly 80 users Since then a lot of problems have happened in the database: 1. tables are locked more often and we need to reset the sql server at least ...
Score Database Table special permissions
Maria Bravo - 29 Dec 2005 12:41 PM - 2 messages
Hi, I would like to know if is there any way to create a database table which I don´t want to allow new entries, just modifying existing records. Something like the private SQL tables. I don´t want any user with privileges to insert ...
Score Help with xp..sendmail needed!
Damon - 29 Dec 2005 12:11 PM - 7 messages
Hi, I keep getting the following error in my SP which I can't seem to resolve:- Server: Msg 18031, Level 16, State 1, Line 0 xp_sendmail: Could not resolve recipient If anyone has any ideas why this is happening it would be greatly ...
Score Determine Nearest Day
DylanM - 29 Dec 2005 12:11 PM - 5 messages
Hi, Users of an application can retrieve sales between 2 dates that they pick in the front end (DateFrom & DateTo) I have sales data that these values will be used to query, the data is always summarised to the Sunday of each week. ...
Score Deadlocks
Yaniv - 29 Dec 2005 10:43 AM - 4 messages
Hi, I have recently directed a query that used to run on my main server to another server that is a Pull Subscriber to a Transactional Replication from the main server. I now face deadlocks from time to time when the query is being run. The ...
Score Help with stored procedure!
Damon - 29 Dec 2005 10:33 AM - 2 messages
Hi, I keep getting the following error in my SP which I can't seem to resolve:- Server: Msg 18031, Level 16, State 1, Line 0 xp_sendmail: Could not resolve recipient If anyone has any ideas why this is happening it would be greatly appreciated.  My SP is below for reference. ...
Score Row based security
Leila - 29 Dec 2005 9:37 AM - 6 messages
Hi, Are there any new feature for restricting users access to particular rows in SQL Server 2005? Thanks in advance, Leila ...
Score diff between CPU time and elapsed time?
j.santosh.shenoy - 29 Dec 2005 9:16 AM - 4 messages
Hi, What is the difference between the CPU time and the Elapsed time as seen in the TKPROF results? Thanks, Santosh ...
Score interval dates
JTL - 29 Dec 2005 8:44 AM - 6 messages
i want to create a user-defined function that accepts 2 dates and returns the time difference in days, hours, minutes, and seconds- for example, a possible result would be something like: 2 days, 17 hours, 46 minutes, 12 seconds ...
Score Evaluation of conditions
Lalit Bhatia - 29 Dec 2005 8:34 AM - 11 messages
I have a Join condition like Select columns From Table1 T1     Inner JOIN Table2 T2         ON T1.col1 = T2.col1 Or T2.Col1 Between T1.Col1 and T1.Col2 In table1, I have two cols that store some string range values. Col1 can ...
Score Suggestions / direction on learning SQL Server 2005 ?
Chris Smith - 29 Dec 2005 7:39 AM - 2 messages
While I am not new to databases by any stretch of the imagination, to say "newbie" in regard to SQL Server 2005 is a gross understatement. And TSQL is proving to be a bit more challenging than anticipated. Don't try to "it's ...
Score SQL Server 2000 and SQL Server 2005 - Installation issues
Raja - 29 Dec 2005 7:17 AM - 3 messages
How to configure SQL Server 2000 as default instance, while having installed SQL Server 2005 beta, on the same server? As, VS Team suite needs SQL Server 2005 as a default instance. But, my application needs SQL Server 2000 as a default instance. If not possible, ...
Score how to write query for rownuber in alphabet
jaffar - 29 Dec 2005 6:04 AM - 3 messages
sir,       i have a doubt related to rownumber,in my application i want to use the row numbers in alphabets, i know how to print the rownumber in numeric but i want in alphabet for example ...
Score For Xml Auto Help
Kevin Thomas - 29 Dec 2005 2:34 AM - 4 messages
In sql 2005 if I have a query along the lines of: select * from myTable for xml auto, elements xsinil, root('myRoot') I will get back one row, one column, filled with a nice xml string. The problem I'm having is figuring out how to access that data, such that I ...
Score Block row from been updated
Lina Manjarres - 29 Dec 2005 1:16 AM - 12 messages
I need to block some rows from being updated using mssql 2000. this is because some users are changing data after the product has been factured. The VB program does not let any body to change the data but some advanced ...
Score column data types?
Les Stockton - 28 Dec 2005 9:56 PM - 3 messages
I know there's a way to query the schema, but don't recall exactly.   Does anyone know how to query the database to determine the field type, length, precision, scale, etc? ...
Score complex and large triggers
Gerard - 28 Dec 2005 9:22 PM - 26 messages
If a business scenario related to data gathering for statistical analysis merits large complex triggers. Thes triggers pre-populate tables with data based on gathered business rules and make use of nested stored procedures and cursors. What is then good ...
Score SSIS 05: load excel data from sharepoint doc library
Trent - 28 Dec 2005 9:07 PM - 1 message
An excel file is located on a sharepoint site's document library, like: [link] When I access the file from IE, I need to type domain name, username and password. Customers will change myexcel.xls periodically from the sharepoint site, ...
Score Apostrophes and Dynamic SQL
Scott Heffron - 28 Dec 2005 8:56 PM - 10 messages
I am trying to Ad-hoc query from a user input(internal app), where the user enters in a name just as "Al's Game Crazy".  Each time I do this, the Apostrophe gets in the way.  I have tried using the "char(39)" setup for with ...
Score Table design question on LARGE table
Michael - 28 Dec 2005 8:50 PM - 8 messages
Hi Everyone, I have several tables in a current DB app I'm working on that contain over 120 fields. I'm looking for suggestions to cut down the number of fields that I need. I know that most fields will not be affected by my redesign, but I ...
Score help in writing dynamic sql query
Kumar - 28 Dec 2005 8:46 PM - 2 messages
Hi, I got most of this code from somewhere else on the net to compare two tables ...iam just trying to customize it to my requirement. Here I want to compare table1(new),table2(old) to find out whats the new ...
Score Query help
Confused - 28 Dec 2005 8:41 PM - 8 messages
I need a grouping and I'm not quite sure how to group it...an example of my current query and the returned data is below.  After that is more detail about how I need to group it.  Thank you! ...
Score inserted in dynamic query
helpful sql - 28 Dec 2005 8:02 PM - 2 messages
Hi,    Is it possible to use inserted or deleted tables in a dynamic query in a trigger? Thanks. ...
Score linked server and pipe delimted file
sqlster - 28 Dec 2005 7:31 PM - 10 messages
I have can query a comma delimited file in query analyzer easily. Content of mytest1.csv file on txtsrv21 linked server is as follows /* c1,c2,c3 11,12,13 22,33,44 55,66,77 88,33,12 */ When I run the following select: ...
Score If Else If condition failing
tsigler - 28 Dec 2005 7:18 PM - 6 messages
This is only the second stored procedure that I've written, and I'm having some issues with a conditional statement that I can't figure out.  The statement has a conditional If statement with two Else If's ...
Score producing a date time report in SQL/DTS
Blasting Cap - 28 Dec 2005 6:26 PM - 3 messages
I have need to produce a report (excel sheet actually) from SQL that would run each Tuesday and each Friday of every week. What needs to be on the Tuesday report is everything that came in from the Friday midnight time, until the Monday midnight time.  The friday ...
Score Execution Plan
Ed M - 28 Dec 2005 5:55 PM - 6 messages
Is there a way to remove the database name and ".dbo" from the object name in the execution plan? I almost never do a cross database join, and all tables are owned by dbo. Since there is limited room, I'd much rather see the full ...
Score Using a Join Twice to the Same Table Within a Select Statement
RitaG - 28 Dec 2005 5:51 PM - 2 messages
Hello. I have some SQL statements that are working but I think there has to be a more efficient way to accomplish what I'm trying to do. I have two different columns in a table (SuperMatch) that need to find a ...
Score Indexes & "OR"
Rafael Chemtob - 28 Dec 2005 5:48 PM - 3 messages
Hi, i have 2 tables: table 1 - called Feed.  contains the following fields: productName PartNumber ManufacturerName PartNumberManufacturerName  (this field concatenates the part number field and the manufacturer name field). Table 2 - called Products.  contains the following fields: ...
Score Best Data Type for a Tracking ID?
Mark S. - 28 Dec 2005 5:27 PM - 8 messages
Hello, We're in the table design process and could really use outside thoughts on our options. The table in question will grow to several million records. This table will update and insert depending on what the tracking ID does as it lives out it ...
Score Using Uniqueidentifier in a string
janne - 28 Dec 2005 4:52 PM - 6 messages
Hello, I'm trying to do something like this: CREATE PROCEDURE my_proc(    @id uniqueidentifier, @string varchar(100)) AS EXEC('SELECT something FROM somewhere WHERE table.id =' +@id) I need to have it in a string because I'm using variables for ...
Score Any harm in adding a primary key...
Eric - 28 Dec 2005 4:25 PM - 10 messages
after my table has been created and populated with data?  I have an identity column (named 'CID') on my customers table.  This value is often used in my queries and I'd like to take advantage of a ...
Score Server Memory usage\Performance problem
Magnus Österberg - 28 Dec 2005 3:08 PM - 4 messages
I am experiencing the following problem; I boot my Windows 2000 sp#4 machine to get a fresh machine. The hardware is Pentium 4, 3 ghz with 512 mb RAM. There are no other heavy applications running on the machine. ...
Score Saving Store procedure on table
Roy Goldhammer - 28 Dec 2005 2:53 PM - 4 messages
Hello there I have some store procedure that return query as result. Is there a way to store the result in table? ...
Score Problem executing stored procedure to update all rows of a table
Jack - 28 Dec 2005 2:49 PM - 5 messages
Hi, I got a stored procedure which interacts with the pubs database. The following is the code for the stored procedure: CREATE PROCEDURE usp_UpdatedPrices_para @Type char(12)= '%', @Percent Money AS UPDATE titles SET Price = Price * (1 + @percent/100) WHERE Type = @Type ...
Score INSERT multiple rows with same data
Daniel Löliger - 28 Dec 2005 2:08 PM - 5 messages
Hello, I was wondering how I can do this the best way. Source table: CREATE TABLE [dbo].[MaterialInventory] ( [MaterialInventoryID] [int] IDENTITY (1, 1) NOT NULL , [Serial] [nvarchar] (15) , [BuyPrice] [float] NULL , [BuyValue] [float] NULL , [BuyDate] [datetime] NULL , [DateOut] [datetime] NULL , ...
Score listing non system databases
Brian Henry - 28 Dec 2005 2:01 PM - 5 messages
I know sp_databases can list all the databases, but how can i only list non-system databases? I just want to get a list of user databases ...
Score detect and solve deadlocks
Vikram - 28 Dec 2005 12:57 PM - 6 messages
Is there any way by which deadlocks can be detacted and then appropriate action can be taken (in vb.net code or sql) to avoid it. instead of throwing error we can revoke the sp call.. thanks ...
dfg
Next »