Home All Groups Group Topic Archive Search About

SQL Server database programming

microsoft.public.sqlserver.programming
Score Interesting but apparently harmless bug in QA when using [TAB]
malcolm - 27 Aug 2005 11:20 PM - 4 messages
Bug in Query Analyzer appears after installing SP4 (and maybe earlier SP's but I haven't checked). Create a sproc in the QA but, instead of a space between CREATE and PROCEDURE, use a [TAB]. In the Sproc add a CREATE TABLE statement - two or 3 fields will do it. ...
Score New bug in Access 2003 projects concerning Excel imports
malcolm - 27 Aug 2005 11:09 PM - 1 message
I have been working with MS Tech Support in India on a new bug they agree exists. When you use an Access 2003 ADP and try to transfer the data from an .XLS file into an SQL Server 2000 table using the TransferSpreadsheet command, it ...
Score Access.adp & Stored Procedures
malcolm - 27 Aug 2005 10:58 PM - 3 messages
Here is a bug - maybe. I have an access.adp that executes a sproc on SQL Server 2000. The sproc contains a correlated subquery that updates the table ExcelData. Works fine until someone other than the dbo uses the project. The sproc will not update ...
Score Format
Francisco - 27 Aug 2005 8:54 PM - 5 messages
I have a number in a table. By example: 87 I need change this a varchar but with format, by example '00000087' I need to make this change in a procedure.... Please help me!!!! In oracle I used TO_CHAR!!!!!!! It was easy... ...
Score Max Function - But between a fixed value and a column
Mark Moss - 27 Aug 2005 8:44 PM - 2 messages
Dear Sirs / Ladies             In HQL their was a MAX Function that would compare a fixed value ( 1.95 ) with a Column.            An example is MAX( 1.95, RegularBasePrice ) ...
Score SELECT statement of stock
simon - 27 Aug 2005 8:06 PM - 2 messages
I have table tblArticles where I have stock of all articles. Some of them are reserved. The reservations are in table tblReservations. If I would like to see all available stock, I should select all from tblArticles reduced with reserved articles. ...
Score increment ID
Tod Nelson - 27 Aug 2005 5:26 PM - 7 messages
Hi, I have a table: TABLE1 ------------- ID int primary FIELD1 varchar FIELD2 varchar and I want to insert this table with increment ID (max ID + 1). When I use with 1 record, there is no problem: ------------------------------------------------ INSERT INTO TABLE1 (ID, FIELD1, FIELD2) ...
Score Startup Parameter
Ed - 27 Aug 2005 2:00 PM - 6 messages
Hi,   Is there anyway I can change the startup parameter without using enterprise manager for -dC:\Program Files\Microsoft SQL Server\MSSQL\data\master.mdf -dC:\Program Files\Microsoft SQL Server\MSSQL\data\mastlog.mdf Thanks Ed ...
Score Seemingly inaccurate COUNT(*)
Chris Lacey - 27 Aug 2005 11:17 AM - 2 messages
Hi all, I was wondering if anyone could explain this apparent anomaly. I have a fairly large table (600,000 rows) into which some regular processes are inserting and updating rows.  (Inserts occur by means of a transactional stored procedure which inserts into this table and a secondary one, on which ...
Score Syntax Error
Mark Moss - 27 Aug 2005 6:33 AM - 3 messages
Gentlemen and Ladies         Below is the complete query that I have convert over from HQL to SQL and I am getting one last error which is         Server: Msg 170, Level 15, State 1 Line116 ...
Score Working out whats actually happening.
Aussie Rules - 27 Aug 2005 12:09 AM - 3 messages
Hi, I have a stored procedure that updates a single table. A bunch of params are being passed in, and then there is a single update against a table. The output in isql/w however shows..... (0 row(s) affected) ...
Score temp table
ichor - 27 Aug 2005 12:05 AM - 3 messages
hi i have a huge stored proc in which i created a few temp tables (#temp, #temp1, #temp2 etc). when i see the tempdb databse the temp tables are still there even after teh SP has executed, and returned no errors. ...
Score Help. Error converting nvarchar to numeric?
Casey - 26 Aug 2005 11:29 PM - 4 messages
Okay. I have this function in vb.net. It's purpose is to query the sql server, and return me a count. Here is the function: Private Function _countCallsCameIn(ByVal ApplicNum As String, ByVal date1 As String, ByVal date2 As String) As Integer ...
Score sql server desktop engine and sql server graphic tools
CindyH - 26 Aug 2005 10:07 PM - 2 messages
Hi Does anyone know how to use sql server desktop engine with the enterprise Manager vs using osql? Thanks, Cindy ...
Score SQL ERROR - HELP
Mark Moss - 26 Aug 2005 9:41 PM - 4 messages
Gentlemen and Ladies         Below is the complete query that I have convert over from HQL to SQL and I am getting one last error which is         Server: Msg 170, Level 15, State 1 Line116 ...
Score Is this right?
WhiteJul - 26 Aug 2005 9:31 PM - 6 messages
Please check my sintax for MS SQL 2000 query: Update Geo_Location Set Driver_Route# = '12101', Pedestrian_Route# = '15201' Where MAIN_LOCATION = 'Q28-41'     OR MAIN_LOCATION = 'Q29-41'     OR MAIN_LOCATION = 'Q30-41'     OR MAIN_LOCATION = 'Q30-42' ...
Score Joining to Derived Tables
wnfisba - 26 Aug 2005 9:19 PM - 4 messages
How can I join to a derived table??? My derived table would look like... (SELECT    file_id,     MAX(DATETIME)    AS    MAXDATE FROM    DataTrac.dbo.NOTES WHERE    group_id    =    'SRV' ...
Score Handling large amounts of data for reporting?
Lucas Tam - 26 Aug 2005 9:07 PM - 7 messages
Hi all, I have an application which logs a considerable amount of data. Each day, we log about 50,000 to 100,000 rows of data. We like to report on this data... currently I'm using a stored procedure to ...
Score 'Login failed for user' on subsequent saves
steve - 26 Aug 2005 8:56 PM - 2 messages
Hi All I am using MSDE2K and an application written in VB6 After installing MSDE and my program on to a new computer I am having strange problems when saving data which I didn't get on the old computer ...
Score Upload/Download to/from a SQL db.
JDArsenault - 26 Aug 2005 7:20 PM - 6 messages
I have a requirement to be able to upload a file (let's say xls spreadsheet) to a table, and then have someone else be able to download that same file, modify it and re-upload it again. This is common place for SharePoint using ...
Score posting 20050826
berde_h - 26 Aug 2005 6:19 PM - 2 messages
"Listening to the victims, I can't begin to understand the pain I inflicted on these innocent people," Rudolph said in his statement, which he read afte r 14 victims or their relatives read statements. Two other statements were r ...
Score Most efficient way to update/insert order details?!
JorgeC - 26 Aug 2005 6:07 PM - 9 messages
Hi! I've been working on a stock management software for a couple of months. The user creates/changes stock documents which have a header and several hundreds (usually) lines. Now, when we change a stock document (deleting, adding, changing lines) the ...
Score Help..I'm being thrown under the bus...
Bob - 26 Aug 2005 5:48 PM - 7 messages
Hi Folks! I'm working with a small group and I'm writing a VB app that gets data from a SQL Server. One or more of my collegues has found a way to make my queries timeout. The database has about 15% usage and all the usage statistics are low. ...
Score Problem with Create Index...
erobles75 - 26 Aug 2005 5:46 PM - 4 messages
Hi. When I create an Index, the following message appears me Server: Msg 8662, Level 16, State 1, Line 1 An index cannot be created on the view 'VW_CAM' because the view definition includes an unknown value (the sum of a nullable expression). ...
Score validate nvarchar as integer
John Smith - 26 Aug 2005 5:21 PM - 3 messages
I'm trying to run a data-validation query in SQL Server, but am not sure how to do it. create table testTable (ValidatedID INTEGER, EnteredValue NVARCHAR(30)) UPDATE testTable SET ValidatedID=CAST(EnteredValue AS INTEGER) WHERE ISNUMERIC(EnteredValue)=1 AND CAST(EnteredValue AS INTEGER) IN (SELECT ...
Score Error deleting using a temp table and a linked server
RICH - 26 Aug 2005 5:07 PM - 1 message
Help! When I issue this query: DELETE Sqltest001.dtUISQA.dbo.TBL_bill_exceptions_close_ctrl FROM sqltest001.dtUISQA.dbo.TBL_bill_exceptions_close_ctrl D INNER JOIN #TEMP1 ON D.BILLDOCID = src_BILLDOCID IT FAILS WITH THIS ERROR: Server: Msg 7306, Level 16, State 2, Line 1 Could not open table '"dtUISQA"."dbo"."TBL_bill_exceptions_close_ctrl"' from ...
Score can a view of a table imrpove table input performance?
Rich - 26 Aug 2005 4:22 PM - 10 messages
I have a table (sql Server2k) which users connect to through ODBC - read only.  I have to input/write a lot of data to this table everyday.  I observed that it takes a lot longer to populate this table than one which is ...
Score SQL reader issue
Dave - 26 Aug 2005 4:16 PM - 6 messages
I tried posting this on microsoft.public.dotnet.languages.vb.data, but got no responses.  Maybe I'll have better luck here.  I'm using Visual Studio 2003 and inline VB.NET, not code-behind. ---------------------------------------------------------------------- I am confused by the behavior of the Reader object in my application. ...
Score Re: Choosing one record over another
--CELKO-- - 26 Aug 2005 4:12 PM - 1 message
SQL PUZZLES is scheduled to go out of print. Sales wer nto good enough for a second edition. I think you can still get from [link] directly or as  used book on Amazon.com. It is a good book for students to have because so many professors have ...
Score NON-DETERMINISTIC?
Lynn - 26 Aug 2005 4:00 PM - 11 messages
I am trying to create a unique constraint on a computed column.  I've tried unique index, too, but they both fail w/this error: Server: Msg 1933, Level 16, State 1, Line 2 Cannot create index because the key column 'msgID' is non-deterministic or ...
Score Textboxes causing cell size to increase
tshad - 26 Aug 2005 3:45 PM - 3 messages
I have two tables that line up correctly. But when I add textboxes into the cells of my table, and it is close to the right edge of the table, it increases the size of the cells making all the ...
Score Re: sp_updateextendedproperty
Ned - 26 Aug 2005 3:10 PM - 1 message
Thanks Gail, Regards, Ned ...
Score Re: SP Question
Marcel - 26 Aug 2005 3:07 PM - 1 message
Maybe helpfull, You might discard the ownername by using a syntax like: database..tablename. Marcel ([link]) ...
Score EXCEL / SQL SERVER HELP - URGENT
MS User - 26 Aug 2005 3:02 PM - 2 messages
I got a stored procedure with 1 parameter and I want to call this stored procedure inside an Excel Query , I tried ..dbo.MySP ? It return with error message "Parameters are not allowed in queries that can't be displayed graphically" ...
Score scheduled jobs are failing
tag - 26 Aug 2005 2:01 PM - 10 messages
I had about 30 schedule jobs that either import data or run sql queries.  They have worked wonderfully for months.  All of a sudden they are failing.  I get the error message 203 ENVVAR_NOT_FOUND which translates to The system ...
Score Dynamic SQL Statement for Cursor
Ben - 26 Aug 2005 1:58 PM - 4 messages
Hi I have a cursor that I need to pass a dynamic sql statement to that is in a variable, is this possible? e.g. DECLARE curOneRecord CURSOR FOR @SQL Thanks B ...
Score Problem with query, trying to pull different date from the same field
hugo.flores - 26 Aug 2005 1:57 PM - 3 messages
Hi, I have a table of tests, and I want to be able to get the pass and fail totals on the tests. Here's what I have so far select month(lastmodified),datename(mm,(lastmodified))as month, count(id_status) as Total, id_status ...
Score Set parameter inside SELECT stored procedure
Assimalyst - 26 Aug 2005 1:29 PM - 7 messages
Hi, I have a stored procedure that produces a table: SELECT DISTINCT tblPatient.pntCode, tblPDT.pdtDate, Survival..... FROM tblPatient, tblPDT WHERE.... ORDER BY..... I now need to do some calculations on the genearated table. things like count all rows, count the number of different pntCode's, sum Survival ...
Score 32 bit clients apps on 64 bit SQL Server
Poncho@home - 26 Aug 2005 1:23 PM - 3 messages
I need some confirmation. Is there any document from Microsoft that states no changes need to be made to 32Bit Windows based Client/Server apps to access data on a 64Bit SQL Server? We code with VB6 an use MDAC to access our SQL Server DB, if a client wants ...
Score Re: SQL Humor
Paul - 26 Aug 2005 11:56 AM - 3 messages
rchris***@patmedia.net wrote: It would be fairly straightforward to change it to a char(10) in the future if necessary, wouldn't it? Paul. ...
Score DBREINDEX/ARITHABORT
Lynn - 26 Aug 2005 11:49 AM - 3 messages
Goodmorning everybody.  I have a maint job that runs once weekly - this is one of the agent job steps: EXEC db1..sp_MSforeachtable @command1='DBCC DBREINDEX (''*'')', @replacechar='*' EXEC db2..sp_MSforeachtable @command1='DBCC DBREINDEX (''*'')', @replacechar='*' EXEC db3..sp_MSforeachtable @command1='DBCC DBREINDEX (''*'')', ...
Score Compare database on developer and enduser server
PawelR - 26 Aug 2005 11:29 AM - 4 messages
Hello Group, Sorry my english is very littel. In my company I have two servers: first developer server (DevSvr)- for developers and second server (MainSvr)to use for other emplooy - for user of application. One of databases was changed on DevSvr (add new tables, sp, indexes etc.). ...
Score Merge apparent duplcate rows into 1 row?
Assimalyst - 26 Aug 2005 11:17 AM - 4 messages
Hi, I have a select query that can generate apparent duplicates; this occurs because the Histology value is determined from a table tblSample, this may contain a number of samples for the same location as there are different methods of obtaining samples sometimes 2 or more ...
Score Collation matter
Enric - 26 Aug 2005 11:15 AM - 2 messages
Dear all, We've got one db allocated in a SQL SERVER 7.0 and another one with compatibility with 6.5 and now we want to move it to SQL SERVER 2000. Change collation at server/db is easy, but problem is for all the columns. ...
Score bad query executionplan
lutz.jahnke - 26 Aug 2005 10:54 AM - 4 messages
Hallo! I'm having a problem with bad query executionplans. The optimizer won't get the right plan to execute the query fast. The optimizer perform cluster index scan instead of using a index seek an also using a hash join instead of a loop join. ...
Score Inline user-defined function
CodeRazor - 26 Aug 2005 10:39 AM - 3 messages
Hi, I am trying to create an inline user-defined function. The code below works fine, however I want to be able to put an "If else" statement in it, so that depending on the @variable entered,  a different ...
Score Can we restore database to a specific folder
ad - 26 Aug 2005 9:51 AM - 7 messages
I want to resotre a databse from a backup file like:     restore database Health from  disk='c:\Health.bak' WITH REPLACE The Health database did not exist in my SQLServer before restore. After restore, it will add a .mdf in some folder. ...
Score Order in the middle of a table
Arjen - 26 Aug 2005 9:19 AM - 3 messages
Hi, I publish a table on a website. At the end of each row I want to show an up- and downbutton. The buttons haves an id as parameter. Inside my table I have a vieworder column, this is the way I sort the table. ...
Score Time Difference Calculations
Trigger - 26 Aug 2005 9:04 AM - 13 messages
I am trying to calculate the time difference between two cells, However I have tried the datediff but it does not display the answer that i require, I am looking for the time diffence to be displayed in months, days, hours, ...
Score How check user name?
Oleg Cherkasenko - 26 Aug 2005 8:54 AM - 2 messages
I have COM object working with database via connection with administrative rights. I need method for checking user name: can this user has db access or no. I want to check: 1. SQL Server users 2. Windows users which added as a SQL Server logins/db users ...
Score How to perform a new backup every time
ad - 26 Aug 2005 8:27 AM - 2 messages
I use the statement below to backup my database         backup database Health to disk='c:\Health.bak' The size backup file Health.bak will increment every time when I perform the statement even I did not modify the database. ...
Score SET OF INT
Just D. - 26 Aug 2005 7:09 AM - 5 messages
I need to get a set of int values from some query and use this set later in the same SP. The query is looking like this:      (SELECT SomeID FROM tblTable WHERE SOMECONDITION ORDER BY SomeID) ...
Score Unable to login using iSQL ...
Ali - 26 Aug 2005 6:09 AM - 2 messages
I am trying to use isql from the DOS command prompt & I am getting the following error. The command and the error are as follows: H:\>ISQL -Usa -Psa DB-Library: Unable to connect: SQL Server is unavailable or does not exist.  ...
Score How to restore a database when the database is deleted
ad - 26 Aug 2005 5:46 AM - 4 messages
I use     backup database pubs to disk='c:\pubbackup.bak' to backup pubs database. Then I detach pubs, and delete pubs.mdf and pubs.lof After delete the files, I use     restore database pubs from  disk='c:\pubbackup.bak' ...
Score VB.NET newbie access to SQL Server
SJ - 26 Aug 2005 4:30 AM - 3 messages
Hi all, I know this is a SQL group and I now apologise for posting in the "wrong' group, but I had difficulty tracking down the "suitable" group. I thought that a lot of people here would be able to help me. ...
Score How to change Recovery mode
ad - 26 Aug 2005 4:23 AM - 2 messages
We can use the codes below to get the recovery mode of a database: select DatabasePropertyEx('test', 'Recovery') Now I want to change a database's Recovery to SIMPLE. How can I do that? ...
Score reg Stored procedure Performance
Bhaskar - 26 Aug 2005 4:17 AM - 3 messages
Hi , I am facing a typical problem with Stored procedure performance. When i excute my stored procedure first time it is taking around 60 seconds which is not meeting expectations. when i excute the same sp second time with same ...
Score Customers & Phones
optidev - 26 Aug 2005 3:15 AM - 11 messages
Hello, I have a customers table linked to a phones table. Is there a way to write an update query which will take the first & second phone number of every customer and put it into respective fields (strPhone1 & ...
Score Case Expression
Adam - 26 Aug 2005 1:52 AM - 4 messages
Hi all, I am trying to execute a query that shortens selected string values beyond a certrain point (40 characters), thus provide a summary. If the string is less than 40 characters the whole string is returned. My attempt so far is: ...
Score feeding results from one SP to anohter
Steve - 26 Aug 2005 12:14 AM - 3 messages
Hi, I need an SP to get the resultset output of another SP. ie    create Procedure A    as    begin       select * from Area    end Now in procedure B, how can I get these results into a cursor form processing? ...
Score calling a remote SP call that returns a cursor
Steve - 25 Aug 2005 11:52 PM - 4 messages
Hi, a SP in my database is calling a SP in external database using a linked server. ie ni my SP: exec YourLink.YourDB.dbo.GetResultsSP @CursorReturn out the SP in the external database must return me a result set OR cursor. I ...
Score Problem running multiple SP's
XImhotep - 25 Aug 2005 10:14 PM - 4 messages
Hello, I have two SP that are similar to the one below. When trying to run both of them through Query analyzer the first one will execute properly but the second one will say that it executed but doesn't really update any fields. ...
Score LEFT JOINS MULTIPLE TABLE SYNTAX PROBLEMS SQL SERVER 2000
randy.hau - 25 Aug 2005 10:13 PM - 4 messages
Hi, 1)I need help for converting many ORACLE sql outer joins (+) to T-SQL format. Let's say I have a star schema.  I need to check if the foreign codes exist in the dimension table before loading them to the fact table. ...
Score SP Question
William - 25 Aug 2005 9:42 PM - 3 messages
Hi, I am working with two db's and I am wondering if I can query both db in one SP?  Basically, I am trying to extend a third party db app by adding a custom db that holds new business data.  I need to query both dbs in a SP. ...
Score sp_updateextendedproperty
Ned - 25 Aug 2005 8:11 PM - 2 messages
Hi, I am trying to update the extended property description for a column using the  sp_updateextendedproperty.  However, I am not sure what to pass to the @name parameter. I have tried 'Description' and 'MS_Description' but neither works.  The ...
Score Changing the size of a user defined type
Anthony - 25 Aug 2005 7:56 PM - 5 messages
Is it possible and if so how do you change the size of a user defined type with out dropping it.  It has been used an many tables already and I need to increase it. Anthony ...
Score calculating a date difference...
certolnut - 25 Aug 2005 7:35 PM - 8 messages
Hi all... Is there a function to calculate the number of months between 2 different dates?? Example: @varNumberOfMonths = DATEDIFF(month,'08/01/05','07/01,05' ) Thanks in advance for any help... ...
Score Problem removing trailing spaces
mattmerc - 25 Aug 2005 7:00 PM - 5 messages
Hi, I am very new to SQL and made a dumb mistake when setting up my database. I have some small tables I used for drop-down-lists in a web page I designed. I used a datatype of CHAR. Well, I should have used ...
Score [OT] User-Defined string Functions Transact-SQL
Igor2004 - 25 Aug 2005 6:38 PM - 1 message
Ladies and Gentlemen, I am pleased to offer, free of charge, the following string functions Transact-SQL: AT():  Returns the beginning numeric position of the nth occurrence of a character expression within another character expression, counting from the leftmost character. ...
Score activex script programming - DTS
Britney - 25 Aug 2005 6:34 PM - 2 messages
Hi guys,      Do you have any good documents or tutorial websites on advance DTS programming?   Especially, I want to learn to write activex script inside DTS package. Thanks        Jay ...
Score Function Performance question
mvp - 25 Aug 2005 6:17 PM - 3 messages
I do have one store procedure which does insert into one table CREATE PROCEDURE StoreProc1 AS DECLARE testcursor CURSOR FOR    SELECT col1    FROM table    WHERE Id = @ID    OPEN testcursor    FETCH NEXT FROM cursor INTO @col1 ...
Score Count CHAR(11) in a string
Ben - 25 Aug 2005 6:13 PM - 9 messages
Hi I need to cound the number of CHAR(11) charactors in a string. I am currently attempting to use: len(string) - len(replace(string, CHAR(11), '')) But it seems to return far too many Any help would be much appreciated ...
Score BCP to txt file
Lontae Jones - 25 Aug 2005 6:12 PM - 3 messages
I am trying the following but it only works on a local database I want to run this on a remote server and have the file sent to my PC. EXEC master..xp_cmdshell 'bcp "SELECT * FROM TestDB_data..titles" queryout "c:\test_08-25-05.txt" -S ...
Score Return only the Third Row
John Walker - 25 Aug 2005 6:09 PM - 10 messages
Hi, I have a table Customers with only one field Customer_name. Here's my simple query:     select customer_name     from customers     order by customer_name Is there a way to modify this query to have it return only 3rd row? ...
Score Exceeds Variable Length - Varchar(8000)
Paul - 25 Aug 2005 5:58 PM - 6 messages
what is the best way to handle a situation, if the variable value (Parameter of Varchar 8000) exceeds 8000 char, while passing from the front end to a SQL Procedure. Using 'Text' type is a solution, but is there any other way to ...
Score need help with unspecified error when using Transfer database task in DTS
=== Steve L === - 25 Aug 2005 5:49 PM - 1 message
i'm using sql2k on w2k3 server. when using Transfer database task in DTS (either copy or move a database from server A to server B), it's always errored out but the msg is simply 'unspecified error'. has anyone done this successuflly ...
Score Choosing one record over another
tshad - 25 Aug 2005 5:34 PM - 14 messages
How would I select one record and not the another related record in one Select statement? I have regular prices that I want to display on most days and promotional prices on particular days (christmas, summer etc) where I don't want to ...
Score Audit
ReTF - 25 Aug 2005 5:08 PM - 3 messages
Hi All, I have one audit table in my db and i would like to do this: 1: always that user login in SQL  I would like add one entry in this table. (like this, USER 'xxx' SID 'xxx' log on Server 13:30:22...) I use  Mixed ...
Score How To Find a Mismatch between tables
JLS - 25 Aug 2005 4:22 PM - 3 messages
What is the best way to write a query to find a mismatch between 2 tables? For instance, suppose you had 2 tables, each in a different database, but you wanted to make sure the addresses in each table were in sync. ...
Score INDEX LAST REBUILT TIME
Ram - 25 Aug 2005 4:07 PM - 4 messages
Hi folks, Is there a way to find out when was the last time an index was rebuilt? Is this information is available in any system tables? Thx, Ram ...
Score advice on query
Neil Jarman - 25 Aug 2005 3:47 PM - 6 messages
Hi, my question is - how do I get just the best price from this query: item is a shopping list prod is the product list price is the list of prices, some product have multiple prices for different quantities eg Prod  price  minquant ...
Score count question
cheilig - 25 Aug 2005 3:44 PM - 7 messages
have a table (A)  that contains fields: [OPENDATE] [datetime] NULL [CLSDDATE] [datetime] NULL [DUEDATE] [datetime] NULL [PRIORITY] [varchar] (30 [USERID] [int] NULL and table (B) that contains fields: [USERID] [int] NOT NULL [DEPT_NUM] [varchar] (30) [DEPT] [varchar] (30) -- the variables ae declared and set ...
Score how to get table name with its columns and their types
Hasan O - 25 Aug 2005 3:00 PM - 3 messages
Hi , Let me explain the scenio . I have the following table : CREATE TABLE [dbo].[User] ( [userid] [int] IDENTITY (1, 1) NOT NULL , [username] [varchar] (50)  NOT NULL , [password] [varchar] (255)  NOT NULL ) ON [PRIMARY] GO I want to write a query  that  returns all the tablenames with their columns ...
Score Which isolation level to use?
Ramon de Klein - 25 Aug 2005 3:00 PM - 5 messages
Hello, I have some problems with scalability of my application and I think it is due to the isolation level I use. Suppose I run the following query from analyzer A:   SET TRANSACTION ISOLATION LEVEL SERIALIZABLE   BEGIN TRANSACTION ...
Score return previous 3 quarters plus its own quarter
Britney - 25 Aug 2005 2:45 PM - 3 messages
I want to create a function with minimum lines of code.  I know how to do if then statement but there are too many cases to cover, I dont know if there is a better way to do this. could you guys help? ...
Score can't return zero when no rows exist using aggregate function sum
miapjp - 25 Aug 2005 2:11 PM - 10 messages
Hi, I'm having a heck of a time trying to get SQL Server 2000 to return a zero (0) if no rows are returned in a sum() statement.  I know in Oracle you wrap an NVL around the whole shebang, and in Googling it ...
Score String RICHARD O'BRIAN in WHERE Clause
MS News - 25 Aug 2005 1:57 PM - 7 messages
Hi I'm sure this is probably an elementary question, but I'm finding it difficult to search for a name with an apostrophe in it, for example the name in the Subject Header : O'Connel/O'Brian/O'Reily etc.... ...
Score Stored Procedures
jinksk - 25 Aug 2005 1:56 PM - 4 messages
Is there a DBA out there who can give a lowly programmer any tips on when it is better to use a Stored Procedure over an Ad Hoc Query or a Defined View. At our corporate HQ it seems to be a TABOO to even mention stored procedures ...
Score grouping question
rodchar - 25 Aug 2005 1:49 PM - 6 messages
hey all, i have 2 tables. i'm grouping on table1 i'd like to join this to table2 which would create 1 to 1 relationship. when add extra fields from table2 it forces me to group by these fields as well. Can someone please explain this ...
Score Memory Usage
mvp - 25 Aug 2005 1:46 PM - 4 messages
Hello Everybody, We have a SQL SERVER installed on a Windows 2003 SERVER which has memory of 3.5 GB. We have configured SQL SERVER as a Dynamically Configure SQL SERVER memory when we installed. Now when we check memory usage of SQL SERVER ...
Score What features of T-SQL 2000 NOT in T-SQL 2005
Sri - 25 Aug 2005 1:33 PM - 2 messages
Hi, I just want to know what features/functionalities that was available in T-SQL 2000 but NOT in T-SQL 2005. If some one could point to articles and url's related to this that would be great. Thanks ...
Score Easy Convert Question
A.B. - 25 Aug 2005 1:25 PM - 8 messages
Will the following SQL allow me to see the results of the computed column in decimal format even if the Columns used in the calculation are defind as int: Convert(Dec(10,5), ((#Operator2.[Count]*1000)/#Closed2.[Dyed Yards])) 'Count' ...
Score Copying Database To Database
Bongee - 25 Aug 2005 1:17 PM - 4 messages
Hello, I have two databases, One is full of tables, The Other is empty, What I am trying to do is To Copy Full DB to Empty DB, Manual way is Backup DB and Restore to Target DB But, I wanna do it using a script and trying to make this process Automatic. ...
Score RAISERROR??
ReTF - 25 Aug 2005 12:18 PM - 3 messages
Hi All, I am trying use: sp_addmessage, RAISERROR... I have a problem. see: 1: I use 'addmessage' to add 2 messages in 'sysmessages', both whith id 50001 but one in 'us_english' and anothe in my native language 'Brazilian' But when I set my language 'SET LANGUAGE Brazilian' RAISERROR returns me ...
Score Stored Procedure Results change after save
Paul - 25 Aug 2005 11:28 AM - 5 messages
Hi All I am experiencing a strange happening in a Stored Procedure. The sp is built by a program (vb6) and when it is executed it returns no results. However if I go to the server and save without making any changes whatever it starts to ...
Score Alter column to Identity
Madhivanan - 25 Aug 2005 11:06 AM - 10 messages
Is it possible to alter the column of integer type as indentity field through query? Madhivanan ...
Score Is Log Sequence Number(LSN) unique throughout the life time of database?
Pushkar - 25 Aug 2005 10:03 AM - 3 messages
Hi, I have a query regarding LSN of the transaction log. Is it unique throughout the life of the database? Can I get a LSN which exist in very old backup of my database, again at some future time? Or it will never be repeated throughout the life of the database ie once one LSN is generated, it will not be generated again. ...
Score Table name as a variable
CodeRazor - 25 Aug 2005 9:51 AM - 10 messages
Hi, I am creating a function. Depending on a value entered I will select records from one of 2 Database tables. Instead of writing the code below, can i use a variable for the table name? IF @Variable = 'Customer' BEGIN ...
Score xp_regread HKEY_CURRENT_USER
BartVdH - 25 Aug 2005 8:10 AM - 2 messages
Hi there, I'm trying to access a registry-key in the HKEY_CURRENT_USER structure from within a TRANSACT-SQL statement (in a Windows NT environment, but apparently I get no access to be able to read string values in this ...
Score UDF For academic year
hals_left - 25 Aug 2005 8:00 AM - 3 messages
Hi, Can someone help me out on this. I need a function to return the academic year '04/05' or '05/06' from a small date time. If the date is Sept-Dec then its current-year/next-year otherwise ...
SUM
DTS
Next »