Showing posts with label example. Show all posts
Showing posts with label example. Show all posts

Wednesday, March 28, 2012

More MSDE Installation Problems.

I too am having problems with MSDE with VS.NET. I am trying to install the Dunwamish Enterprise Example App and I keep getting the following error: "[DBNETLIB][ConnectionOpen (Connect()).] SQL Server does not exist or access denied." Also, most of the exa
mples refer to the PUBS database which I can't find anywhere. Did it not come wrapped up in MSDE?
I have W2K Pro, Visual Studio .NET 2003, MSDE loaded v8.00.760. Is there anybody out there that can help a .NET newbie out. The guy the company had hired to come in here and start our .NET efforts has quit and dumped all this in my lap. I am familiar with
Visual Studio 6; however, we hav always used Sybase Anywhere before. Any help will be appreciated.
Kenneth A. Jinks, Jr.
Lead Project Software Engineer
LabCorp CPG - LCM Development
Huntsville, AL
> examples refer to the PUBS database which I can't find anywhere.
http://www.microsoft.com/sql/downloads/default.asp#code
http://tinyurl.com/2oyvh
Maybe you didn't permit network access, set a sa-password, didn't disable
antivirus or anything like that?
Regards,
Lars-Inge Tnnessen
www.larsinge.com

Friday, March 23, 2012

month end date...

Hello:
If I have middle month date ,
for example '2005-04-22',
how can I get end month date, in this case
'2005-04-30'?
I need a solution for any date.
Thanks,
GBTry:
dateadd(d, -(day(@.dt)),@.dt)
"GB" <v7v1k3@.hotmail.com> wrote in message
news:ro2Pf.22370$Ui.5143@.edtnps84...
> Hello:
> If I have middle month date ,
> for example '2005-04-22',
> how can I get end month date, in this case
> '2005-04-30'?
> I need a solution for any date.
> Thanks,
> GB|||DECLARE @.date SMALLDATETIME;
SET @.date = '20050422';
DECLARE @.start SMALLDATETIME, @.endDay SMALLDATETIME;
SET @.start = DATEDIFF(DAY,0,@.date);
SET @.endDay = DATEADD(MONTH,1,@.date)-DAY(@.start);
SELECT @.endDay;
"GB" <v7v1k3@.hotmail.com> wrote in message
news:ro2Pf.22370$Ui.5143@.edtnps84...
> Hello:
> If I have middle month date ,
> for example '2005-04-22',
> how can I get end month date, in this case
> '2005-04-30'?
> I need a solution for any date.
> Thanks,
> GB
>|||mason, that gives the last day of the *previous* month...
"mason" <masonliu@.msn.com> wrote in message
news:%23EIDutWQGHA.1676@.TK2MSFTNGP14.phx.gbl...
> Try:
> dateadd(d, -(day(@.dt)),@.dt)
>
> "GB" <v7v1k3@.hotmail.com> wrote in message
> news:ro2Pf.22370$Ui.5143@.edtnps84...
>|||This solution gives PREVIOUS month date,
for '2005-04-22' it gives '2005-03-31'
I need current month end date, in this case '2005-04-30'.
Thanks,
GB
"mason" <masonliu@.msn.com> wrote in message
news:%23EIDutWQGHA.1676@.TK2MSFTNGP14.phx.gbl...
> Try:
> dateadd(d, -(day(@.dt)),@.dt)
>
> "GB" <v7v1k3@.hotmail.com> wrote in message
> news:ro2Pf.22370$Ui.5143@.edtnps84...
>|||Misfire. :p
dateadd(d, - (day(dateadd(m,1,@.dt))),dateadd(m,1,@.dt)
)
"Aaron Bertrand [SQL Server MVP]" <ten.xoc@.dnartreb.noraa> wrote in message
news:eEPYvyWQGHA.5092@.TK2MSFTNGP11.phx.gbl...
> mason, that gives the last day of the *previous* month...
>
> "mason" <masonliu@.msn.com> wrote in message
> news:%23EIDutWQGHA.1676@.TK2MSFTNGP14.phx.gbl...

month and 2 digit year

How can I get the month and 2 digit year from a date? For example, how could
I return the month/year like my DESIRED RESULTS 1 & 2 below? Both examples
equal January, 2005? DATEPART seems to only allow 4 digit years.
CODE:
SELECT DATEPART(yy, GETDATE())
Desired Results 1: 05-1
Desired Results 2: 1-051.
SELECT REPLACE(LEFT(CONVERT(char(8), GETDATE(), 2),5),'.','-')
2.
SELECT RIGHT(CONVERT(char(8), GETDATE(), 5),5)
"Scott" wrote:

> How can I get the month and 2 digit year from a date? For example, how cou
ld
> I return the month/year like my DESIRED RESULTS 1 & 2 below? Both examples
> equal January, 2005? DATEPART seems to only allow 4 digit years.
>
> CODE:
> SELECT DATEPART(yy, GETDATE())
> Desired Results 1: 05-1
> Desired Results 2: 1-05
>
>

