Home All Groups Group Topic Archive Search About

SQL Server database programming

microsoft.public.sqlserver.programming
Score Help with Select statement
rocky20 - 13 May 2006 8:06 PM - 3 messages
I need help creating a select statement that will show users who have attempted to fill out a form more than once and have not completed it at least once. Here is the basic table layout. ID int  PK ...
Score Problem with SP
Rudy - 13 May 2006 7:09 PM - 5 messages
Hello All! CREATE PROCEDURE dbo.PlbetII  (@UserID NvarChar(50), @Wager Nvarchar(50)) AS IF EXISTS (SELECT 1 FROM Bankroll WHERE UserID=@UserID) begin Update BankRoll Set Wager = Wager + CAST(@Wager as Nvarchar) where userID = @userID return -1 end ELSE ...
Score SQL Server 2005 -- Internal Query Processor Error: The query processor could not produce a query pla
michael - 13 May 2006 5:48 PM - 4 messages
Hi all I migrated a database from SQLServer 2000 (Standard edition) to SQLServer 2005, standard, SP1, on Windows XP Prof, SP3 After migration I get the following error:    Server: Msg 8624, Level 16, State 1, Line 6    Internal Query Processor Error: The query processor could not produce a query ...
Score Best design for edit tracking?
roy.@nderson@gm@il.com - 13 May 2006 3:30 PM - 6 messages
Hey all, This is a general question. Here's my scenario: We have a legacy database. The core table within contains almost 4 million records in SQL Server. Currently we have a web front end which allows uses to search through the database for the information they need. ...
Score Cross Tab report
imtiaz - 13 May 2006 2:22 PM - 3 messages
I have a table with data in the following format user     menu     rights ---------------------- John     Acc     Yes John     Tran     No ...
Score DBCC DBREINDEX Help
sudarshan selvaraja - 13 May 2006 12:45 PM - 8 messages
DBCC DBREINDEX ('pubs.dbo.authors', UPKCL_auidind, 80) when the above given command is executed i get the result as DBCC execution completed. If DBCC printed error messages, contact your system administrator. instead of Index (ID = 1) is being rebuilt. Index (ID = 2) is being rebuilt. ...
Score FFXiUnlocked Get Free Stuff Virtual Gaming Sales information and more Start Making Money Today
Shawn.T.P - 13 May 2006 10:29 AM - 2 messages
A Must View Website!!! [link] ...
Score Business Intelligence Development Studio
Jon Paal - 13 May 2006 7:08 AM - 8 messages
I installed : Business Intelligence Development Studio I don't find the program listed anywhere. How do I access the interface ? ...
Score Query for create table
Wallace - 13 May 2006 4:52 AM - 6 messages
Hai All,    I have table t1 in db1.    I want to create a table t1 in db2 with the same structure as t1 of db1.    Can anyone tell me the query?    Urgent.... Looking forward for the response... ...
Score Trigger problem
googleRon - 12 May 2006 11:14 PM - 4 messages
Hi, I have posted an triggerproblem some time ago, but I have met another one which drives me crazy. (It's hard to be a rooky) A trigger a have created on table_A that has to insert the value of ...
Score question about order in which queries fire in trigger
Rich - 12 May 2006 10:17 PM - 7 messages
I ran into this trigger in a project.  Is this tigger firing Delete from webproducts join Deleted... first?  and then Delete from webproducts join Inserted...   second?  Or is the ...join Inserted firing first and then the ...
Score How to get DMO to schedule a Stored Procedure as a Job?
Robert W. - 12 May 2006 9:31 PM - 3 messages
I have what is a simple task.  Using C# I want to schedule a SQL Server Stored Procedure to run at a specified date & time. I've seen plenty of examples of running SQL code like this but none about ...
Score Clearing Connections
scott - 12 May 2006 9:01 PM - 2 messages
I use the below code to detach my database. Sometimes it fails because there is an active connection. Is there any command that can overide that protection or clear the connection without me having to manually detach inside Ent. Manager? ...
Score inserting duplicate in unique index?
lytung - 12 May 2006 8:46 PM - 6 messages
hi there, what does that mean exactly? i tried to do an insert with the same value  twice and i got an error like: cannot insert duplicate key row in object iwth unique index.?? The column is order name. ...
Score INSERT query using linked servers is slow.
Chris F - 12 May 2006 8:20 PM - 4 messages
Good day everyone, I am setting up a simple data mart on a server running SQL 2005.  It gets updated nightly from another server with SQL 2000.  Originally both databases were on the same server under 2000.  Now that they are on different servers, ...
Score excel problem
Kevin - 12 May 2006 8:10 PM - 4 messages
hi I have an excel sheet with no header row. so I used DTS package to transfer data to the table, however, transform data task think my first row is the header column, as the result, I can never transfer my first row data to the table.  ...
Score Concatenate columns into a string
jdornan - 12 May 2006 7:43 PM - 7 messages
I am trying to concatenate 3 columns into 1 string but I need to sort them alphabetically before I concatenate them. Example column1 = ABC column2 = ABF column3 = ABE I need to insert the concatenate value into a column as "ABC ABE ABF" ...
Score Using output with insert (SQL2005)
Colin Dawson - 12 May 2006 7:29 PM - 16 messages
Hi all. Here's a question that I was asked today. I'm farily confident in the answer, but want to make sure that I've not missed something. Here's the problem. Create Table #CJD ( RowNum integer, Val integer ) ...
Score Import Excel Spreadsheet
JerryWendell - 12 May 2006 7:29 PM - 3 messages
I am using TransferSpreadsheet from an ADP file to import an Excel spreadsheet into an MSDE database.  On one computer, when I run the code to import the spreadsheet, it prompts for an SQLServer login.  The same user can ...
Score Global Search Criteria - 1 criteria for multiple columns
Jim Underwood - 12 May 2006 7:24 PM - 5 messages
I am curious of other's opinions on this.  It may be more a UI issue than a database one, but there is a database side to it, and I have seen that folks here have a broader knowledge base than just proper table structures, so... ...
Score group into 1 row
Andre - 12 May 2006 6:55 PM - 3 messages
I have a query that I need to group the results for a particular client into 1 row.  The problem is that I'm creating some columns on the fly using Case statements, and the columns contain a Y or N as their data.  Because of ...
Score Is it possible to trigger a view by insert actions on the basetable?
googleRon - 12 May 2006 6:41 PM - 6 messages
Hello there, Is there anybody who can help me with a problem related to triggers on views? Consider the following example with three objects: table_A on database X view_A on database Y which is a view on table A                                  (SELECT * FROM X.table_A) ...
Score How to upload Image into table
Kris - 12 May 2006 6:08 PM - 7 messages
Hi, I have Image file (.jpg) is saved on shared Drive. I would like to upload into table. How can I do that ? Thanks    -Kris ...
Score What is happening in background when bulk update statement is exec
babz - 12 May 2006 6:00 PM - 5 messages
Hi I am very curious to know what is happening in background when bulk update statement is execute?  Assume that it is a very large table contains 50 million records and we are trying to update based on primary key (which is a ...
Score How often an index is hit
Tigermikefl - 12 May 2006 5:36 PM - 4 messages
Anyone have a script/process that would count how often indexes are actually used? Are there sys optimizer tabs or logs or such? ...
Score Update query - Marking Duplicates as Frequent
ILCSP - 12 May 2006 5:27 PM - 4 messages
Hello, I need to create a SQL 2000 update query that needs to look for whether a person has ordered the same item before and if so, mark all existing records for that person and OrderType as  'frequent', except ...
Score Use space after truncate
Ganesh - 12 May 2006 5:17 PM - 5 messages
Hi There, I've done audit_log truncate using the truncate method. How can i free the space so it can be used by operating system. I truncated 1 billion records from audit log but still the database size seems to be same. ...
Score Using triggers to create audit trail
Big Ern - 12 May 2006 5:02 PM - 4 messages
I am trying to create a audit trail on some financial information in our DB's and think that triggers would be the best way to go. I tried using C2 Auditing, but it is way to cumbersome, process intensive, and difficult to ...
Score How to generate the default value of datetime datatype in Tsql?
Rich - 12 May 2006 4:40 PM - 5 messages
Hello, In MS Access, if I type Dim d As Date Debug.Print Year(d) I get 1899.  I believe the default value of a Tsql dateTime data type is 1/1/1900.  But if I type Declare @d datetime ...
Score How to create a View from temporary table ?
kishore bondada - 12 May 2006 4:20 PM - 7 messages
Hi all, Iam aware that #Temporary tables can not be used in creation of views, but iam in a situation where in iam needed to do so. can anybody provide me with a workaround for this, its very urgent.....any ...
Score Deleting or Clearing
Scott - 12 May 2006 4:18 PM - 5 messages
Is there a way to delete a database log file without detaching the database? I don't care about loosing the ability to roll back, etc. I tried "restricting the growth" setting, but that just makes the database unusable when it hits the limit. I'd like to be able to restrict a log file ...
Score converting the varchar value to int
berggoetz@sbcglobal.net - 12 May 2006 3:52 PM - 3 messages
All, I am running this statement and getting the error below. I am assuming that the issue is the CLCCHRGE.CCOUNT data type is Varchar and needs to be converted using a CONVERT clause or a CASE statement but I am not ...
Score In , Not In ... Exists , Not Exists .. Help Rewriting a Query
sloan - 12 May 2006 3:38 PM - 7 messages
I inherited a project, and I went thru and replaced IN () and NOT IN () with EXISTS () and NOT EXISTS. Most places, I have had huge gains in performance, without any change in the logic. I'm 99% done, and when I run view some execution plans, I have found one ...
Score How to create column in existing table
amjad - 12 May 2006 3:27 PM - 3 messages
Hi i want to create a store procedure i have table called ABC which has 10 column and have lot of data now i want to design a store procedure to add another emplty column into that table which i will fill with another store procedure that i already have thanks ...
Score Insert column in specific position using SQL
lmcphee - 12 May 2006 2:59 PM - 51 messages
I have a table with 4 columns. I want to add a column to this table with an SQL command, but I want that column added as the 2nd column - not the 5th column. Or can I add it, and then change column order after with SQL command? ...
Score How to retrieve data of a product which falls under two categories??
savvy - 12 May 2006 2:52 PM - 3 messages
I'm using MS SQL 2000. I developing a shopping cart where on the admin side when we are inserting or updating the products, there is a chance that a single product can fall into two categories therefore i'm giving ...
Score Info!!
Vai2000 - 12 May 2006 2:47 PM - 4 messages
Hi All, 2 doubts 1. How can I retrieve the exact command (T-SQL) being executed by an SPID on the query Analyzer. You can get the same info using Ent. Mgr and right click on SPID. 2. What's the best technic (light weight method) to log errors from a Stored ...
Score Widest table in database
Robert Bravery - 12 May 2006 2:24 PM - 8 messages
HI all, How can I find out which is the widest table in the database Thanks Robert ...
Score Logins under Windows Group
Herbert - 12 May 2006 2:11 PM - 2 messages
Hi All, I want to get all the Logins under Particular Windows Group by using Query or System Stored Procedure. For Eg: All Logins under BUILTIN\Administrators Could anyone pls help me out? Thanks in Advance... Regards, Herbert R. ...
Score Left function problem
amjad - 12 May 2006 2:08 PM - 3 messages
Hi i used left function with sql server 2005 store procedure to get desire string liike declare @sourceFS varchar(8000) some string manipulation then SET @SourceFs=Left(@SourceFs,(Len(@SourceFs)-1)) theoritically it should work  and when i try to execute it it return that invalide param passed to ...
Score Scheduled Backup for SQL Server express
Sam Malone - 12 May 2006 1:57 PM - 4 messages
Has anyone developed a script (that they're willing to share) that does a scheduled backup of  a SQL Server Express database and that automatically generates a "dated" backup file - i.e. a new backup file each day as opposed ...
Score transaction context in use by another session error
vtxr1300 - 12 May 2006 1:36 PM - 4 messages
I have written a stored procedure that calls a C# class.  The sp is called by a trigger on table A.  The class has 2 methods.  Method 1 is the main call from the stored procedure.  Inside it, it sets a ...
Score Need some help in query
amjad - 12 May 2006 12:22 PM - 3 messages
Is their best to to execute update query. here is my problem I have a two table on different databases on sql server 2000.... one called source which has 104 fields and another called des table with same fields... i want to check if any thing changed in source update the destination..... ...
Score Parse XML
msnews.microsoft.com - 12 May 2006 11:56 AM - 3 messages
In an ASP.NET 2.0 web service I need to receive XML from the client.  I figure I can simply execute a stored proc and pass the XML as a param.  In SQL Server 2000, how can I then parse that XML and split it into columns ...
Score Inserting data into multiple base tables using INSTEAD_OF_INSERT trigger
Tõnu - 12 May 2006 11:18 AM - 3 messages
Hi, We seem to have a closed circle with updating data through views. We have several views on MS SQL (2000) that fetch data from several base tables. Updating and inserting the data is organised using instead of triggers. The ...
Score Views : no parameter allowed?
Stephan Hofmann - 12 May 2006 10:47 AM - 4 messages
Hello, maybe this is really a silly question, but I have a problem with parameters in views: if I have created a new query saved as view within SQL server and I insert a parameter like @abc as filter criteria, I will get an error message ...
Score Scripting Help
news.microsoft.com - 12 May 2006 10:04 AM - 3 messages
Hi Im fairly new to SQL Server, I need a script to create a table which contains the following columns in a view which describes all the views in my database and their dependent views and or tables. ViewName     DependentViewOrTableName    DependentObjectType ( Table/View ) ...
Score Query user/worlstation access of database
Mark - HIS - 12 May 2006 9:42 AM - 5 messages
I have a client who needs to be able to run a query that shows a list of all workstations (IP address, logon etc) who are currently accessing a specified SQL database with logon / last activity time (if possible). Most of the users are using a web application to access the database, so how ...
Score Encrypting Text
Janet - 12 May 2006 9:08 AM - 2 messages
In SQL2K, I used to use the PWDENCRYPT() and PWDCOMPARE() to encrypt the password and then compare when the user logs in. In SQL 2005, seems that this function is not working, and I don't understand the Symmetric key function.  Can anyone please kindly give me some example? ...
Score execute a SP with a date parameter
Xavier - 12 May 2006 8:10 AM - 7 messages
hello, i must run a SP every day with a date parameter  ( a job) examle if today we have the 20 may 2006 - i have to run exec mySP '20060518' exec mySP '20060519' that means that i run every day two times the stored procedures with the ...
Score Audit Insert/Update/Delete through profiler
Pushkar - 12 May 2006 6:50 AM - 2 messages
Hi, I want to Audit Insert/Update/Delete on some of my very sensitive tables through profiler. My requirements are:     -I want to Audit once Insert/Update/Delete is completed successfully. So I can not use Audit Object Permission event to audit this. ...
Score Need to monitor database performance
Amit - 12 May 2006 6:50 AM - 3 messages
I need to monitor database performance , how do I do it , can anyone help me. ...
Score View or Base Table? Which one is faster?
Malkesh - 12 May 2006 5:55 AM - 4 messages
Hi Friends, In a single query, referening to view is faster or referening to base tabel is faster. Consider I've base table X in which i've column - ColA and i've one view vwX which built upon table X and many more ...
Score DBA vs. Web server admin?
brett - 12 May 2006 5:43 AM - 7 messages
Many DBAs are competely against having any type of web server on the database server box.  Web server admins say, "what is the big deal?, We can tighten the web server down so hard, it'll be able to cut glass". ...
Score How to create scripts (drop then create) in sql 2005
moondaddy - 12 May 2006 1:33 AM - 3 messages
I'm using sql 2005.  One thing I could do in sql 2k which I don't see in sql 05 is when I script objects in EM it would check to see if the object exists first, and if so, it would drop it before creating it.  I don't see such an ...
Score Fastest SQL Server Library
garyh - 12 May 2006 12:36 AM - 5 messages
I need to connect to the Sql Server 2005 on the local machine using C/C++ and am trying to find the fastest way of doing so. I'm dealing with up to a million records and usually lots of small selects. I also can't use ...
Score Choosing clustered index
Tom Ellison - 12 May 2006 12:08 AM - 5 messages
Dear friends: There is some confusion here about the choice of which index should be clustered.  The choices are generally: - the surrogate identity column. - one or more columns that make up the natural key. My contention has been that the latter is the obvious choice.  This is the ...
Score SQL Server 2K5 and VS.NET: Order of Installation
Jeremy S. - 11 May 2006 10:52 PM - 17 messages
I'm about to install VS.NET 2005 and SQL Server 2005 on a new/clean development machine (XP Pro/SP2 etc). Is the order of installation important (i.e., which product should I install first)? Thanks! ...
Score Requesting Advanced T-SQL help
Andrew - 11 May 2006 10:41 PM - 3 messages
Need some guru help with a monster T-SQL query.  Trying to make it more efficient, possibly less code, and anything else I can do to it to make it run faster.  This is an SP and Tables created by the person I replaced, but ...
Score SP to test job completion
TomT - 11 May 2006 10:28 PM - 5 messages
The sp below appeared to work fine in SQL 2000, i.e. to start a job, and then return a value on completion. Running this in SQL 2005 appears to just return a value indicating the job has started, but not necessarily completed. ...
Score Need to convert a given date to fiscal year
Paul - 11 May 2006 10:02 PM - 2 messages
In a Sql query I need to convert a given date to fiscal year. Fiscal year start from 1-Apr to 31-Mar each year and I need the fiscal year in the format like 2005-06 etc. Thanks ...
Score How to query a remote server from sql 2005
Harry - 11 May 2006 9:28 PM - 4 messages
Ok,,im stuck.  I can access a remote 2000 sql server from sql 2005.  I connect directly to the 2000 database ok. I can run queries on it all day.  I can do the same thing with another remote ODBC server with SQL2005. ...
Score Derived Tables and joining to them
wnfisba - 11 May 2006 9:27 PM - 2 messages
I am struggling with some syntax. I have created a couple of derived tables and now want to LEFT OUTER JOIN to them. Can someone help me??? Thanks in advance. Here's the SQL... SELECT    DERIVE1A.column_1, ...
Score Using Java program, calling a SQL to insert a 'null' value - HOW ?
jvasantharao - 11 May 2006 9:06 PM - 2 messages
public void mySqlProg {   public mySqlProg()   {}   public String setNullYoTS()   {   String quot = "\'";   String nullifyMgrTS = "UPDATE REQUEST_TBL SET MGR_APPROVAL_TS="+" "+"WHERE TRANSACTION_GUID = "+quot+tranid+quot;; return nullifyMgrTS;   } } when i execute the above statement, i am getting an SQL error in my ...
Score Ansi-92 in sql server 2005
Nuno - 11 May 2006 9:04 PM - 9 messages
Is there any flag to enable ansi-92 joins syntax for sql server 2005? -Nuno ...
Score A query to get n values from one column
VJ - 11 May 2006 8:47 PM - 2 messages
I have a query which join 5 tables say my result is Warehouse     ProductName  Features   Price      Manf I just need to make some analysis and need to select any 5 features ...
Score datetime transformation
GB - 11 May 2006 8:46 PM - 3 messages
Hello, How can I convert datetime value : 2005-10-11 00:00:00.000 to date value: 2005-10-11 ? Thanks, GB ...
Score Sql Server 2005 Stored Proc Param used with IN
lad4bear - 11 May 2006 8:24 PM - 4 messages
Hi Guys, In Sql Server 2005 can I send a list of ids as a parameter to Stored Proc and then use it with the IN part of my SELECT statement. I know you can't with 2000 but was hoping that this would have changed ...
Score Load assemblies - CLRIntegration
Grafix - 11 May 2006 8:19 PM - 4 messages
All - I have two assemblies (lets say AsmA and AsmB) loaded into SQL Server (Create Assembly) Both these assemblies have EXTERNAL_ACCESS permissions. When the code inside AsmA is executed (within SQLServer context), it tries to load a type in AsmB "dynamically" ...
Score SQL Syntax Error in ASP Page.
TRH - 11 May 2006 7:53 PM - 4 messages
Hi, I am a relative novice when it comes to SQL Queries and converting them to ASP pages.  I thought that I would be able to cut and paste from the SQL Query Analyzer and get most of the way there.  My problem ...
Score AFTER INSERT TRIGGER PLEASE HELP
steven - 11 May 2006 7:13 PM - 3 messages
I need to set up a trigger that updates a field in a record directly after it is inserted.  I have been burning some serious cycles on this and can't figure it out.  Any help would be apreciated. ...
Score Problem removing old back up files....
CoryK - 11 May 2006 7:00 PM - 4 messages
I am having problems with removing the update files from a folder. When a do a new backup, I want it to overwrite the old backup files with the new one. Apparently the code I am using is wrong. Any suggestions??? ...
Score passing a 'In expression' to Stored procedure
M - 11 May 2006 6:54 PM - 3 messages
Are there a way to pass a expression as a parameter of a stored procedure? I am writing a stored procedure, There is a Select statement something like: Select Name, Street, City, State from CustomerAddress where state in ('MN','CA','TN') ...
Score Help needed with Instead of Update trigger on a View
Tore - 11 May 2006 6:30 PM - 3 messages
I have an application where we are replacing a subsystem including portions of the database.  In order to minimize the code impact on the existing application, we have decided to create a few "compatibility views" - i.e. database Views that produce the same result and with the same names as the ...
Score 'MSDAORA' was unable to begin a distributed transaction - why?! (SQL <-> Oracle)
ammar_fake - 11 May 2006 6:15 PM - 2 messages
Hello! I have an Oracle linked server connected through MSDAORA. Linked server queries work perfectly - the "openquery" ones as well as the 4-part-named ones. The problem I have is with embedding the queries within SQL Server triggers. Trigger: ...
Score Fetching duplicate rows uisng IN clause
mohaaron@gmail.com - 11 May 2006 5:18 PM - 3 messages
I have two rows in table1 and these two rows are then duplicated in table2 making four rows. I then try and use the following query to select the four rows from table2. select * from Product P where P.ProductVersionID in (select ProductVersionID from PartSet where ...
Score comma delimited list
Jay - 11 May 2006 5:15 PM - 8 messages
Hello, I have created a small query that will output a list of email addresses that are separated by commas. I plan to copy and paste the list into a email invite field (send to: field for an email app). But what is happening is that ...
Score Huge table insertion question
nick - 11 May 2006 4:17 PM - 6 messages
I am using the following script to insert a huge table. What's the right value for set rowcount? Should I execute checkpoint in loop? Any better approach? set rowcount 10000 -- wha'ts the right value WHILE @@rowcount > 0 ...
Score Sql statemnet Help
Dominic - 11 May 2006 3:53 PM - 6 messages
Hi I'm trying to create a isBooked statement What I have is a db with: Date, StartTime,EndTime I currently run two SQL statements: 1) "SELECT Count(PupilID) FROM TblLessons WHERE " _ & "Date =@GetDate and Time between @GetTime and @GetTimeEnd" ...
Score Orders in last 24 months
Frenchie418 - 11 May 2006 3:40 PM - 18 messages
Hi, I would like to count the number of orders for each month for each one of my customers over the last 24 months. The information will then be used into a Crystal Report Bar Chart. The problem I'm having is that Crystal will only display information that ...
Score Execute a SPROC daily
Scott - 11 May 2006 3:23 PM - 10 messages
What would be the best way to force SQL to fire a SPROC at 6 am each day? I'd appreciate any advice on different and best methods. ...
Score Need help to do Oracle to SQL Server - SQL conversion
Mac - 11 May 2006 3:09 PM - 8 messages
Hello, I have this Oracle query that does a hierarchical traverse : -- 1.  attr_value_list_admin.pl -- Identify collection name of child container SELECT container_name FROM logical_container WHERE parent_id = 1 START WITH container_id = 338058 CONNECT BY PRIOR parent_id = container_id -- 2.  view_profile_WEB.pl ...
Score Hi i have var which has more than 8000 characters
amjad - 11 May 2006 3:04 PM - 5 messages
Hi i heard that in sql server 2005 they introduced MAX to replace text data type like strtemp varchar(MAX)... i have sql server 2005 and i am trying to use it but does seem like working .... i guess the only reason is.... my ...
Score Deleting duplicate entries in nightmare-table
Lasse Edsvik - 11 May 2006 2:58 PM - 7 messages
Hello I was given the task to "filter away" duplicate rows in a 10 million row table with about 30 columns :S And the table has no primary key, no constrains, nothing, and I need to find a way to clear that mess up, in a ...
Score automate rebuilding indexes
Jason - 11 May 2006 2:57 PM - 2 messages
Hi, I was wondering if someone had a method to rebuild indexes automatically, based on the results of 'dbcc showcontig'. I want to automate index rebuilding by using the results of 'dbcc showcontig with tableresults' into a table. Then i want to query the results which indexes have a logical and extent ...
Score Drop tables where name matches a pattern
lmcphee - 11 May 2006 2:41 PM - 3 messages
I have an arbitrary number of tables in a SQL2000 db with names matching 'MyTable_%'. Is there a simple way of dropping these with a SQL command? LMcPhee ...
Score View dependencies
news.microsoft.com - 11 May 2006 2:26 PM - 4 messages
Hi Folks, I need to get a report of all my views and their dependencies. I know I can check this by right clicking and chosing Delete, then Check Dependencies, but I dont want to use this procedure as its dangerous and I want the whole ...
Score decimal division precision
kh - 11 May 2006 2:08 PM - 6 messages
in my understanding of fixed numeric types and datatype precision rules, dividing two decimals with identical precision/scale should result in a decimal outcome with the same precision/scale. however, i run the following in query analyzer: declare @price decimal(38,10) ...
Score Finding all "DEFAULT" constraints on a table using Information_Sch
DoubleBlackDiamond - 11 May 2006 2:06 PM - 4 messages
I have a couple stored procedures in which I am trying to determine all of the "Default" constraints that are on a given table.  I know that this information is available in the sysobjects table, but I'm trying to avoid ...
Score urgent about exec function
amjad - 11 May 2006 1:51 PM - 5 messages
is their any way to get result from EXEC function like if i send a query suppos select then i want to check is it return 0 record or more than 0 without using cursor thanks like count=exec @sql ...
Score hi
amjad - 11 May 2006 1:49 PM - 2 messages
is their any way to get result from EXEC function like if i send a query suppos select then i want to check is it return 0 record or more than 0 without using cursor thanks like count=exec @sql ...
Score Creating crosstab, in Sql r 3GL?
rvgrahamsevatenein - 11 May 2006 1:31 PM - 3 messages
I have a program that creates and manages apartment buildings for construction management software. Previously, I had a stored procedure that, when handed a building name with floor count and units per floor integer, created a flat table with 5 columns for each room (one will ...
Score Query over two columns
Macca - 11 May 2006 1:24 PM - 4 messages
Hi, I have a table that includes two Datetime columns. The first column holds the date. e.g 2006/5/10 and the second column holds time e,g 08:15:25. I am having a problems specifing a query that will list the rows in the ...
Score SMO Install Files
Amos Soma - 11 May 2006 1:11 PM - 2 messages
Does anyone know if Microsoft has released an installation package for SMO? The reason is as follows. In a .NET  app we have, we reference SMO files. The server this app is running on does not have SQL 2005 installed, and we ...
Score Need help to calculate time difference between two columns!
bqirici - 11 May 2006 12:57 PM - 5 messages
Hi! I need some help to calculate the time difference between two columns, Start_time and End_time. The column values represent the employees' start/end working hours and are stored as varchar(10) in the format hh:mm. Therefore i would like to subtract the start time from ...
Score mildly complex query. need senior dba advise.
robert@relate.com.au - 11 May 2006 12:23 PM - 7 messages
Hi there, I have this stored procedure I am trying to optimize: CREATE PROCEDURE uspLeaderboardStateResults     @StateID    int AS BEGIN     CREATE TABLE #ResultsOutput (         rowID         int   not null  identity(1,1), ...
Score How to run query between two databases
amjad - 11 May 2006 12:02 PM - 4 messages
Hi i have query which i need to join it like i am doing some thing like Select [a].[dbo].[tbla].* From  [a].[dbo].[tbla] INNER  INNER JOIN                       [B].[dbo].[tblB ON [a].[dbo].[tbla].[ID] = ...
Score Query Syntax
marcmc - 11 May 2006 11:30 AM - 7 messages
I am looking to find records that share the same Policy_Desc but have different Policy_ids. I know there are records that fit this criteria but for some reason this query returns zero rows. SELECT    Policy_Desc, Policy_id FROM     Policy_Table AS Outside ...
Score Move a user database log file
Yan - 11 May 2006 9:58 AM - 3 messages
Hi, SQL 2000 sp3a How do I change the phisical location of the transaction log file? Thanks, Yan ...
Score latest data for different dates
Pradeep - 11 May 2006 9:13 AM - 4 messages
I have two tables Well status Date,wellid,gas 1/5,A,10 1/5,B,20 2/5,A,11 2/5,B,19 1/5,A,10 2/5,B,21 Well test Date,wellid,gas 20/4,A,10 ...
,
Next »