all groups > sql server programming > september 2007 > threads for thursday september 13
Filter by Day: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
Converting a MS Access database to SQL Server
Posted by Peter Olcott at 9/13/2007 10:20:14 PM
Does anyone know how to convert an MS Access database to SQL
Server using SQL Server 2005?
... more >>
SQL Server 2005 Import Wizard?
Posted by Peter Olcott at 9/13/2007 9:17:57 PM
How do I get to the SQL Server 2005 Import Wizard?
... more >>
Conditional select
Posted by Robert Bravery at 9/13/2007 9:05:18 PM
HI all,
I am trying to build aconditional select statement. I am hoping to stay
clear of dynamic sql, as the query, or at least SP is quite long.
In essance there is one parameter with a select statement, the a bunch of
joins and unions, based on the value of the select statement, THe example
... more >>
Conditional select
Posted by Robert Bravery at 9/13/2007 9:01:11 PM
HI all,
I am trying to build aconditional select statement. I am hoping to stay
clear of dynamic sql, as the query, or at least SP is quite long.
In essance there is one parameter with a select statement, the a bunch of
joins and unions, based on the value of the select statement, THe exampl... more >>
error with 'SqlDbType' all the sudden, without changing/was working... Options
Posted by trint at 9/13/2007 4:47:13 PM
This code was working just fine and all of the sudden, I get this
error on 'SqlDbType':
"The name 'SqlDbType' does not exist in the current context"
Here is the code where it happens:
conn = new SqlConnection(strconnection);
cmd = new SqlCommand(strsqlinsert, conn);
... more >>
Is DBCC DBREINDEX logged?
Posted by Samuel at 9/13/2007 4:06:01 PM
On my SQL Server, I have a database maintenance plan (using SQL Server 2000
maintenance wizard) which does optimization for a particular database. The
job creates a huge 21 GB Transaction Log backup file. The optimization job
runs weekly. The Transaction Log backup runs every 15 minutes.
... more >>
Alter using osql
Posted by Ryan at 9/13/2007 3:18:02 PM
Currently, PaymentDate in my table is a SMALLDATETIME and NULL is allowed. I
would like to alter PaymentDate column to be NOT NULL and set its default
value to current date.
I am using the following osql command but it generated an error; could
someone please help?
ALTER COLUMN PaymentD... more >>
Extracting numbers
Posted by Harold Moorhead at 9/13/2007 2:44:02 PM
I have a need to remove phone numbers from database tables that contain text
and numbers. The following query does what I need, but it only works on the
text entered in line 3 SET command. I need to read a table and do this same
thing. Does anyone know how I would need to adapt it?
DEC... more >>
Don't see what you're looking for? Search DevelopmentNow.com.
SQL Query Help: Need to remove consecutive items and just keep the earliest
Posted by Arthur Dent at 9/13/2007 2:27:55 PM
I could really use some help with this problem. Think of a help desk
ticket database scenario. There is an audit/event log that captures
changes and timestamps when ticket records are updated. One of those
changes is when a ticket is reassigned/dispatched to another group.
For example, say a ... more >>
T-SQL programming practices
Posted by ktrock at 9/13/2007 2:20:03 PM
Hello. I have a small issue with co-workers about prefixing all columns when
constructing queries that use multiple tables.
Select c.Name, o.Qty From Customer c Inner Join Orders o On o.CustId =
c.CustId
Here I prefix the requested columns even though it may be obvious where they
come fr... more >>
Linked Servers Issue - NT AUTHORITY\ANONYMOUS LOGON message
Posted by at 9/13/2007 1:54:34 PM
I have two servers on the same doman; one with sql server 2000 and one
on 2005. They are both set up appropriately with linked servers, at
least to my knowledge. I've googled my problem only to try setting up
new logins, granting the [NT Authority\System] login access, receive
answers for web ... more >>
EXISTS(SELECT * .) VS EXISTS(SELECT TOP 1..)
Posted by Max2006 at 9/13/2007 1:48:08 PM
Hi,
Considering the outcome of this analysis:
http://milambda.blogspot.com/2006/10/exists-or-not-exists-that-is-question.html
Why do we have EXISTS(SELECT TOP 1..) in ASP.NET 2.0 membership stored
procedures? (for example: aspnet_AnyDataInTables)
Thanks you,
Max
... more >>
Basic Query Problem
Posted by Mark at 9/13/2007 1:22:20 PM
Thanks in Advance,
I have what should be a simple problem which is eluding me. I have to
find identical invoice numbers and amounts (both have to match) that
reside in four tables on different databases. I can get this far:
SELECT inv_no, amt
... more >>
using AVG and STDEVP together
Posted by rlynn at 9/13/2007 12:52:01 PM
i am having a heck of a time syntactically... very simple table (keydate,
keytype,keyvalue) i need to calculate the 10, 30, 90-day and 1-year averages
of keyvalue, per keytype, and then insert the results into another table.
i have to then do the same with 10, 30, 90-day and 1yr StDevP's
i... more >>
Using sp_OAMethod to call a COM component built by a 3rd party FAI
Posted by Larry Sitka at 9/13/2007 12:14:01 PM
EXEC @intHResult = sp_OACreate 'DetagCOM.Detagger.1', @intObject OUT
SUCCESSFULLY CALLED
EXEC @intHResult = sp_OAMethod @intObject , 'Allocate' , @intHandle OUT
SUCCESSFULLY CALLED
--- VENDORS IMPL ON CALL
DetaggerCOM_Eval.DetaggerClass.DoStringConvert(int, int, string, out string,
ou... more >>
Dynamic Update Statement
Posted by John Wright at 9/13/2007 11:56:21 AM
I want to create the following Stored Proc (see proc code) to update any
table and column in my database. I want to pass in the table name, the
column to update and the value to update. However, when I compile this I
get the error "Must declare the variable @TableName" error. Can I write a ... more >>
Data Migration Using DTS Packages
Posted by contactcharu NO[at]SPAM gmail.com at 9/13/2007 11:41:58 AM
Hi
I have a DTS Package with which I am migrating data from One SQL
Server Database to Another. As of now both Source and Destination
Database are on same server and no one is accessing the server from
the network. The problem is that when I run the package on the same
source database and emp... more >>
Replication issues after a Database Restore - Unable to drop or create Transactional Replication
Posted by Query Builder at 9/13/2007 10:01:29 AM
Hi,
I have transactional replication set up on on of our MS SQL 2000 (SP4)
Std Edition database server
Because of an unfortunate scenario, I had to restore one of the
publication databases. I scripted the replication module and dropped
the publication first. Then did a full restore.
When... more >>
Decimal Data type problem
Posted by RJ at 9/13/2007 9:16:06 AM
SQL Server 2000 SP4
I am having truncation / rounding issues in a stored procedure using
decimal(9,2)
ALTER PROCEDURE spim_Calc_Test (@Amount Decimal(9,2))
AS
Select @Amount
Return
When I run this with an input amount of 100.75 it returns with 100.
There has got to be something... more >>
Conflicting cursors?
Posted by francis.moore NO[at]SPAM gmail.com at 9/13/2007 9:01:39 AM
Hi,
I'm getting the following error when I run a stored proc on SQL Server
2005:
Msg 16915, Level 16, State 1, Procedure ExportIPs, Line 70
A cursor with the name 'app' already exists.
Msg 16905, Level 16, State 1, Procedure ExportIPs, Line 72
The cursor is already open.
But the code ha... more >>
Adding column to huge table
Posted by Lero at 9/13/2007 8:22:00 AM
I have a huge table with 21 GB and would like to know the best pratice to add
a column to it. This morning we runned the "alter table add" and the server
stopped responding as the query lasts running for more than 4 hours. The
problem here is not exactly the time, but the way to minimize the ... more >>
Fastest way to insert a large amount of data
Posted by Henning Friese at 9/13/2007 8:11:45 AM
Hello NG,
I have to insert a huge load (~800000 rows) of data from csv-files
into a mssql-database (SQL-Server 2005). Bulk inserts are not an
option unfortunately.
I'm doing this with a little c#-app I wrote. The first ~50000 rows are
processed rather quickly but after that things get slowe... more >>
Trigger Question
Posted by David Olsen at 9/13/2007 8:10:36 AM
CREATE TABLE [dbo].[Players](
[PlayerID] [nchar](10) NOT NULL,
[LastName] [nchar](15) NULL,
[FirstName] [nchar](15) NULL,
[BirthDate] [datetime] NULL,
[BirthCity] [nchar](15) NULL,
[BirthSt] [nchar](2) NULL,
[DebutYear] [int] NULL,
[College] [nchar](25) NOT NU... more >>
error seting a column to not null
Posted by hals_left at 9/13/2007 7:14:29 AM
Any ideas why this doesnt work? there are no null values
alter table myTable
alter Column Created smalldatetime NOT NULL DEFAULT GetDate()
GO
Server: Msg 170, Level 15, State 1, Line 2
Line 2: Incorrect syntax near 'DEFAULT'.
... more >>
SELECT ... FOR XML
Posted by weileogao NO[at]SPAM gmail.com at 9/13/2007 6:52:22 AM
select ... for xml statement can transfer the relational table result
to xml, but how can I get this result? For example, if I have a
variable @xml as varchar(4000), how can I assign this xml value to it?
Wei
... more >>
Does table exist (meta data)
Posted by DelphiDeveloper at 9/13/2007 6:50:03 AM
I want to know if a particular table exists. I assume there is a SP to
return the meta-data of a database but I cannot find it.
Can someone help me?... more >>
Ececute function
Posted by marianowic at 9/13/2007 5:38:36 AM
Hello.
All day I'm trying to execute my function, which name and parameteres
are in a VARCHAR varibale using a EXEC statement. And then I want to
assigned returned value to some variable. I couldn't find any examples
about it, so maybe anyone know how to do it.
Below I pasted a sample code to e... more >>
Question about expression in Views
Posted by Karl at 9/13/2007 5:27:27 AM
Hello,
I use the following expression in a view: 'Ruhend seit: ' +
CONVERT(varchar(10), dbo.tbl_VerfW.dtRuhVon, 104) +
', Ruhensgrund: ' + dbo.tbl_RuhGrund.txtRuhGrund AS txtRuhen. This
runs very well, however, if one of the fields is empty, the result of
the expression al... more >>
Open XML Issue
Posted by Rahul at 9/13/2007 5:16:25 AM
Hi,
I have following senario.
(Same XML Tags). How we can read it.
declare @idoc int
declare @doc varchar(Max)
set @doc =
'<ROW>
<COL>20060701</COL>
<COL>Payment</COL>
<COL>PC/06/07/002</COL>
<COL>-5000.00</COL>
<COL/>
<COL/>
<COL/>
</ROW>'
exec sp_xml_preparedocum... more >>
Deadlock in query that uses table variables and temporary tables
Posted by Ian Hannah at 9/13/2007 2:24:02 AM
We are running SQL Server 2005 SP 2 (Build 9.0.3042). We are running a query
in SQL Server 2005 that makes use of temporary tables and table variables.
Occasionally a call to this query locks up and subsequent calls timeout. The
only way to get out of this is to restart SQL Server which is a r... more >>
sa password locked out
Posted by at 9/13/2007 12:00:00 AM
I have a password for sa that has all four of the criteria for a
password (where only 3 are required) yet I am still being constantly
locked out of sa when enforce password policy is enforced. Any ideas
how to troubleshoot this or at least get a more specific error message
on why it's being lo... more >>
Can You Program?
Posted by hatspin NO[at]SPAM gmail.com at 9/13/2007 12:00:00 AM
We are offering $2000 USD for the best website developed with www.hatspin.com
Are you up to it??
... more >>
|