Wednesday, March 21, 2012

Monster Replication

I'm trying to replicate databases from 7 serves into one main one. For example say data from servers A, B, C, D, E, F, G go into one main server, say, server Z. I'm using snapshot replication method. The final outcome of this replication should be as follows: Each server has tables in it, when these tables are replicated into Server Z, I want to add extra field in the table (on Server Z). This field will represent where the record came from, ie, either Server A,B.. etc. I cant add the extra column in the Publisher server tables (Server A,B..etc). The column MUST be added in the final replicated table on server Z.

Has ne one out there done sumthing similar to this? If so please help me out with. I've been struggling with this for a while now. So any kind of help will be appreciated.

Thanks in advance.can you use a separate non-replicated table on server z to perform the final insert from 7 tables using a union and adding this addition field at the time of select for each section of the union?|||You could use merge replication with horizontal filters. Add field hostname and use function host_name() for filtering on publisher.
Your main db will be publisher - another dbs - pull subscribers. Use guid (uniqueidentifier ) as id for all tables. This schema is working fine in one of my projects.|||but my understanding was that it's a reverse, - there are 7 publishers and 1 subscriber. plus, i don't think he is considering total system overhaul (changing structures, guids, etc.)|||Originally posted by snail
You could use merge replication with horizontal filters. Add field hostname and use function host_name() for filtering on publisher.
Your main db will be publisher - another dbs - pull subscribers. Use guid (uniqueidentifier ) as id for all tables. This schema is working fine in one of my projects.

So this idea has already been tested?... Newayz, the guid (uniqueidentifier) column would be default as newid() rite? Well I want a certain value to go in the column depending on the server the record came from.

Since you have done this kinda thing b4, i'd be askin alot of questions ... =)

Thanks in advance.

Monday, March 12, 2012

Monitoring Filegroup Space

Does anyone know of a way to predict that the files in a filegroup do not
have enough space left to expand? For example, a file has 3753 MB out of a
maxsize of 4096, with a file growth of 10%. Adding 10% to 3753 will exceed
the max file size, so there is no room to expand even though technically
there is space available. There are 80 such files in the filegroup and so i
t
can be deceptive when you look at the total number of MB left.Hi Eydba,
Welcome to the MSDN newsgroup.
Regarding on the filegroup space question you mentiond, based on my
research, I'm afraid so far there is not such built-in feature which can
help detect the potential exceeding of the file size in filegroup. Also,
there is no similiar trigger or notification on this. For make the
filegroup filesize among appropriate range, you can have a look some
related performance tuning articles:
#Optimizing SQL Server Performance by using File and Filegroups
http://www.mssqlcity.com/Articles/T...leOptimTips.htm
Regards,
Steven Cheng
Microsoft Online Community Support
========================================
==========
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
========================================
==========
This posting is provided "AS IS" with no warranties, and confers no rights.|||As noted, there's no way SQL Server triggers this itself, but you can
set up monitoring around it.
Option 1: Write a stored procedure that checks this, run it from a
scheduled sql job, and monitor for failure. The info you need to do the
math is returned by sp_helpfile.
Option 2: Write a small .NET application that connects through the SMO.
Through the SMO you can retrieve the file size, growth setting, and max
size and then do some math and write to the event log or throw an alert
another way if it doesn't have room to grow.
Any way you did it, you need to run DBCC updateusage frequently for the
estimates of space used to be accurate.
-Kendra

Friday, March 9, 2012

Monitoring

Hi ,
Is there a way/tool in Sql Server 2000 SP3 to
monitor all activities going on in the Database ?
For example, I first create an empty database.
Then I have an ERWIN generated DDL to create
all views and tables. After that, I have INSERT
scripts that populate all the base tables. What I
want to monitor is success or failure for each
script.

Thanks,
N.N (N@.N.COM) writes:
> Is there a way/tool in Sql Server 2000 SP3 to
> monitor all activities going on in the Database ?
> For example, I first create an empty database.
> Then I have an ERWIN generated DDL to create
> all views and tables. After that, I have INSERT
> scripts that populate all the base tables. What I
> want to monitor is success or failure for each
> script.

The tool you are looking for is the Profiler. Look in the SQL Server
program group.

However, to check the output from build scripts, I think it's best to
save the log, and then search the output for the string "Msg".

--
Erland Sommarskog, SQL Server MVP, sommar@.algonet.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp|||"N" <N@.N.COM> wrote in message news:<17xUb.21778$_f.2385@.newssvr25.news.prodigy.com>...
> Hi ,
> Is there a way/tool in Sql Server 2000 SP3 to
> monitor all activities going on in the Database ?
> For example, I first create an empty database.
> Then I have an ERWIN generated DDL to create
> all views and tables. After that, I have INSERT
> scripts that populate all the base tables. What I
> want to monitor is success or failure for each
> script.
> Thanks,
> N.

