Showing posts with label english. Show all posts
Showing posts with label english. Show all posts

Thursday, March 29, 2012

attach db MS SQL 2000 .BAK with enterprise manager

hello everyone
i am the worst newbie that exists,,.. and on top my english is terrible !
i hope someone can help me :)
I need to attach .BAK db MS SQL 2000 with enterprise manager
I have a file de db sqlserver 2000 called hello_db_20060410man.bak
my last host has transfered to me .i am not hosted anymore and trying to attach my sqldb to use on IIS on my computer
but..... enterprise manager asks me for files in
.mdf and .log
How can I transform this .bak ?
when i try to restore it enterprise i CANNOT include it
message is that this ,bak is not a sql file !!!
Thanks in advance for your help

Quote:

Originally Posted by julia777

hello everyone
i am the worst newbie that exists,,.. and on top my english is terrible !
i hope someone can help me :)
I need to attach .BAK db MS SQL 2000 with enterprise manager
I have a file de db sqlserver 2000 called hello_db_20060410man.bak
my last host has transfered to me .i am not hosted anymore and trying to attach my sqldb to use on IIS on my computer
but..... enterprise manager asks me for files in
.mdf and .log
How can I transform this .bak ?
when i try to restore it enterprise i CANNOT include it
message is that this ,bak is not a sql file !!!
Thanks in advance for your help


Hi

Where you get this "hello_db_20060410man.bak" this file seems s BACKUP file ,you have restore this file then you will get the .mdf and .log files

RESTORE DATABASE <DESIRE DATABASE NAME>
FROM DISK = '<PATH OF WHERE hello_db_20060410man.bak RESIDES>'
WITH MOVE '<DAT FILENAME>' TO '<PATH WHERE YOU WANT .MDF FILE>',
MOVE 'LOGFILE NAME' TO '<PATH WHERE YOU WANT .LDF FILE>'

EXAMPLE:

