all groups > sql server programming > recent posts
RE: Issues on restoring a database with SMO
Posted by Wouter at 4/24/2008 1:46:56 AM
Post 2/2
And the other issue:
If I want to do a LogRestore after this FullRestore method, I do something like this in my main method:
DoFulLRestore(currentRequest, false)
where false indicates the FinalStep value, indicating that there is a log restore being followed, so the .NoRecove... more >>
Issues on restoring a database with SMO
Posted by Wouter at 4/24/2008 1:45:50 AM
Hello all,
I'm having some issues with restoring databases through SMO in a vb.net application.
The restores always happen from the same SQL version, so 2000 -> 2000, 2005 -> 2005.
There are two issues I just can't seem to get fixed...
The code shown below is written to function with a cen... more >>
RE: Sql Server text header has some problem.
Posted by Muralikrishna Reddy at 4/6/2008 4:42:15 AM
I have solved this problem like this:
My procedure was having hearder comments as follows.
/*===================================================
Author : Muralikrishna Reddy
Create date : 01-Sept-2007
Description : /* sdfsdff sdfsdf sdfsdfsd */
=====================... more >>
RE: SSIS Package fails with Cannot open the datafile on large flat fil
Posted by John Arnott at 2/23/2008 1:19:54 AM
This problem could be caused by the task that reads the file (your dataflow) may be starting before the entire 2GB file has been written. There may be an entry in the directory for it, which would trigger a WMI watch task for instance, but until the entire file is written, an attempt to open it woul... more >>
SQLServer 2005 - Reporting Services
Posted by Jacques at 2/7/2008 11:57:54 AM
When trying to generate a model, I get the following message "ParentKey and ChildKey are identical" There are currently 120 tables in my database. How can I identify which table(s) have identical parent and child keys?
From http://www.developmentnow.com/g/113_2007_11_0_0_0/sql-server-programming.ht... more >>
passing column to a function
Posted by ahmet gulbas at 1/31/2008 8:52:48 AM
hi. is there a way to pass columns as parameters to a function? (for mssql 2000 server)
my query is something like that:
select tb1.* from tb1
inner join tb2 on tb1.c2=tb2.c1
where tb1.c1 in
(
select * from dbo.fn_Split(tb2.c2,',')
)
error: c2 is not recognized OPTIMIZER LOCK HINTS ... more >>
RE: Date Time?
Posted by Robert Durgin at 1/18/2008 10:15:35 AM
Try adding 1 day to @EndDate. WHEN using between and puting in a date '1/18/2008' for example, sql server assumes '1/18/2008 12:00:00 AM' when performing a comparrision.
From http://www.developmentnow.com/g/113_2003_7_0_0_411955/Date-Time.htm
Posted via DevelopmentNow.com Groups
http://www.develop... more >>
RE: Index Tuning Wizard problem
Posted by Moroni at 12/3/2007 12:19:54 PM
@Jasper
@Sky Fly
Thanks men!
I've found a table named with a single quote that was causing the error on ITW!
Almost 4 years later and MS hasn't fixed the bug.
Best Regards!
Posted via DevelopmentNow.com Groups
http://www.developmentnow.com... more >>
Don't see what you're looking for? Search DevelopmentNow.com.
join table
Posted by joey at 11/22/2007 6:30:31 PM
I've two tables where their composite keys are foreign keys that references each other.
table1 (projId, userId, name, add)
table2 (projId, userId, status, responseDate, reason)
I need to retrieve table1(name,add) and table2( status, responseDate, reason) with projId only..
my query is
Se... more >>
Make Column Case-sensitive
Posted by serene joey at 11/21/2007 4:35:47 PM
I'm working on a web-based app where my database is using SQL Server.
I have two columns which I need to set it to case-sensitive, such as password and code.
I read some articles and found collation.
Is that the right one?
But I'm not sure how to use them, can anyone please help me?
Than... more >>
RE: Job Activity Monitor tool
Posted by NormK at 11/14/2007 10:51:45 AM
Aaron wrote:
"sysjobhistory will have run_status = 0 AND [message] LIKE 'The job failed.%'
where step_id = 0 and job_id = x."
Does run_status correlate with the return code of sp_help_jobactivity? If so, then run_status = 0 indicates success. Is there a query I can run that will give a num... more >>
How to use dynamic Order By Clause in a stored procedure?
Posted by Andrew at 11/3/2007 7:56:01 AM
Hello, friends,
We are using C#.net and SQL Server 2000, and using stored procedures to
retrieve records. However, with a new feature we are developing now, we need
to sort the records based on user's selections.
So, the Order By clause will be dynamic. Is there a way that a stored
proce... more >>
Re: summation of current and previous column???
Posted by Dan Guzman at 11/3/2007 7:55:27 AM
> I mean I want to sum a column with previous column..
> how can I do that?
One method to calculate a running total is with a subquery:
CREATE TABLE dbo.MyTable
(
[Code] int NOT NULL
CONSTRAINT PK_MyTable PRIMARY KEY,
[Value] int NOT NULL
)
INSERT INTO dbo.MyTable
SEL... more >>
Re: parameters for where clause for stored procedure
Posted by Dan Guzman at 11/3/2007 7:46:40 AM
> Is
> there a way in the where clause to define it so the where clause can take
> a
> parameter what ever its value and for the null not restrict the search.
One method is to use COALESCE:
WHERE [date]=COALESCE(@DateTimeParameter, [date])
For a more thorough discussion of this and othe... more >>
Re: hmmmmmmmmmm
Posted by Geoff Schaller at 11/3/2007 7:35:17 AM
Well said.
Often the 'real world'... you know, the one where people pay you money
to implement their ideas... dictates how things will look. Often it is
not pretty, often it is not efficient from the purist's sense. But it
works and it deals with the real world in ways they are familiar.
... more >>
Re: Cursors and Exec Plans
Posted by Geoff Schaller at 11/3/2007 7:27:48 AM
CLM,
I think you are looking at this the wrong way.
Cursors are not 'bad' at all... at least no less useful than any tool
used for the job in which they were intended. Indexes are 'bad' if you
have too many. Normalisation is 'bad' if you over do it. Cursors have an
important place in cre... more >>
Searching on Dates
Posted by maa at 11/3/2007 7:13:01 AM
I want to search on the max date in db based on an input date and use that to
find foreign key on that field to search another table.
Select max(version_id) from T1 where date<@date1
select * from T2 where T2.version=max(version_id)
I am working in Sql 2000 and want to be able to use a ... more >>
parameters for where clause for stored procedure
Posted by maa at 11/3/2007 5:31:00 AM
I have parameters to a stored procedure that may be null or have a value. In
the case of a null value the search is not to be using that parameter. Is
there a way in the where clause to define it so the where clause can take a
parameter what ever its value and for the null not restrict the s... more >>
decimal and money type conversion
Posted by John at 11/3/2007 12:00:00 AM
Hello,
Is there a way to tell SQL to take e.g. '2,500.50' string and convert
implicitly it to decimal? The column type is decimal (19,5). If I have
columns of type 'money' it does that conversion with no problem. Or if there
is a way to change precision of 'money' type?
thanks
... more >>
Hierarchy
Posted by Tempera at 11/3/2007 12:00:00 AM
I have table:
ItemId, ItemName, ParentId, FullPath
eg:
1, null, first, first
2, 1, second, first/second
3,2, third, third/second
.... and so on, no limit for depth
now, when i update name of "item", i need to update FullPath of all "item"
's children
How to do it?
Recursion, trigg... more >>
Re: summation of current and previous column???
Posted by perspolis at 11/3/2007 12:00:00 AM
thanks.
"Dan Guzman" <guzmanda@nospam-online.sbcglobal.net> wrote in message
news:D79D683A-235C-45EB-934C-7AECB4F2AFE6@microsoft.com...
>> I mean I want to sum a column with previous column..
>> how can I do that?
>
> One method to calculate a running total is with a subquery:
>
> CREATE ... more >>
summation of current and previous column???
Posted by perspolis at 11/3/2007 12:00:00 AM
Hi all
I have a table like this
Code Value
1 1000
2 2000
3 -500
I want to write a query that returns like following output:
Code Value Total
1 1000 1000
2 2000 3000
3 -500 2500
I mean I want to sum a colum... more >>
Re: Setting Maximum Column length in Stored Procedure
Posted by Erland Sommarskog at 11/3/2007 12:00:00 AM
Jeff Swanberg (j_swanberg@msn.com) writes:
> This only works in Query Analyzer, though, if I go to
> Tools-Options-Results and change the "Maximum characters per column"
> value to 7000. If I don't, then the only value that gets put into
> TableA's ATTENDANCE column is the first 256 characters ... more >>
Re: Cursors and Exec Plans
Posted by Mr Tea at 11/3/2007 12:00:00 AM
/*
on cursors:
Say you had 5 million customer OLTP environment that was operational 24/7,
you had just received a data clensing update for postcode/address
correction. How would you update your customer database with the new
addresses ?
Although a set based approach would work, You might ... more >>
Re: Cursors and Exec Plans
Posted by Erland Sommarskog at 11/3/2007 12:00:00 AM
CLM (CLM@discussions.microsoft.com) writes:
> I just read something surprising in my 2005 cert study materials: Sql
> Server cannot generate an execution plan for a cursor. Is that really
> true? I knew cursors were a bad idea, because they're not set-based,
> etc., but I didn't realize that ... more >>
Re: please solve my query
Posted by Hugo Kornelis at 11/2/2007 11:51:21 PM
On Thu, 01 Nov 2007 23:37:51 -0700, pradeep kumar wrote:
>hello,
>sir,
>i am pradeep kumar. i am make a long project of fee management then use a "insert query" with two table on particular row with where condition then not run this query. error is invaild "where" keyword please give me anwser ... more >>
Re: Update Table field via Stored Procedure
Posted by Hugo Kornelis at 11/2/2007 11:50:25 PM
On Thu, 1 Nov 2007 17:36:01 -0700, RBC wrote:
>Dear to Whom this Concern,
>
>Could some one learn me how I could update my table field via stored
>procedure?
Hi Rune,
UPDATE MyTable
SET MyColumn = @NewValue
WHERE KeyColumn = @KeyValue;
>I have a stored procedure that generates ... more >>
Re: hmmmmmmmmmm
Posted by Hugo Kornelis at 11/2/2007 11:48:54 PM
On Fri, 02 Nov 2007 10:23:55 -0700, --CELKO-- wrote:
>>> I have to ask, if the natural key crowd don't have answers to these questions, why do they still use them? <<
>
>Validation and verification. Consider a VIN on your automobile. No
>matter where I go on the entire planet, it identifies ... more >>
Re: hmmmmmmmmmm
Posted by Hugo Kornelis at 11/2/2007 11:44:36 PM
On Fri, 02 Nov 2007 10:38:13 -0700, --CELKO-- wrote:
>>> For implementation, I prefer using identities for surrogates - they're solid (as long as the column is constrained to be unique), they're efficient, and they generate quickly (I don't have to roll my own). <<
>
>Solid?? You are being loca... more >>
Re: hmmmmmmmmmm
Posted by Hugo Kornelis at 11/2/2007 11:41:56 PM
On Fri, 2 Nov 2007 21:15:31 +1100, Michael C wrote:
>"Michael C" <mike@nospam.com> wrote in message
>news:%23tomOr2GIHA.2328@TK2MSFTNGP03.phx.gbl...
>> "Q7: I would like to change my user name, how can I do it?
>> A: Unfortunately, it is not possible due to technical reasons (because of
>> ... more >>
|