Home All Groups Group Topic Archive Search About

SQL Server database programming

microsoft.public.sqlserver.programming
Score Grant Execute!
Mr Ideas Man - 4 Mar 2006 11:59 PM - 4 messages
Hi all, One of my workmates has acciddently changed the EXECUTE permissions for my main login. Is their a System stored procedure or something i can do to give Execute permissions on all stored procedures in my DB to a particular user, without having to do each procedure individually. ...
Score Compare Dates
Niclas - 4 Mar 2006 11:21 PM - 5 messages
Hi, I have a datetime SQL column wich contains a timestamp from when the row was added using the GetDate() function. I would like to retrive rows based on a comparsion of the date part of this value (discard the hours,minutes etc). ...
Score Getdate() in UDF column workaround
AkAlan - 4 Mar 2006 10:08 PM - 3 messages
I have a column that needs to display the number of Status hours between Start_Date and either Stop_Date or Getdate() if StopDate is empty. I am using an Access project as my front end and SQL Server 2000 as my back end. I have ...
Score Unique Values in View
Pablo Montilla - 4 Mar 2006 9:46 PM - 6 messages
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello, I need to create a view that returns some data and a unique value for each returned row. What I've done is to concat each field in the view separated with a dot, but its clumsy and I don't like it. ...
Score help with tsql
ag <> - 4 Mar 2006 8:54 PM - 2 messages
I would like get this result (like bank statement) sample _______________________________ 12/5 previous                                    100 ...
Score Data Warehouse Load Hints?
gc - 4 Mar 2006 7:11 PM - 9 messages
(SQL 2000) So if we are loading large tables while no one else is logged in and no other processes will occur, should we provide hints for the table inserts and updates for a performance boost? If so, which hints? Can any ...
Score Passing an array to sql
a - 4 Mar 2006 3:04 PM - 3 messages
I haven't done sql in a year so I could use some help here.  I've got a procedure below that uses the Function (listed under it here) that is supposed to parse a string and pass the parsed string as an array to sql.  ...
Score [Venting]
Mike Labosh - 4 Mar 2006 2:22 PM - 3 messages
So I have this box with SQL Server 2000, Evaluation edition of SQL 2005 which has top be installed as a named instance because of the way that 2K & 2K5 co-exist on the same box, and then there are a couple silly apps I have ...
Score Please help with update in this scenario
KarenM - 4 Mar 2006 1:26 PM - 2 messages
I have a table - AccountBalancesBudget which as the following columns: Plant Month Year Amount So take an example of one scenario: Plant Month Year Amount =================== ABC,1, 2005, 2000 ABC,2, 2005, 1000 ABC,3, 2005, 1000 ABC,4, 2005, 1000 ...
Score SQL View into Active Directory
Liam Mac - 4 Mar 2006 12:14 PM - 1 message
Hi All, I have create a linked server into Active Directory which allows me to customize SQL views into active directory. I have got SQL view working perfectly except when I try pull in the description field from AD. When I doing include the description field i get the following error message: ...
Score Cache problem in Report Services
Raj - 4 Mar 2006 9:07 AM - 3 messages
Hi All, We developed 40 reports using Reporting services, all reports having parameters, data source for all reports are views. I am facing problem of may be cache. I am using url method to show reports, i wrote a ASP ...
Score Product qty in a given branch
Michael Wong - 4 Mar 2006 7:01 AM - 9 messages
Hi, I'm new to queries and I'm stuck with joins... I have the following tables, and would like to get the total of the products, given a BranchId: table Product ProductId: PK ProductName table Branch BranchId table Inventory ...
Score Deleting duplicate rows from a table without using temporary table
AlertAdmin - 4 Mar 2006 6:33 AM - 6 messages
Hi all , Can anyone tell me the query to delete the duplicates from a table CASE_COUNTRY Country                                   CountryCode ...
Score http://www.eznom.net Free and Paid Hosting with cPanel or FTP Account
Eric - 4 Mar 2006 2:12 AM - 1 message
[link] Free and Paid Hosting with cPanel or FTP Account Posted Via Usenet.com Premium Usenet Newsgroup Services ----------------------------------------------------------     ** SPEED ** RETENTION ** COMPLETION ** ANONYMITY ** ----------------------------------------------------------                        [link] ...
Score To avoid redundancy in name
ganu - 4 Mar 2006 1:45 AM - 4 messages
Hi, can anybody tell me how to avoid redundany in name while creating a table in sql server 2005.For example let us take a table customer with two fields cno,cname and another table parts with fields brand and part ...
Score must I upgrade asp.net to 2.0 to access SQL 2005?
HK - 4 Mar 2006 12:12 AM - 7 messages
I have ASP.NET 1.1 websites.  They will need to access a SQL 2005 database. Do I have to upgrade the whole web projects to ASP.NET 2.0 in order for them to access SQL 2005?   If so, anyone have any good URLs for upgrading 1.1 ...
Score convert of code from access to sql server
san - 4 Mar 2006 12:04 AM - 3 messages
Hi give code is in access wann to convert into SQL Server help me plz SELECT PPCR_tbl_Form.PPCRID, PPCR_tbl_Form.StatusID, DateValue(IIf(DLookUp("PPCRID","QS_PPCR_Approved_Latest","[PPCRID]= " & PPCR_tbl_Form.PPCRID) Is Null,[MinRevDate],QS_PPCR_Approved_Latest.LatestApprovalDate)) AS FromDate, DateValue(IIf([PPCR_tbl_Form.StatusID] In ...
Score probelm of converting Dlookup in Sql Server
san - 3 Mar 2006 11:53 PM - 2 messages
Hi Please help me to convert this code of access in Sql Server SELECT PPCR_tbl_Form.PPCRID, PPCR_tbl_Form.StatusID, DateValue(IIf(DLookUp("PPCRID","QS_PPCR_Approved_Latest","[PPCRID]= " & PPCR_tbl_Form.PPCRID) Is Null,[MinRevDate],QS_PPCR_Approved_Latest.LatestApprovalDate)) AS FromDate, DateValue(IIf([PPCR_tbl_Form.StatusID] In (14,16,17),[MaxRevDate],Now())) AS ToDate ...
Score Help with CASE T-SQL
Owen Mortensen - 3 Mar 2006 11:22 PM - 3 messages
Anyone have much experience with SQL Server T-SQL CASE statement? I have some code that someone else wrote that looks like this: SELECT m.messageID, m.isTop,    CASE @Mode       WHEN 10 THEN m.subject ...
Score TRIGGER DATA
CSHARPITPRO - 3 Mar 2006 10:13 PM - 3 messages
I have written triggers for several our tables that detects inserts, deletes and changes. All of these changes are stored in a separate 'Audit' table. I would like for the user to see all the items in the audit table in the ...
Score Using IN
a - 3 Mar 2006 9:40 PM - 12 messages
I'm having trouble getting an IN clause to work. When I use a variable to feed the criteria to the clause, the IN fails (no rows affected). The variable is constructed with a string builder and looks exactly like the string that works, eg, @symbols = 'adrx', 'aes' . ...
Score Basic modeling question
Manso - 3 Mar 2006 9:38 PM - 4 messages
Hi, I have a simple design problem that I hope someone can help me with. Assume we have the following tables: Product --------- ProductID (PK) Name Order ------- OrderID (PK) Date Attachment -------------- AttachmentID Name Both table Product and Order can have one or more attachments. If I create ...
Score Multi-statement UDF vs. temp table
acx - 3 Mar 2006 9:37 PM - 1 message
Hi there, I have created this query: I have joined 3 inline table-valued UDFs and 1 multi-statement table-valued UDF. All the inline UDFs are executed in 1 second when run separately, table-valued UDF is executed in 5 ...
Score BOM
Quigs - 3 Mar 2006 9:28 PM - 1 message
Ok, so I'm trying to do a looping build of material. I have two tables, one with Parent Item and one with Child Item(s). I have linked the tables. I am getting good results the first time I run the simple query. Now, I want to ...
Score Update a part of a varchar field
pmud - 3 Mar 2006 9:25 PM - 3 messages
Hi, I have the ActivationDate stored in teh db in the format mm/dd/yy rather than mm/dd/yyyy . For eg, i have ActivationDates in the db as  10/12/05 rather than 10/12/2005. The reason it is like that is that we had imported ...
Score Rates
MAS - 3 Mar 2006 9:20 PM - 2 messages
Where can one can a general idea of the going rate for particular classes? ...
Score Need help with ASP.NET website administration tool! - Can't connect to the database when clicked o
Learner - 3 Mar 2006 8:58 PM - 2 messages
Hello,   I am just trying to get some familiartity with ASP.NET website Administration Tool and set up few users and roles. I launched the tool and clicked on provider configuration link and it goes to the page that ...
Score PLEASE HELP... ERROR: "[DBNETLIB][ConnectionOpen (PreLoginHandshake()).]General network error.
RSH - 3 Mar 2006 8:43 PM - 1 message
We have a VB6 application using ADO to connect to  SQL server 2005.  The application amkes several connections to several databases through the execution.  We keep getting the error: "[DBNETLIB][ConnectionOpen (PreLoginHandshake()).]General network error. Check your network ...
Score help selecting
Michael Wong - 3 Mar 2006 8:41 PM - 3 messages
Hi, I have the following tables, and I would like to filter the categories to a specific department (and then supplier). Something like an intersection. How can I do it? I'm new to SQL, especially with joins, so are the ...
Score Error 8152
AkAlan - 3 Mar 2006 8:08 PM - 6 messages
I'm trying to add a record to a table and am getting Error 8152: String or binary data would be truncated. Here is my statement written with VBA in an Access project. Both datatypes are nvarchar Private Sub cmdCreateJob_Click() ...
Score single table query
mccorb - 3 Mar 2006 7:48 PM - 3 messages
First let me say that I am not an SQL expert but can usually navigate some pretty complex queries if I fight it long enough. However, this one has me baffled. I am sure I am overlooking somehting simple but not sure what that is. It only involves a single table. ...
Score Quick SQL Question - update a single row with multiple rows
Scott M. Lyon - 3 Mar 2006 7:41 PM - 5 messages
This is on SQL Server 2000 (if that matters, but I think this is just a T-SQL issue). I have two tables (tied together by a common key, in this example TableID), the first of which has many rows (for a given ID), and the second has just ...
Score How to define multi-valued and composite attribute
juventus - 3 Mar 2006 6:45 PM - 2 messages
Hello All,               I want to implement an address field in a table. But, this address field is a multi-valued attribute. Also, I want to make it ...
Score Query master file and two entries of related file into a single re
richardb - 3 Mar 2006 6:42 PM - 6 messages
The master file holds the patients: PatUniqueID   Name   etc. ----------       ------    ---- 123AAA        Smith 456AAA        Jones ...
Score Using SELECT and IF statement
Pasquale - 3 Mar 2006 6:16 PM - 7 messages
I would to create a query SELECT structured so: SELECT <field1>, <field2>, IF <condition> BEGIN statement END ELSE statement, <field3> FROM <Table> The <condition> verifies the value of a parameter. ...
Score ISOLATION!!!
Vai2000 - 3 Mar 2006 5:36 PM - 9 messages
Hi All, I have a procedure that updates a row in multiple steps. First it inserts a record and gets the @@Identity and then using this ID goes and updates that particular Row in several steps. How can I prevent any other application doing a  SELECT on this table with ...
Score Newbie - Query convert money
Chuck - 3 Mar 2006 5:15 PM - 2 messages
I have been unsuccessful at getting this to display the way I want it to.  BOL says that convert(money, [expression] , 1)  will display my sales figures as 1,234,567.89.  However the results for my query  ...
Score Convert seconds to Hours:Minutes:Seconds
Patrice - 3 Mar 2006 4:41 PM - 4 messages
Hi, I have a table column that stores time in seconds and I need to convert the total time for a given period into hours:minutes:seconds.  My data source is a SQL table but the report delivery tool is Cognos, I was trying to do this ...
Score SOX Issue - Connect Sysdatabases with Sysusers
Catadmin - 3 Mar 2006 3:59 PM - 6 messages
I'm writing a stored procedure to use in Reporting Services.  I'm working of SQL Server 2000 with the initial version of RS.  I have to create a report (for compliance with Sarbanes-Oxley) which lists all Server logins & roles, regardless of whether or not they connect to a ...
Score Add one column in a table
Agnes - 3 Mar 2006 3:48 PM - 7 messages
I got ten database , and want to add one column in serveral tables. However, I need to add that column in the fifth column . Any easy script I can use ??thanks  a lot ...
Score adding an identity column retrospectively
Griff - 3 Mar 2006 3:41 PM - 2 messages
I've inherited a database that has a series of tables that have primary keys that SHOULD also be identity columns, but don't. e.g. CREATE TABLE [dbo].[test] ( [id] [int] NOT NULL , [fieldA] [varchar] (50) COLLATE Latin1_General_CI_AS NOT NULL ...
Score EXPLAIN Verb
wnfisba - 3 Mar 2006 3:21 PM - 6 messages
I have a DB2 SQL background. Is there something similar to the "EXPLAIN" verb in Microsoft SQL Server that will allow me to analyze a SQL statement and determine its access path, etc., and determine how efficient the SQL is??? ...
Score Rename a text file
mecn - 3 Mar 2006 3:20 PM - 8 messages
hi, How do I rename a text file through Sql scheduled job? Thnaks ...
Score Express and AspNet_RegSql.exe
Marc - 3 Mar 2006 3:17 PM - 2 messages
Can the Asp Net exe sql script be used to add the aspnetdb database to an Sql Express? I am doing this for running the App Blocks. The error that comes back is "can not connect". Thaks, Marc ...
Score Obtaining Procedure Declaration
Kevin Bowker - 3 Mar 2006 3:17 PM - 4 messages
Where does SQL Server 2000 store the definition of stored procedures and views?  Is there a system table that I can query and retrieve the definition, like it shows up when scripting from the QA Object Browser? ...
Score Is this statement vulnerable to code injection?
Michael - 3 Mar 2006 2:39 PM - 10 messages
I found a bit of code my comapny got froma third party group that I thought was vulnerable to code injection but I can't prove it since I can't figure out a way to hack it. I can point the boss to sources that ...
Score Select question
d4 - 3 Mar 2006 2:34 PM - 5 messages
I have the following in a table : Server   Findings    Added to Report ------      --------        --------------- S1        aaaa        2006-03-01 ...
Score Divide by Zero error
StvJston - 3 Mar 2006 2:31 PM - 3 messages
With the following sql I get a divide by zero error.  Can somebody help me with the syntax to fix this? Thanks in advance SUM(CASE WHEN (p.SecondaryCapacity/p.SecondaryWatts) < (m.SecondaryEERSpec - (-1 * (@LowerSpec * m.SecondaryEERSpec))) OR ...
Score Cursor Declaration
Chris Allison - 3 Mar 2006 2:18 PM - 6 messages
Hello All! I am trying to declare a cursor and I keep on gettin the following error when I try and debug: Incorrect syntax near the keyword 'declare'. I am stumped and confused becuase I have even tried using the numerous exmaples ...
Score Deadlock Error
John - 3 Mar 2006 2:17 PM - 1 message
Hi, The .NET application with Sql Server 2000 is on live and one of the users constantly  getting the deadlock error for the particular event. The error log details as follows Deadlock encountered .... Printing deadlock information 2006-02-27 13:41:39.53 spid4     ...
Score Stored Procedure Timeout
Joachim Prömmel - 3 Mar 2006 1:59 PM - 4 messages
Hello, I've got a problem with a stored procedure. Our Webserver (Win 2K, IIS5) calls a Stored Procedure on SQL-Server (Win2003, SQL2000 Std Ed) using ADO.NET. The Stored Procedure takes about 2 or 3 Seconds to run. ...
Score Calculating the days of the month?
Simon Harvey - 3 Mar 2006 1:53 PM - 5 messages
Hi everyone, Can anyone tell me how I could find out the number of days that there are in any given month using TSQL? I was hoping there was function I could use? Any help would be much appreciated Simon ...
Score Select Count Join Statement
Jeff - 3 Mar 2006 1:46 PM - 2 messages
I need a select statement where all "SystemName" are returned, and a count of how many documents are associated with (tied to) each "SystemName". The results desired would look like: 'System Name', 'Created By' , 'Creation Date', Count Exchange, Joe Smith, 03/03/2006, 3 ...
Score different result in Windows 2003 Server as in Windows 2000
Dev Main - 3 Mar 2006 1:43 PM - 5 messages
I receive different results with SQL Server on a Windows 2003 Server then on a Windows 2000 Desktop. I detached the Database on the Windows 2000 Machine and attached exactly the same database on the Windows 2003 Server, to make shure that the data are ...
Score have a way to change order-by of open cursor?
mtczx232 - 3 Mar 2006 12:27 PM - 5 messages
have a way to change order-by of open cursor? ...
Score Primary Key
Max André Bündchen - 3 Mar 2006 11:45 AM - 3 messages
Hi, I'm looking for a way to make a primary key control in a int column (in other words the app will manage the primary key value). What's the best way to make that in SQL Server 2005? Most important, there's a patter that allow many DB systems (like Oracle, DB2, ...
Score create temp table
SimonZ - 3 Mar 2006 11:32 AM - 3 messages
I have procedure for example: " CREATE PROCEDURE dbo.test0 AS CREATE TABLE #temp (izd_id varchar(40)) drop table #temp select * from products " When I execute this code on asp page: " set rsCpu=server.CreateObject("adodb.recordset") rsCpu.Open sql,locaConn(),1,1 ...
Score T-SQL debugger
Sharmila - 3 Mar 2006 11:15 AM - 2 messages
Hello NG, I am new user of SQL server. I wanted to debug a stored procedure. Refering MSDN I came to know about T- SQL debugger. I tried to debug, I am not able to proceed with it. After, assigning values to the parameters, I am not able to debug the stored ...
Score Query help
Chris - 3 Mar 2006 10:46 AM - 2 messages
I have the following query... SELECT     PassengerSerialNo, PassengerName, Insurer, Price FROM         (SELECT     I.PassengerSerialNo, I.PassengerName, I.Insurer, I.Price, 'I' AS Source                        FROM          dbo.InsuranceTransactions I ...
Score Updating table while importing
Amu - 3 Mar 2006 10:17 AM - 2 messages
Hi All, I have a table like the below table EmpNo    Skills 1             C++ 2             Java ...
Score Terminal Services: get terminal machine netbios name, host_name() returns server
Ben - 3 Mar 2006 9:58 AM - 3 messages
Hi We have been using host_name() to return the workstation name.  We now have two terminals on our network and find that Host_Name() only returns the server name. Is there a function that will return the terminal name? Thanks ...
Score loop through tables for UNION ALL
David Shorthouse - 3 Mar 2006 9:43 AM - 7 messages
Hey folks,     I have a variable number of identically structured & similarly named tables for which I would like to expeditiously execute a UNION ALL in succession. e.g. "SELECT * from (x-2) UNION ALL SELECT * FROM (x-1) UNION ...
Score Result other stored procedure in a Select
Danny M - 3 Mar 2006 9:37 AM - 2 messages
I need to make reports with record counts over queries you can enter and save in a tool i made. Now to make a stored procedure i can use in crystal report i get a problem. The stored procedures i have. ...
Score CLR and fire event
Basic - 3 Mar 2006 7:47 AM - 5 messages
Is it posible to fire an event in sql 2005 DB when e.g. one record changes in the table and...main part ... respond to that event in some external c# service? ...
Score Week Order
niel - 3 Mar 2006 7:41 AM - 4 messages
We have a SQL statement that has the following statement. DATENAME(YEAR,"dbo"."Deal"."TradeDate"-2)+' Week '+DATENAME(WEEK,"dbo"."Deal"."TradeDate"-2) The problem with this is that it shows the data as follows. 2005 Week 19 2005 Week 2 ...
Score Stored procedure/trigger contain reference to a non-existing objec
Peter - 3 Mar 2006 7:21 AM - 7 messages
This question is for both SQL Server 2000 and SQL Server 2005. Are there any problem in creating/compiling a stored procedure/trigger if it  contains reference to a non-existing object such as table or stored procedure?  ...
Score Converting a MySQL multiple column subselect to SQL Server
chris_g - 3 Mar 2006 6:29 AM - 2 messages
I am adding SQL Server support to an application that currently uses MySQL 4.1. I have a table that looks like this in SQL Server 8.0: CREATE TABLE dbo.sales_estimates     (     ID int NOT NULL, ...
Score "Selective" OR join
querylous - 3 Mar 2006 5:00 AM - 5 messages
Hi- I am trying to join 2 tables in such a manner: select i.itemcode, i.color, p.price from items i join prices p on i.itemcode = p.itemcode AND (i.color = p.color or p.color is null) ...
Score Subquery help
Ivan Debono - 3 Mar 2006 4:21 AM - 4 messages
Hi all, I have 4 tables (products, orders, order_details and stock). Products (columns: id, name). This table is a list of all products available. Orders (columns: id, date). This table is a list of orders for a particular date. Order_details (columns: id, order_id, product_id). Subtable of orders. Lists ...
Score SELECT statement with milliseconds
Terri - 2 Mar 2006 11:54 PM - 4 messages
I expect my select to return data. Why not? CREATE TABLE #Test ( testdatetime datetime ) INSERT INTO #Test (testdatetime)VALUES ('2006-03-02 14:29:24.000') SELECT * FROM #Test WHERE testdatetime > '2006-03-02 14:29:23.999' DROP TABLE #Test ...
Score accessing fake data inside an INSTEAD OF trigger
steven - 2 Mar 2006 11:34 PM - 4 messages
Hello, Is it possible to access inserted data through an UPDATE INSTEAD OF trigger if the condition of the query does not match any row in a table? For example : UPDATE myTable SET myColumn1 = 'abc' WHERE myColumn2 = 'xyz' If there is no row inside myTable matching the condition "WHERE ...
Score Hierarchically arranged attributes...mission impossible?
Daniel Manes - 2 Mar 2006 11:17 PM - 12 messages
Struggling over the design of a database. Basically, we have a long list of attributes. We've decided to arrange them hierarchically so users can find them more easily. The problem is, this doesn't seem very easy to implement! Let me try to explain what I'm talking about a ...
Score SQL Query Help
Andrew - 2 Mar 2006 11:15 PM - 3 messages
Hey all, Having trouble forming a SQL Query, could use the help of one of you Gurus. The table structure: TABLE [tbl_HCA_Inter_User_Status] ( [intStatusID] [int] IDENTITY, [intUser_Info_ID] [int], [intStatus] [int], [txtNote] [varchar] (4000), [txtUpda_By] [varchar] (50), [dtmUpda_Date] [datetime], [txtCrea_By] [varchar] (50), ...
Score SQL Server 2005 64 bit Linking to MS Access
JonathanG - 2 Mar 2006 10:59 PM - 1 message
I understand there is problems with it, but I have been unable to find any solutions on the internet.  Does anyone know how to get around this limitation? Thanks in advance... Jonathan ...
Score SQL Server Manager
Barry - 2 Mar 2006 10:52 PM - 3 messages
If I stop SQL Server Manager and then restart it will the jobs that should have ran during the time period automatically start or do I have to start them manually? Thanks Barry ...
Score problem: select Max(date) which is less than actual Max(date) ?
Rich - 2 Mar 2006 10:51 PM - 14 messages
create table #temp( recID int, curDate datetime, expDate datetime) insert into #temp select 1, '11/1/05', '1/5/06' union select 1, '11/5/05', '1/13/06' union select 1, '11/12/05', '1/25/06' union select 1, '11/28/05', '1/25/06' union ...
Score Debugger Won't Step
Herb Ray - 2 Mar 2006 10:27 PM - 1 message
Howdy - -     We are unable to debug stored procedures from Query Analyzer running on the same machine as the MSSQL service is running on.     We get the massage "SP Debugging may not work properly if you log on as ...
Score sql server timestamp
eoghan.kenny - 2 Mar 2006 10:18 PM - 6 messages
Hi, I need a 100% reliable way to detect the last change to a row in a sql server 2000 table. So far I have created table A with a timestamp column. I need to know if there has been any change  to the rows in table A. Therefore after ...
Score Left trimming little squares/spaces
MittyKom - 2 Mar 2006 9:38 PM - 13 messages
Hi All I have a table that is populated by an excel plugin. Some of the populated rows have spaces in front. In Enterprise Manager, they appear with little squares in front.  I have  been trying to LTRIM the whole column but there is ...
Score Select Count Join Tables
Jeff - 2 Mar 2006 9:35 PM - 2 messages
DML Below: I need a query that selects all of the tblsystem records (which will always be unique) and gives me a count of how many tbldocument records that are tied to each SystemName. So the query would return the results: ...
Score NOT EXISTS? Finding records without a correlating record in another table
KBuser - 2 Mar 2006 9:34 PM - 4 messages
I'm working with (essentially) two tables here. Magazine.(MagazineID, PK) and Ratedetail.(ratedetailID, PK)(magazineID, FK) I need a statement that returns all the magazineIDs that do not have a ratedetailid. I'm assuming not exists is what i'm looking to use, but ...
Score Access parameters within dynamic SQL
McGeeky - 2 Mar 2006 9:30 PM - 6 messages
I am exploring the use of dynamic SQL within a stored procedure and have run in to a problem. The dynamic SQL has no visibility of variables declared outside the dynamic SQL. Try this snippet which causes an error: declare @branch int ...
Score Parameterize table name without constructing dynamic query?
McGeeky - 2 Mar 2006 8:58 PM - 16 messages
Hi. We have a series of tables with exactly the same structure. The names of the tables all start with the same prefix but end with a number. Is there a way to write a normal query (not a dynamically constructed one) ...
Score How to do a USE statement inside a stored proc?
Juan Dent - 2 Mar 2006 8:28 PM - 2 messages
Hi, I have a general purpose stored proc that could be used in several databases. I need to tell it what database to work on. My first solution was to use the 'USE @DB' statement at the beginning of the stored proc, where @DB ...
Score Bulk Insert
Ellie - 2 Mar 2006 8:17 PM - 2 messages
Hi, I'm trying to use bulk insert to import a unformated text file into a table with 6 columns using the following code in query analyzer: BULK INSERT tblLocalizerTemp from 'c:\temp\textfile.txt' WITH (CODEPAGE='RAW', ROWTERMINATOR='\n') ...
Score Convert int seconds to legable time
Pat Brown - 2 Mar 2006 8:07 PM - 2 messages
I have a field that holds the number of seconds from midnight.  I need to take this int value and turn it into a legable time.  I also need to take input in 12:00 format and change back to int seconds to store in the db. ...
Score Max date in a row
Amit - 2 Mar 2006 7:35 PM - 5 messages
Hi, I would like to know how to find the max of 4 dates in one row. so if we have ssn, date1, date2, date3, date4            456123789  12/3/2005, 12/5/2005,11/8/2005,1/2/2006 ...
Score Constraints?
brenenger via SQLMonster.com - 2 Mar 2006 6:21 PM - 6 messages
I am importing data from a .csv. I have noticed that it copies this information over and over when I import the data. I only want it to update anything that is different and add any new lines in the .csv file. I have ...
Score Concatenate Lname and Fname Columns
pjscott - 2 Mar 2006 6:15 PM - 2 messages
I'm using Access 2002 and Sql 2000. I have a Lname and Fname columns that I'm try to concatenate. I'm trying to use Lname + ', ' + Fname in a View. But Lname is the things that displays. What am I doing wrong? ...
Score native sql function to encode binary data using base64
Uma - 2 Mar 2006 5:48 PM - 4 messages
I need to encode binary data using base64 before storing to MS SQL 2005. The select statement using FOR XML, BINARY BASE64 is not an option here, due to the presence of xml tags unabling the results to  be stored in a ...
Score strange procedure not changing behavior in SQL 2005
SevDer - 2 Mar 2006 4:49 PM - 5 messages
Hi, I just made a change in the stored procedure to send back 1 more column. However why I try my application to get the data from that column, it fails to do so (.NET application) But when I goto Management Studio and run the same query, I get the response ...
Score Function Help
Kevin L - 2 Mar 2006 4:44 PM - 5 messages
I am using SQL 2000. I have a table with Shipping Transactions in it (below). Each record listed is a package, but the Amount shown is the total shipping cost for all packages within a Shipment (Tracking) I am trying to write a FUNCTION that will return the Total Shipment Amount ...
Score Mirroring on SQL 2005
checcouno - 2 Mar 2006 4:28 PM - 6 messages
When i try to configure 2 servers with SQL 2005 in mirroring, one primary and one secondary (standard edition) i've got an error. Something like that: "this is a dem version of mirroring.." I'm tranlsating from Italian, so sorry ...
Score User Type
mrprice - 2 Mar 2006 3:46 PM - 3 messages
I have a need to remove all objects from a database where the type is User.  Is there a fast way to do this?  Is there a way to get a list of these objects so I could use a cursor to remove them? ...
Score SQLServer DTS and temp tables
Guy - 2 Mar 2006 3:33 PM - 1 message
I've seen a lot of questions on temp tables and DTS packages, so I thought I'd include a link to my webpage explaining how to get the two working together. [link] ...
Score Have Fun
sina.818 - 2 Mar 2006 3:32 PM - 1 message
You can find many funny pictures and some great funny flash clips in here: [link] have fun and forget the problems man ...
Score Have Fun
sina.818 - 2 Mar 2006 3:31 PM - 1 message
You can find many funny pictures and some great funny flash clips in here: [link] ...
Score Pivot Rows to Columns Sql2000 ?
StvJston - 2 Mar 2006 3:27 PM - 2 messages
I'm attempting to display for reporting a resultset that produces results as shown in my example. DDL attached. Performance testing relates to model specifications as a baseline.  Products are Qa'd based on the Specs.  If a tested product has a any value higher than ...
Score ISNULL in creating VIEWS.
Jens - 2 Mar 2006 3:26 PM - 6 messages
In the old SQL server 2000, I can create a view like this.... CREATE VIEW dbo.MyView AS SELECT ISNULL(CAST(Server AS nvarchar(100)), '') AS Server FROM dbo.MyTable But this does not work in SQL server 2005 - how can I rewrite this so it ...
Score Simple: Assign a value to a Outout variable from a select statemen
Chris Allison - 2 Mar 2006 3:26 PM - 7 messages
HI I have a problem in setting the value of a output variable. I basically have a query that will return a single result and I want to put that result in a variable to perfrom some calcualtions upon. the following doesnt work. ...
Next »