RESTORE DATABASE TESTDB1 FROM DISK = 'C:\TEST\TESTDB.BAK'
WITH MOVE 'TESTDB_DAT' TO 'C:\TEST\TESTDB.MDF',
MOVE 'TESTDB_LOG' TO 'C:\TEST\TESTDB.LDF'|||THANKS a lot sponguru_dba :))
it seems to work i have ot my 2 files..
however.. seems i am having a problem to log into yhe site on my IIS :((
i will try again and let you know if you dont mind :)
Thanks again
Julia

Monday, March 19, 2012

Assinging a "rank" to a record

Hi all,

I don't know how to explain what I wanna do in english so here's a concrete example:

I have this data
Item - Qty
IT1 - 2
IT2 - 2
IT1 - 4
IT1 - 5
IT2 - 2

And I wanna do something like this
Item - Rank - Qty
IT1 - 1 - 2
IT1 - 2 - 4
IT1 - 3 - 5
IT2 - 1 - 2
IT2 - 2 - 2

So basically I want to assing a rank (on the fly) in a SELECT statement

Thanks in advance

Or Thowhat version of sql server?|||MS SQL SERVER 2005 SE SP2
(9.00.3054.00 SP2 Standard Edition)|||I found the way to do it:
RANK() OVER(PARTITION BY l.RealMP ORDER BY l.MP ASC, l.Color ASC, l.Thick DESC) AS RNK
But now I have an other plroblem, I need to use it in a ON statement like this:
LEFT JOIN ##tmp ON RANK() OVER(PARTITION BY l.RealMP ORDER BY l.MP ASC, l.Color ASC, l.Thick DESC)=1

But when I try to do that I get this error:
Msg 4108, Level 15, State 1, Procedure sp_RptProdLeatherPlanning, Line 35
Windowed functions can only appear in the SELECT or ORDER BY clauses.|||please show the real layouts of your tables

i don't recall seeing those column names in your first post

and what's with the join? do you just want the row with the min value?|||Actually the data comes from more than one tables

Here's my Query:

SELECT l.MP, LOWER(l.Color) AS Color, l.Thick, '' AS [ùSTOCKFCù], RANK() OVER(PARTITION BY l.RealMP ORDER BY l.MP ASC, l.Color ASC, l.Thick DESC) AS RNK, t.*, '' AS [ùSTOCKLCù], d.DEP,
COALESCE(s.OnHand,0) AS OnHand, COALESCE(s.Alloc,0) AS Alloc, COALESCE(s.BO,0) AS BO, COALESCE(s.Dispo,0) AS Dispo, COALESCE(s.Btq,0) AS Btq,
COALESCE(p.QTY,0) AS Prod, COALESCE(mb.MinBtq,0) AS MinBtq, COALESCE(sa.QTY,0) AS SalesASAT, COALESCE(s12.QTY/12,0) AS SalesLast12M,
COALESCE(ca.QTY,0) AS ConsoASAT, COALESCE(c12.QTY/12,0) AS ConsoLast12M
FROM ##ut_RptProdLeatherPlanningLeathers l
INNER JOIN ##ut_RptProdLeatherPlanningThicksPvt t ON l.RealMP=t.MP
LEFT JOIN ##ut_RptProdLeatherPlanningDEP d ON d.MP=l.RealMP
LEFT JOIN ##ut_RptProdLeatherPlanningStocks s ON s.RealMP=l.RealMP AND d.DEP=s.DEP
LEFT JOIN ##ut_RptProdLeatherPlanningProd p ON p.RealMP=l.RealMP AND p.DEP=d.DEP
LEFT JOIN ##ut_RptProdLeatherPlanningMinBtq mb ON mb.RealMP=l.RealMP AND mb.DEP=d.DEP
LEFT JOIN ##ut_RptProdLeatherPlanningSalesAsat sa ON sa.RealMP=l.RealMP AND sa.DEP=d.DEP
LEFT JOIN ##ut_RptProdLeatherPlanningSalesL12M s12 ON s12.RealMP=l.RealMP AND s12.DEP=d.DEP
LEFT JOIN ##ut_RptProdLeatherPlanningConsoASAT ca ON ca.RealMP=l.RealMP AND ca.DEP=d.DEP
LEFT JOIN ##ut_RptProdLeatherPlanningConsoL12M c12 ON c12.RealMP=l.RealMP AND c12.DEP=d.DEP
WHERE d.DEP IS NOT NULL
ORDER BY l.MP, l.Color, l.Thick DESC, d.DEP ASC

I want to use it to join ##ut_RptProdLeatherPlanningThicksPvt to ##ut_RptProdLeatherPlanningLeathers
Where RANK() OVER(PARTITION BY l.RealMP ORDER BY l.MP ASC, l.Color ASC, l.Thick DESC) is equal to 1

So... which table layout do you want me to show you?|||wow

just wow

my question is, how do you reconcile that query with the data you posted initially...

I have this data
Item - Qty
IT1 - 2
IT2 - 2
IT1 - 4
IT1 - 5
IT2 - 2

just curious, but are those all temp tables?

and what are you really trying to do with the rank number?|||I just wanted to simplify it to you...

What I wanna do with the rank is a bit tricky.
I have this MP, Color, Thick, STOCK .5, STOCK .7, STOCK .9, STOCK...

And the real data looks like this:

MP - Color - Thick - Stock.5 - Stock.7 - ...
aniline - black - 0.7 - NULL - 100.52
aniline - black - 0.7 - NULL - 100.52
aniline - black - 0.5 - 10 - NULL
aniline - black - 0.5 - 10 - NULL
soft - brown - 0.7 - NULL - 3039.42
soft - brown - 0.5 - 2039.42 - NULL
soft - brown - 0.5 - 2039.42 - NULL

And this is what I want.
MP - Color - Thick - Stock.5 - Stock.7 - ...
aniline - black - 0.7 - NULL - 100.52
aniline - black - 0.7 - NULL - NULL
aniline - black - 0.5 - 10 - NULL
aniline - black - 0.5 - NULL - NULL
soft - brown - 0.7 - NULL - 3039.42
soft - brown - 0.5 - 2039.42 - NULL
soft - brown - 0.5 - NULL - NULL

So if I add my rank it will looks like this
MP - Color - Thick - Rank - Stock.5 - Stock.7 - ...
aniline - black - 0.7 - 1 - NULL - 100.52
aniline - black - 0.7 - 2 - NULL - NULL
aniline - black - 0.5 - 1 - 10 - NULL
aniline - black - 0.5 - 2 -NULL - NULL
soft - brown - 0.7 - 1 - NULL - 3039.42
soft - brown - 0.5 - 1 - 2039.42 - NULL
soft - brown - 0.5 - 2 - NULL - NULL|||just curious, but are those all temp tables?

Exact I'm doing this before the select, to fill my temp tables

EXEC sp_RptProdLeatherPlanningLeathers
IF EXISTS(SELECT name FROM tempdb.dbo.sysobjects WHERE type='U' AND name = '##ut_RptProdLeatherPlanningThicksPvt')
DROP TABLE ##ut_RptProdLeatherPlanningThicksPvt
EXEC sp_CrossTabIntoTable
@.select = 'SELECT MP, CAST(Thick AS varchar) AS Thick FROM ##ut_RptProdLeatherPlanningThicks GROUP BY MP, Thick',
@.sumfunc = 'SUM(PvtSum)',
@.pivot = 'Thick',
@.table = '##ut_RptProdLeatherPlanningThicks',
@.tbl_result = '##ut_RptProdLeatherPlanningThicksPvt',
@.fld_sufx = 'stk de'
EXEC sp_RptProdLeatherPlanningBOM
EXEC sp_RptProdLeatherPlanningStocks
EXEC sp_RptProdLeatherPlanningDEP
EXEC sp_RptProdLeatherPlanningProd
EXEC sp_RptProdLeatherPlanningMinBtq
EXEC sp_RptProdLeatherPlanningSales
EXEC sp_RptProdLeatherPlanningConso|||and what's with the join? do you just want the row with the min value?

No! I want all of the rows but I want no data on STOCK.* WHERE RANK>1 because the data is repeated ...|||I know this is not the best but I gonna SELECT to an OUTPUT table and do an UPDATE to have the result I need.

If someone finds a better way to do it... please tell me.

Regards

Or Tho

Wednesday, March 7, 2012

Assertion failed!

I'm connecting to a SQL Server 2000, sp3 running on Win2k
Server, SP3, english version from a workstation with
Win2k, sp 3, english version.
The client software is written in C# and I'm using ADO.NET
to connect.
Occasionally I get this fault:
Assertion failed!
Program: ...\..\..\Myprog.exe
File: ..\..\..\nt\ssock\src\ntsockc.c
Line: 1053 (sometimes other lines...)
Expression: 1 == pConnectionObject->fCallCheck
Any suggestions what could be wrong?
/MattiasHi Mattias,
If the Assertion is thrown by the C# application, you need to post in C# or
ADO.NET newsgroup for accurate information, e.g.
microsoft.public.dotnet.languages.csharp,
microsoft.public.dotnet.framework.adonet. The problem should be related to
SQL Server.
When the problem occurs, I suggest that you use Query Analyzer to connect
to the SQL Server from the computer where the problem occurs. If the
problem does not occur, it indicates that the problem is with the
application.
In addition, since it is a random problem, it could be quite complex. You
could also contact Microsoft Product Support Services via
http://support.microsoft.com/default.aspx?scid=fh;EN-US;CNTACTMS, so that
we can have dedicated engineer to assist you.
This posting is provided "AS IS" with no warranties, and confers no rights.
Regards,
Bill Cheng
Microsoft Support Engineer
--
| Content-Class: urn:content-classes:message
| From: "Mattias Andersson" <mattias.andersson@.ip-consult.se>
| Sender: "Mattias Andersson" <mattias.andersson@.ip-consult.se>
| Subject: Assertion failed!
| Date: Mon, 30 Jun 2003 00:17:00 -0700
| Lines: 18
| Message-ID: <067701c33ed7$9931e2e0$a101280a@.phx.gbl>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="iso-8859-1"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
| Thread-Index: AcM+15kxvfxven3cQMytFjuuieMjcA==| Newsgroups: microsoft.public.sqlserver.server
| Path: cpmsftngxa09.phx.gbl
| Xref: cpmsftngxa09.phx.gbl microsoft.public.sqlserver.server:22143
| NNTP-Posting-Host: TK2MSFTNGXA09 10.40.1.161
| X-Tomcat-NG: microsoft.public.sqlserver.server
|
| I'm connecting to a SQL Server 2000, sp3 running on Win2k
| Server, SP3, english version from a workstation with
| Win2k, sp 3, english version.
|
| The client software is written in C# and I'm using ADO.NET
| to connect.
|
| Occasionally I get this fault:
| Assertion failed!
| Program: ...\..\..\Myprog.exe
| File: ..\..\..\nt\ssock\src\ntsockc.c
| Line: 1053 (sometimes other lines...)
|
| Expression: 1 == pConnectionObject->fCallCheck
|
| Any suggestions what could be wrong?
|
| /Mattias
|

Monday, February 13, 2012

ASP.NET MS SQL Server cyrillic problem

Hi,
I have a ASP.NET application which is hosted on English - based server. This
application works with MS SQL Server, also English-based. I have this in my
Web.config:
<globalization fileEncoding="windows-1251" requestEncoding="windows-1251"
responseEncoding="windows-1251" culture="bg-BG" uiCulture="bg-BG" />
When I insert some text in the database, I mean cyrrilic text, it couldn't
be read, because the result is '''.
Could you tell me hou should I fix this problem?
Thank you in advance!
ViktorVictor, first thing to look at is what's a data-type of the targeted field,
is nvarchar, nchar or ntext as opposed to varchar or text?
Also by what means is text inserted; bulk insert, ado, ado.net?
"Viktor Popov" <viketo@.yahoo.com> wrote in message
news:%232Rtw%23fLFHA.3016@.TK2MSFTNGP15.phx.gbl...
> Hi,
> I have a ASP.NET application which is hosted on English - based server.
This
> application works with MS SQL Server, also English-based. I have this in
my
> Web.config:
> <globalization fileEncoding="windows-1251" requestEncoding="windows-1251"
> responseEncoding="windows-1251" culture="bg-BG" uiCulture="bg-BG" />
> When I insert some text in the database, I mean cyrrilic text, it
couldn't
> be read, because the result is '''.
> Could you tell me hou should I fix this problem?
> Thank you in advance!
>
> Viktor
>|||> Also by what means is text inserted; bulk insert, ado, ado.net?
I am sorry, I didn't pay attention to the title of your post. If your
web.config settings are correct that should work. But assuming user is
submitting double byte data.
"LP" <lp@.a.com> wrote in message
news:unRxTckLFHA.3016@.TK2MSFTNGP15.phx.gbl...
> Victor, first thing to look at is what's a data-type of the targeted
field,
> is nvarchar, nchar or ntext as opposed to varchar or text?
> Also by what means is text inserted; bulk insert, ado, ado.net?
> "Viktor Popov" <viketo@.yahoo.com> wrote in message
> news:%232Rtw%23fLFHA.3016@.TK2MSFTNGP15.phx.gbl...
> This
> my
requestEncoding="windows-1251"
> couldn't
>|||Do you mean that I should insert into database unicode?
Thank you for the reply!
"LP" <lp@.a.com> wrote in message
news:u7GHj8kLFHA.732@.TK2MSFTNGP12.phx.gbl...
> I am sorry, I didn't pay attention to the title of your post. If your
> web.config settings are correct that should work. But assuming user is
> submitting double byte data.
>
> "LP" <lp@.a.com> wrote in message
> news:unRxTckLFHA.3016@.TK2MSFTNGP15.phx.gbl...
> field,
server.
in
> requestEncoding="windows-1251"
>|||Yes, you should insert cyrilic text as nvarchar or ntext. I am pretty sure
cyrillic uses double-byte i.e. unicode encoding.
"Viktor Popov" <viketo@.yahoo.com> wrote in message
news:%23O36bSrLFHA.1528@.TK2MSFTNGP09.phx.gbl...
> Do you mean that I should insert into database unicode?
> Thank you for the reply!
> "LP" <lp@.a.com> wrote in message
> news:u7GHj8kLFHA.732@.TK2MSFTNGP12.phx.gbl...
> server.
this
> in
>