You can use Profiler to view all SQL being sent to the database, but
it sounds like you want to add error handling to your scripts? How to
do that would depend how you run the scripts - eg. if you're using
osql, then -r might be useful. Perhaps if you can give some extra
information about how you call the scripts, and an example of the
code, then someone may be able to suggest something specific.

Simon

Wednesday, March 7, 2012

Monitor Index Usage.

Hi,
Is there any tool out there that can monitor what indexes are being used in
SQL Server? Example a filter in SQL Server Profiler for index usage?
Marcel
mpighin wrote:
> Hi,
> Is there any tool out there that can monitor what indexes are being
> used in SQL Server? Example a filter in SQL Server Profiler for index
> usage?
I don't know a direct way at the moment, but you can get Profiler to write
text execution plans and search them for your index's name. HTH
Kind regards
robert

Monday, February 20, 2012

money format

Hi.
I have a money field and its value is greater than a thousand.For example its value = 32.885,60
I want to show the field's format like this (this number's format).
I mean the thousand separator should be .(dot) and the decimal separator should be ,(comma)
And I want two digit after the decimal separator.All these conditions matches with this number(32.885,60)
Could you help me?

hi muhsin,

write an embeddede function which returns your amount like this: amount.ToString("N")

|||

Dear,

Write the embedded fucntion (=format(field,'fomat')

HT

from

sufian

|||Can you write for me please?
I tried but it didn't work.
What should I write in the format style area?|||

Could you format the string in code and then do a string replace to replace the , with a . and the . with a ,?

|||

Hi Muhsin,

sorry this isn't an answer for you, but very curious as to the currency you are working in?

I am used to formatting it the other way around (32,885.60)

99

|||

this is your function:

shared function GetCurrencyFormat(byVal Amount As Double) As String

return Amount.ToString("N")

end function

to call the function go to your layout and write in the cell or textbox or whatever the following:

=Code.GetCurrencyFormat(Amount)

thats it

|||

SpaceCadet wrote:

this is your function:

shared function GetCurrencyFormat(byVal Amount As Double) As String

return Amount.ToString("N")

end function

to call the function go to your layout and write in the cell or textbox or whatever the following:

=Code.GetCurrencyFormat(Amount)

thats it

But this is not I want.
This is already a format in the properties of the textbox.
You don't need to write a function for this.
I want the thousand seperator to be dot and the decimal seperator to be comma.
Your solution's result is for example 15,250.30.
But I want 15.250,30.
Thanks anyway.
If you find another solution , please share it with me!|||You can accomplish this by adjusting the Language property for the textbox, or the entire report to a language that uses this format. The language settings can be specific to just number formats when just setting the NumeralLanguage property on the textbox. After setting these properties, just use "N" as the format code.

See the following link for more information about International Considerations for Reporting Services:
http://msdn2.microsoft.com/en-us/library/ms156493.aspx

money format

Hi.
I have a money field and its value is greater than a thousand.For example its value = 32.885,60
I want to show the field's format like this (this number's format).
I mean the thousand separator should be .(dot) and the decimal separator should be ,(comma)
And I want two digit after the decimal separator.All these conditions matches with this number(32.885,60)
Could you help me?

hi muhsin,

write an embeddede function which returns your amount like this: amount.ToString("N")

|||

Dear,

Write the embedded fucntion (=format(field,'fomat')

HT

from

sufian

|||Can you write for me please?
I tried but it didn't work.
What should I write in the format style area?|||

Could you format the string in code and then do a string replace to replace the , with a . and the . with a ,?

|||

Hi Muhsin,

sorry this isn't an answer for you, but very curious as to the currency you are working in?

I am used to formatting it the other way around (32,885.60)

99

|||

this is your function:

shared function GetCurrencyFormat(byVal Amount As Double) As String

return Amount.ToString("N")

end function

to call the function go to your layout and write in the cell or textbox or whatever the following:

=Code.GetCurrencyFormat(Amount)

thats it

|||

SpaceCadet wrote:

this is your function:

shared function GetCurrencyFormat(byVal Amount As Double) As String

return Amount.ToString("N")

end function

to call the function go to your layout and write in the cell or textbox or whatever the following:

=Code.GetCurrencyFormat(Amount)

thats it

But this is not I want.
This is already a format in the properties of the textbox.
You don't need to write a function for this.
I want the thousand seperator to be dot and the decimal seperator to be comma.
Your solution's result is for example 15,250.30.
But I want 15.250,30.
Thanks anyway.
If you find another solution , please share it with me!|||You can accomplish this by adjusting the Language property for the textbox, or the entire report to a language that uses this format. The language settings can be specific to just number formats when just setting the NumeralLanguage property on the textbox. After setting these properties, just use "N" as the format code.

See the following link for more information about International Considerations for Reporting Services:
http://msdn2.microsoft.com/en-us/library/ms156493.aspx