Monday, March 26, 2012
How to apply the snapshot manually ?
To apply the snapshot manually, you can:
Save the snapshot files to removable media such as a compact disc, tape device, or removable disk and then send the media to the Subscriber location.
Yes, but how to apply the snapshot then ?
(My snapshot folder is much smaller than backup file of the whole database.)
Thanks for any ideas.
CarusoHA: only backup and restore
http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q320499#3
how to apply the left top corner text in crosstab so that it sholud be in every
iam facing one problem
how to apply the left top corner text in crosstab so that it sholud be in every page
for me it is there in only one page it is not coming in other page
please if any one as solution post me
waiting for replyDid you use formula and place it there?sql
How to apply style sheet to report... help me
hai...
i have designed a static rdl file which contains 10 columns.. now when i run the report, how to apply style sheet to the report...i want to apply style sheet at run time.. how to do that..? help me..
Thanks in advance..
If you are using rdlc in Visual Studio 2005, In my observations I think there's no way that you can apply style sheets to rdlc but you can apply CSS in Report Viewer control that contains your rdlc.
How to apply SQL Server 2005 Express SP1 to the version of SQL Server 2005 Express which install
When I installed VS 2005, it installed the default version of SQL Server 2005 Express that ships with Visual Studio 2005 installer media.
How can apply SQL Server 2005 Express SP1 to update this existing instance?
Currently, if I run this query:
SELECT @.@.version
I get the following:
Microsoft SQL Server 2005 - 9.00.1399.06 (Intel X86) Oct 14 2005 00:33:37 Copyright (c) 1988-2005 Microsoft Corporation Express Edition on Windows NT 5.1 (Build 2600: Service Pack 2)
After applying SP1, I should get 9.00.2047.00.
Should I just go to this link and download & install the SQL Server 2005 Express Edition SP1:
http://msdn.microsoft.com/vstudio/express/sql/download/
Thank you,
Bashman
Follow the instructions on the readme file in the setup package. SQL Express SP1 is not a Service pack fix, its a full product. The instructions in the readme are very detailed to get through the process.HTH, Jens Suessmeyer.
http://www.sqlserver2005.de|||
Its easy to just say go read the Readme!
Which Readme you talking about?
http://download.microsoft.com/download/b/d/1/bd1e0745-0e65-43a5-ac6a-f6173f58d80e/ReadmeSQLEXP2005.htm
http://download.microsoft.com/download/b/d/1/bd1e0745-0e65-43a5-ac6a-f6173f58d80e/ReadmeSQLEXP2005Advanced.htm
Neither of the two above Readme(s) tells me anything related to the VD2005 SQL 2005 Express that I am talking about.
If you know of any other Readme(s), please list the links!
Thanks for NOTHING!
|||Since I didn't get any meaningful answers, I decided to take a chance and see what happens if I just run the upgrade setup as is.
I made sure I had backups first, then I stopped the SQLEXPRESS service.
Run the setup and followed the instructions on the screen using the default answers for all except for selecting which instance to upgrade.
All went well.
So for anyone looking at this thread, the quick answer is backup and install as is you'll be fine!
Again, thanks for nothing!
|||Hi,its http://download.microsoft.com/download/b/d/1/bd1e0745-0e65-43a5-ac6a-f6173f58d80e/ReadmeSQLEXP2005.htm
3.1 Prepare for a SQL Server Express SP1 Installation
HTH, Jens SUessmeyer.
http://www.sqlserver2005.de|||
That's exactly the section I followed (Backup & Stop the service).
Other than that, the rest of the Readme didn't apply to my original question.
Also, good thing that you read the Readme now that I listed the link readly for your reading enjoyment!
Enjoy everyone,
Bashman
|||I lost you, what does "Also, good thing that you read the Readme now that I listed the link readly for your reading enjoyment!" mean ? Which readme do you expect if you are struggeling with SQL Server Express SP1 and you have problems with SQL Server Express SP1. The section if was talking about in my previous post was just about that, for making that clearer I posted you the link to the relevant readme.You asked the question which should be investigated at 06:08, at 06:12 you answered that you did not get any meaningful explanations, what do you expect the response times to be in a public forum, thats not a monitored chat or a paid support forum. So, you did not receive any answer in 4 minutes ? Thats really "horrible".
HTH, Jens SUessmeyer.
http://www.slqserver2005.de|||
Methinks the lady protests too much!
I always knew that my PC was fast, but I didn't know that it was that fast. Where I actually can backup my data & run a lengthy SQL server installation and post a reply in 4 minutes or less!
I realy have a FAST computer. If anyone is interested, I can list my PC specs for you!
Back to the subject, my reply to your "read the Readme" post was 24 hours after my original Post.
I see your answers on this board and they are usually typical of "read the Readme" kind of answers.
That's fine if you list or point to the Readme link and even better if you would point to the section of the Readme related to the answer of the question.
I did read the Readme(s) that I listed and found the section most apply to my question and took a chance on it.
Then I came back to the board and posted a reply to you and listed the two links (it took me about 4 minuts to write, slow typies but fast PC).
Four minutes later, I then listed what I did to get the job done.
I hope in the future when you answer with "Read the Readme(s)", you would try to point the link or the section most apply to the question/answer.
You know, I could just have gone and ignured this board "because I didn't get any answers from it".
But I came back and listed the Readme(s) and listed what I did so that the next time someone looking for this question/answer, would find something meaningful other than "Read the Readme(s)".
I don't know how long this is talking me to type, but I am the slow typest with a fast PC,
Bashman
|||From you post it seems that you didn′t know where to look at: "Neither of the two above Readme(s) tells me anything related to the VD2005 SQL 2005 Express that I am talking about." My assumptions was that you are smart enough to figure out that I ment the SQL Server Express SP1 readme, sorry for that. So I gave you another hint to look into that special readme under the mentioned section. Nevertheless, good that you fixed your problem.HTH, Jens Suessmeyer.|||
You want the Credit, you got the Credit!
Yes, whithout your hint I was lost but then I was found! I realy didn't found my why without your reply!
I need your hand holding to lead me to the right Readme file.
By listing the two links, I showed you how loast I was!
But once your hint gave my the way, I managed to resolve my own problem in less than 4 minutes using my fast PC!
Thank you, Thank you, Thank you!
|||OK, you didn′t get it yet. Its just about being polite which you weren′t.How to apply SQL Server 2005 Express SP1 to the version of SQL Server 2005 Express which ins
When I installed VS 2005, it installed the default version of SQL Server 2005 Express that ships with Visual Studio 2005 installer media.
How can apply SQL Server 2005 Express SP1 to update this existing instance?
Currently, if I run this query:
SELECT @.@.version
I get the following:
Microsoft SQL Server 2005 - 9.00.1399.06 (Intel X86) Oct 14 2005 00:33:37 Copyright (c) 1988-2005 Microsoft Corporation Express Edition on Windows NT 5.1 (Build 2600: Service Pack 2)
After applying SP1, I should get 9.00.2047.00.
Should I just go to this link and download & install the SQL Server 2005 Express Edition SP1:
http://msdn.microsoft.com/vstudio/express/sql/download/
Thank you,
Bashman
Follow the instructions on the readme file in the setup package. SQL Express SP1 is not a Service pack fix, its a full product. The instructions in the readme are very detailed to get through the process.HTH, Jens Suessmeyer.
http://www.sqlserver2005.de|||
Its easy to just say go read the Readme!
Which Readme you talking about?
http://download.microsoft.com/download/b/d/1/bd1e0745-0e65-43a5-ac6a-f6173f58d80e/ReadmeSQLEXP2005.htm
http://download.microsoft.com/download/b/d/1/bd1e0745-0e65-43a5-ac6a-f6173f58d80e/ReadmeSQLEXP2005Advanced.htm
Neither of the two above Readme(s) tells me anything related to the VD2005 SQL 2005 Express that I am talking about.
If you know of any other Readme(s), please list the links!
Thanks for NOTHING!
|||Since I didn't get any meaningful answers, I decided to take a chance and see what happens if I just run the upgrade setup as is.
I made sure I had backups first, then I stopped the SQLEXPRESS service.
Run the setup and followed the instructions on the screen using the default answers for all except for selecting which instance to upgrade.
All went well.
So for anyone looking at this thread, the quick answer is backup and install as is you'll be fine!
Again, thanks for nothing!
|||Hi,its http://download.microsoft.com/download/b/d/1/bd1e0745-0e65-43a5-ac6a-f6173f58d80e/ReadmeSQLEXP2005.htm
3.1 Prepare for a SQL Server Express SP1 Installation
HTH, Jens SUessmeyer.
http://www.sqlserver2005.de|||
That's exactly the section I followed (Backup & Stop the service).
Other than that, the rest of the Readme didn't apply to my original question.
Also, good thing that you read the Readme now that I listed the link readly for your reading enjoyment!
Enjoy everyone,
Bashman
|||I lost you, what does "Also, good thing that you read the Readme now that I listed the link readly for your reading enjoyment!" mean ? Which readme do you expect if you are struggeling with SQL Server Express SP1 and you have problems with SQL Server Express SP1. The section if was talking about in my previous post was just about that, for making that clearer I posted you the link to the relevant readme.You asked the question which should be investigated at 06:08, at 06:12 you answered that you did not get any meaningful explanations, what do you expect the response times to be in a public forum, thats not a monitored chat or a paid support forum. So, you did not receive any answer in 4 minutes ? Thats really "horrible".
HTH, Jens SUessmeyer.
http://www.slqserver2005.de|||
Methinks the lady protests too much!
I always knew that my PC was fast, but I didn't know that it was that fast. Where I actually can backup my data & run a lengthy SQL server installation and post a reply in 4 minutes or less!
I realy have a FAST computer. If anyone is interested, I can list my PC specs for you!
Back to the subject, my reply to your "read the Readme" post was 24 hours after my original Post.
I see your answers on this board and they are usually typical of "read the Readme" kind of answers.
That's fine if you list or point to the Readme link and even better if you would point to the section of the Readme related to the answer of the question.
I did read the Readme(s) that I listed and found the section most apply to my question and took a chance on it.
Then I came back to the board and posted a reply to you and listed the two links (it took me about 4 minuts to write, slow typies but fast PC).
Four minutes later, I then listed what I did to get the job done.
I hope in the future when you answer with "Read the Readme(s)", you would try to point the link or the section most apply to the question/answer.
You know, I could just have gone and ignured this board "because I didn't get any answers from it".
But I came back and listed the Readme(s) and listed what I did so that the next time someone looking for this question/answer, would find something meaningful other than "Read the Readme(s)".
I don't know how long this is talking me to type, but I am the slow typest with a fast PC,
Bashman
|||From you post it seems that you didn′t know where to look at: "Neither of the two above Readme(s) tells me anything related to the VD2005 SQL 2005 Express that I am talking about." My assumptions was that you are smart enough to figure out that I ment the SQL Server Express SP1 readme, sorry for that. So I gave you another hint to look into that special readme under the mentioned section. Nevertheless, good that you fixed your problem.HTH, Jens Suessmeyer.|||
You want the Credit, you got the Credit!
Yes, whithout your hint I was lost but then I was found! I realy didn't found my why without your reply!
I need your hand holding to lead me to the right Readme file.
By listing the two links, I showed you how loast I was!
But once your hint gave my the way, I managed to resolve my own problem in less than 4 minutes using my fast PC!
Thank you, Thank you, Thank you!
|||OK, you didn′t get it yet. Its just about being polite which you weren′t.How to apply sp4 to multiple instances that have different sp leve
g
on the same server. The server is running Windows 2000.
SERVER Name: ABC01DB
SqlServer Instances follow:
Default 8.00.534 SP2 Developer Edition
DEV 8.00.760 SP3 Developer Edition
ABCDEV_APP01 (*) 8.00.194 RTM Developer Edition
ABCDEV_LT01 (*) 8.00.194 RTM Developer Edition
ABCDEV_LT02 (*) 8.00.194 RTM Developer Edition
ABCDEV_QA01 (*) 8.00.194 RTM Developer Edition
ABC_MGR 8.00.760 SP3 Developer Edition
Questions:
1) Do I need to apply any service packs other than sp4 to any of them prior
to applying sp4.
2) Is there any way to apply sp4 to multiple instances simultaneously or
must I apply sp4 separately for each instance.
3) Any suggestions or comments regarding the steps to simplify applying sp4
to all of the above instances.I proceeded with the upgrade and simply applied the sp4 to each instance,
starting with those which had no service packs first, (RTM). Then, I applie
d
it to the Default which was at sp2, and finally to those at sp3.
It all works.
"theWizard1" wrote:
> I need to apply sp4 for SqlServer 2000 to the following instances all runn
ing
> on the same server. The server is running Windows 2000.
> SERVER Name: ABC01DB
> SqlServer Instances follow:
> Default 8.00.534 SP2 Developer Edition
> DEV 8.00.760 SP3 Developer Edition
> ABCDEV_APP01 (*) 8.00.194 RTM Developer Edition
> ABCDEV_LT01 (*) 8.00.194 RTM Developer Edition
> ABCDEV_LT02 (*) 8.00.194 RTM Developer Edition
> ABCDEV_QA01 (*) 8.00.194 RTM Developer Edition
> ABC_MGR 8.00.760 SP3 Developer Edition
> Questions:
> 1) Do I need to apply any service packs other than sp4 to any of them pri
or
> to applying sp4.
> 2) Is there any way to apply sp4 to multiple instances simultaneously or
> must I apply sp4 separately for each instance.
> 3) Any suggestions or comments regarding the steps to simplify applying sp
4
> to all of the above instances.
How to apply sp4 to multiple instances that have different sp leve
on the same server. The server is running Windows 2000.
SERVER Name: ABC01DB
SqlServer Instances follow:
Default 8.00.534 SP2 Developer Edition
DEV 8.00.760 SP3 Developer Edition
ABCDEV_APP01 (*) 8.00.194 RTM Developer Edition
ABCDEV_LT01 (*) 8.00.194 RTM Developer Edition
ABCDEV_LT02 (*) 8.00.194 RTM Developer Edition
ABCDEV_QA01 (*) 8.00.194 RTM Developer Edition
ABC_MGR 8.00.760 SP3 Developer Edition
Questions:
1) Do I need to apply any service packs other than sp4 to any of them prior
to applying sp4.
2) Is there any way to apply sp4 to multiple instances simultaneously or
must I apply sp4 separately for each instance.
3) Any suggestions or comments regarding the steps to simplify applying sp4
to all of the above instances.I proceeded with the upgrade and simply applied the sp4 to each instance,
starting with those which had no service packs first, (RTM). Then, I applied
it to the Default which was at sp2, and finally to those at sp3.
It all works.
"theWizard1" wrote:
> I need to apply sp4 for SqlServer 2000 to the following instances all running
> on the same server. The server is running Windows 2000.
> SERVER Name: ABC01DB
> SqlServer Instances follow:
> Default 8.00.534 SP2 Developer Edition
> DEV 8.00.760 SP3 Developer Edition
> ABCDEV_APP01 (*) 8.00.194 RTM Developer Edition
> ABCDEV_LT01 (*) 8.00.194 RTM Developer Edition
> ABCDEV_LT02 (*) 8.00.194 RTM Developer Edition
> ABCDEV_QA01 (*) 8.00.194 RTM Developer Edition
> ABC_MGR 8.00.760 SP3 Developer Edition
> Questions:
> 1) Do I need to apply any service packs other than sp4 to any of them prior
> to applying sp4.
> 2) Is there any way to apply sp4 to multiple instances simultaneously or
> must I apply sp4 separately for each instance.
> 3) Any suggestions or comments regarding the steps to simplify applying sp4
> to all of the above instances.sql
How to apply For loop here
I have 5 fields in my report.
4 string type and 1 Date.
4 String type are : Unit , Periods , Grade and Demand
and 1 is Date
I would like to apply a loop which eventually sum up the value of the last field.
Before I explain it furthur I would like to add that all the string type has
multiple value in it.
Description :
I would like sum up Demand for each Grade per period per Unit.
For Example
Unit 1
Date ( monthly)1
Grade 1
Period 1 Total Demand
Period 2 Total Demand
Period 3 Total Demand
Date2
Grade 2
Period 1 Total Demand
Period 2 Total Demand
Period 3 Total Demand
I think this involves couple of For loops , Sorry but not familier with
Syntax that much.
Thanks
AbhisarDo you want to sum the field Demand which is of String type?|||Yes ,
I want to sum field demand. of string type.
so it looks like.
For loop unit ...select one unit in that string array.
then Start for loop to select the date from the Date array ( which in monthly format)
Then for loop to select the grade (string array)....
and then for each period( 3 in it ) it will show me total demand..
The actual data looks like...
Unit date grade period demand
------------------
ew 333 rrr Day 44
ew 333 rrr Eve 55
ew 333 rrr Night 22
...
...
...
ew 645 rrr Day 43
ew 645 rrr Eve 33
ew 645 rrr Night 21
Like wise
diff date .....
I would like to see
for
unit (ew) date(333) for grade(rrr)
on period (Day) total demand
(Eve) total demand
(Night) Total demand
because there are lot of person works on the same date, same unit, same grade
same three period but different demand.
I want to sum up all the demand and write a summary.
I hope I am able to explain my problem to all of u this time.
Thanks|||You can try this in the formula
numbervar eveCount;
numbervar DayCount;
whilePringtingRecords;
if {period}="Day"
DayCount:=DayCount+tonumber({Demand})
else if {period}="Eve"
EveCount:=EveCount+tonumber({Demand});|||Sorry Guys bot not working at all.
Ok , Let me reframe it to one more example.
there are 5 fields , the values in 4 of the fields are not changing at all , only in the 5th field is changing.
For example
1st field 2nd Field 3rd Field 4rth Field 5th Field
xxx rrrr tttt cccc 33
xxx rrrr tttt cccc 44
xxx rrrr tttt cccc 55
I just want to see
xxx rrrr tttt cccc 132 (total)
just in one line.
any ideas now.
Thanks|||If so, then why dont you try to write a query
Select field1,field2,field3,field4,sum(convert(numeric,field5)) from table group by
field1,field2,field3,field4
and design the report using this query
How to apply database design changes?
read an entire book on the subject. Here is my problem... I am developing VB
..NET based web app with MS SQL Server 2000 as backend. The beta version of
the system is already in use from the main server. Meanwhile I keep changing
the database design (including editing stored proc and/or views) on my
development server. Now how could I migrate the changes I have made to the
main server without loosing the data already there?
Any reference to an online guide would also be helpful.
Thanks in advance
Raj
Since you posted the question in .replication forum. I guess the first
question everyone has is:
Does the database set up for replication?
"Raj" wrote:
> Hi all, I am not sure if this question has a one line answer or I have to
> read an entire book on the subject. Here is my problem... I am developing VB
> .NET based web app with MS SQL Server 2000 as backend. The beta version of
> the system is already in use from the main server. Meanwhile I keep changing
> the database design (including editing stored proc and/or views) on my
> development server. Now how could I migrate the changes I have made to the
> main server without loosing the data already there?
> Any reference to an online guide would also be helpful.
> Thanks in advance
> --
> Raj
>
|||Jack, I was not sure initially where to post this question, so posted here. I
just created a publisher of my development database and selected all the four
objects (tables, stored proc, views, and UDFs) for publishing.
I do not want to publish the data, but only the schema. The replication
wizard gave me a warning that columns with INT IDENTITY property would be
converted to just INT, which, if happens, will screw up my database.
Any guidance would be appreciated
Thanks
"Jack" wrote:
[vbcol=seagreen]
> Since you posted the question in .replication forum. I guess the first
> question everyone has is:
> Does the database set up for replication?
> "Raj" wrote:
|||If this is the case, then I would not recommend Replication. Tables, views,
stored procedures, and functions all can create and alter using SQL script.
You just need to keep track of the changes you want to make, put them in a
script or scripts, then apply the changes to production database on regular
basics (i.e. once a week).
"Raj" wrote:
[vbcol=seagreen]
> Jack, I was not sure initially where to post this question, so posted here. I
> just created a publisher of my development database and selected all the four
> objects (tables, stored proc, views, and UDFs) for publishing.
> I do not want to publish the data, but only the schema. The replication
> wizard gave me a warning that columns with INT IDENTITY property would be
> converted to just INT, which, if happens, will screw up my database.
> Any guidance would be appreciated
> Thanks
> "Jack" wrote:
|||Raj,
It seems either you got mixed up or I don't understand your problem.
1. What are you using replication for? Just to manage schema?
2. What type of replication are you using? My guess is you are using
Transactional.
3. How many servers are you managing in production?
4. Have you got your development and production servers mixed up? If yes,
bad idea!
Please clarify the above.
Normally if you want to deploy database changes from development to
production you would be keeping change scripts so you could apply them in an
ordered fashion, especially if table changes are involved. Adding columns
requires special handling when applying to replicated database, and cannot
be done using the conventional way. Please let me know your exact
requirements
Sorry for not being able to help more at this moment.
Raj Moloye.
"Raj" <Raj@.discussions.microsoft.com> wrote in message
news:D23DFA51-E948-4F9F-B4ED-A7AEE156829A@.microsoft.com...[vbcol=seagreen]
> Jack, I was not sure initially where to post this question, so posted
> here. I
> just created a publisher of my development database and selected all the
> four
> objects (tables, stored proc, views, and UDFs) for publishing.
> I do not want to publish the data, but only the schema. The replication
> wizard gave me a warning that columns with INT IDENTITY property would be
> converted to just INT, which, if happens, will screw up my database.
> Any guidance would be appreciated
> Thanks
> "Jack" wrote:
|||Thanks Raj Moloye and Jack.
I only need to migrate the schema changes from development server to main
server. I do no need to synchronize the data.
I only created replication agent for self-study (just to know what the heck
is it..). Based on your reply I guess replication is not the answer to my
problem.
You rightly mentioned that I need to place all the changes in a script, and
apply them to the main server regularly. I just do not know how to do it,
particularly the changes I make to the tables.
Please advise me the best way to achieve this.
Thanks again
BTW: could you also guide me to any online replication docoment?
"Khooseeraj Moloye" wrote:
> Raj,
> It seems either you got mixed up or I don't understand your problem.
> 1. What are you using replication for? Just to manage schema?
> 2. What type of replication are you using? My guess is you are using
> Transactional.
> 3. How many servers are you managing in production?
> 4. Have you got your development and production servers mixed up? If yes,
> bad idea!
> Please clarify the above.
> Normally if you want to deploy database changes from development to
> production you would be keeping change scripts so you could apply them in an
> ordered fashion, especially if table changes are involved. Adding columns
> requires special handling when applying to replicated database, and cannot
> be done using the conventional way. Please let me know your exact
> requirements
> Sorry for not being able to help more at this moment.
> Raj Moloye.
>
> "Raj" <Raj@.discussions.microsoft.com> wrote in message
> news:D23DFA51-E948-4F9F-B4ED-A7AEE156829A@.microsoft.com...
>
>
|||If you make changes to a table. For example, you added a column:
ALTER TABLE table
ADD column DATATYPE ........
As far as stored procedures, views, and functions. You can simple use the
ALTER command to update them unless your company has rules for those changes.
The difference between changing the schema of a table versus others is that
you don't want to change the entire schema of the table, you just want to
apply the necessary changes to it.
Book On Line provides a lot of informatioin on Replication already. This
forum is a great resource also especially there are some replication experts
checking this forum all the time.
"Raj" wrote:
[vbcol=seagreen]
> Thanks Raj Moloye and Jack.
> I only need to migrate the schema changes from development server to main
> server. I do no need to synchronize the data.
> I only created replication agent for self-study (just to know what the heck
> is it..). Based on your reply I guess replication is not the answer to my
> problem.
> You rightly mentioned that I need to place all the changes in a script, and
> apply them to the main server regularly. I just do not know how to do it,
> particularly the changes I make to the tables.
> Please advise me the best way to achieve this.
> Thanks again
> BTW: could you also guide me to any online replication docoment?
> "Khooseeraj Moloye" wrote:
|||To replicate schema changes only, I'd recommend Redgate's
SQLCompare tool.
Rgds,
Paul Ibison
|||Thanks Jack,
I use enterprise manager to edit tables, views etc. I think it will be a
pain to record all the changes I make to the tables as a script manually. I
am probably making changes to the tables, views etc all the time, then how is
it possible/feasible to record them all in a script?
Is there any alternative?
"Jack" wrote:
[vbcol=seagreen]
> If you make changes to a table. For example, you added a column:
> ALTER TABLE table
> ADD column DATATYPE ........
> As far as stored procedures, views, and functions. You can simple use the
> ALTER command to update them unless your company has rules for those changes.
> The difference between changing the schema of a table versus others is that
> you don't want to change the entire schema of the table, you just want to
> apply the necessary changes to it.
> Book On Line provides a lot of informatioin on Replication already. This
> forum is a great resource also especially there are some replication experts
> checking this forum all the time.
> "Raj" wrote:
|||It is very important to record all the changes you want to make to your
production database even though it's a pain. That's why the DBA's like
myself still have jobs. :-) Views, stored procedures, and functions should
not be a problem. You can just right-click on the object from EM > All Tasks
> Generate SQL script. But when it comes to tables, I think it's better for
you to learn how to use T-SQL to make modifications. You can generate the
SQL script on the tables from EM also if you want to get yourself familiar
with the syntax first.
"Raj" wrote:
[vbcol=seagreen]
> Thanks Jack,
> I use enterprise manager to edit tables, views etc. I think it will be a
> pain to record all the changes I make to the tables as a script manually. I
> am probably making changes to the tables, views etc all the time, then how is
> it possible/feasible to record them all in a script?
> Is there any alternative?
> "Jack" wrote:
How to apply complex constraints
I want to create a constraint that uses data from other tables,
specifically i want to make sure that a varchar has exactly the length
specified in an integer-column in a table that I pointed out with a
foreign key.
I would like this to be solved something like this:
create table string_size_limits
(
row_id INTEGER PRIMARY KEY
string_size INTEGER
)
create table strings
(
string_size_limit_row_id INTEGER
REFERENCES string_size_limits(row_id)
string varcher(50)
CONSTRAINT check_string_size CHECK ?
)
Is it possible to solve this problem without SP using above model?
Is it possible to solve this problem with SP using above model?
Must the above problem be solved using triggers?
Any help appreciated"Jon" <jonsjostedt@.hotmail.com> wrote in message
news:9f379edc.0503150952.59caa802@.posting.google.c om...
> Hi all!
> I want to create a constraint that uses data from other tables,
> specifically i want to make sure that a varchar has exactly the length
> specified in an integer-column in a table that I pointed out with a
> foreign key.
> I would like this to be solved something like this:
> create table string_size_limits
> (
> row_id INTEGER PRIMARY KEY
> string_size INTEGER
> )
> create table strings
> (
> string_size_limit_row_id INTEGER
> REFERENCES string_size_limits(row_id)
> string varcher(50)
> CONSTRAINT check_string_size CHECK ?
> )
> Is it possible to solve this problem without SP using above model?
> Is it possible to solve this problem with SP using above model?
> Must the above problem be solved using triggers?
> Any help appreciated
A CHECK constraint can only access data in the table it's created on, but in
your example, what is the purpose of Row_ID as a primary key? In other
words, what is the difference between these two limits:
insert into string_size_limits select 1, 5
insert into string_size_limits select 2, 5
Is the second string size limit somehow different because its row_id is
different? If the primary key of your limits table was just the string size
itself, then the foreign key could be used in the CHECK constraint:
create table dbo.StringSizes (
StringSize int not null,
constraint PK_StringSizes primary key (StringSize)
)
create table dbo.Strings
(
StringSize int not null,
String varchar(50) not null,
constraint PK_Strings primary key (String),
constraint FK_Strings_StringSizes foreign key (StringSize)
references StringSizes (StringSize),
constraint CHK_StringLength check (len(String) = StringSize)
)
insert into dbo.StringSizes select 3
insert into dbo.StringSizes select 5
insert into dbo.Strings select 3, 'Jon'
insert into dbo.Strings select 3, 'John' -- Fails
insert into dbo.Strings select 5, 'Check'
insert into dbo.Strings select 5, 'Cheque' -- Fails
If that doesn't help, I suggest you give some more details on Row_Id, and
also working CREATE TABLE and INSERT statements. But if you can't use the
string size limit itself in the foreign key, a trigger is the most likely
alternative.
Simon|||Jon (jonsjostedt@.hotmail.com) writes:
> I want to create a constraint that uses data from other tables,
> specifically i want to make sure that a varchar has exactly the length
> specified in an integer-column in a table that I pointed out with a
> foreign key.
> I would like this to be solved something like this:
> create table string_size_limits
> (
> row_id INTEGER PRIMARY KEY
> string_size INTEGER
> )
> create table strings
> (
> string_size_limit_row_id INTEGER
> REFERENCES string_size_limits(row_id)
> string varcher(50)
> CONSTRAINT check_string_size CHECK ?
> )
> Is it possible to solve this problem without SP using above model?
> Is it possible to solve this problem with SP using above model?
> Must the above problem be solved using triggers?
The problem does not need be solved with triggers, but that's the best
solution.
The alternative is to write a UDF which access the string_size_limits
table, and then you CHECK constraint would read:
CHECK (len(string) = dbo.maxlen(row_id))
The reason you should not do this, is because the performance penalty
can be severe. I remember that I played with this once, and added a
constraint with a UDF to the copy of an existing table. I then inserted
all 24000 rows into that table. Instead of two seconds it took 30!
--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp|||In full SQL-92, you can write such a CHECK() constraint, but not in SQL
Server yet. You would have to use a trigger and get away from
declarative code.
However, why are you putting metadata into the database in violation of
basic design principles? This is sooo wrong.|||"--CELKO--" <jcelko212@.earthlink.net> a crit dans le message de
news:1110989814.440585.47880@.o13g2000cwo.googlegro ups.com...
> In full SQL-92, you can write such a CHECK() constraint, but not in SQL
> Server yet. You would have to use a trigger and get away from
> declarative code.
> However, why are you putting metadata into the database in violation of
> basic design principles? This is sooo wrong.
Why is this so wrong? How about a link to thoes basic design principles?
Where do you think metadata should be stored?
How to apply an MDX filter that doesn't affect roll-up?
Take the Employee dimension of Adventure Works Cube. I want to see a list of all Male Employees and the total Reseller-Sales they supervise. My MDX query looks like this
Select [Measures].[Reseller Sales-Sales Amount] on Columns,
non empty [Employee].[Employees].AllMembers on Rows
from [Analysis Services Tutorial]
where [Employee].[Gender].&[M]
and I get a result of
Reseller Sales-Sales Amount
All Employees $44,244,815.17
Ken J. Sánchez $44,244,815.17
Brian S. Welcker $44,244,815.17
Ranjit R. Varkey Chudukatil $4,509,888.93
Stephen Y. Jiang $39,562,401.78
David R. Campbell $3,729,945.35
Garrett R. Vargas $3,609,447.22
Jos Edvaldo. Saraiva $5,926,418.36
Michael G. Blythe $9,293,903.01
Shu K. Ito $6,427,005.56
Stephen Y. Jiang $1,092,123.86
Tete A. Mensa-Annan $2,312,545.69
Tsvi Michael. Reiter $7,171,012.75
Syed E. Abbas $172,524.45
ok so it gave me all the male employees, which is good, but the sales amounts are incorrect, it is only summing
the sales of the male underlings. Ken J. Sánchez actually has 80 million in sales under him, Stephen Y. Jiang has 63 million, etc... The Cube is not counting the female underlings sales. How do I include everything in the roll-ups, but only return the male supervisors?
Thanks
Todd Wilder
Select [Measures].[Reseller Sales-Sales Amount] on Columns,
non empty
Exists(
[Employee].[Employees].AllMembers
,[Employee].[Gender].&[M]
) on Rows
from [Analysis Services Tutorial]
There seems to be a slight twist to this, since Employee is a parent-child dimension. Apparently, using the parent-child hierarchy, a member can "exist" with an attribute like [Employee].[Gender].&[M] if any of its descendants are male. But a member of the key attribute hierarchy works as with regular dimensions. So LinkMember() can be used to map key attribute members to the corresponding parent-child members, like:
Select [Measures].[Reseller Sales Amount] on Columns,
non empty Generate(exists([Employee].[Employee].[Employee],
[Employee].[Gender].&[M]),
{LinkMember([Employee].[Employee].CurrentMember,
[Employee].[Employees])}) on Rows
from [Adventure Works]
In this case, there is a discrepancy between the 2 queries of a single (non empty) member - Amy E. Alberts (female):
Select [Measures].[Reseller Sales Amount] on Columns,
non empty exists([Employee].[Employees].Members,
[Employee].[Gender].&[M]) -
Generate(exists([Employee].[Employee].[Employee],
[Employee].[Gender].&[M]),
{LinkMember([Employee].[Employee].CurrentMember,
[Employee].[Employees])})on Rows
from [Adventure Works]
--
Reseller Sales Amount
All Employees $80,450,596.98
Amy E. Alberts $15,535,946.26
how to apply a sql script file on Sql server 2000 without OSql.exe
Hi guys
I need to apply a sql script file on Sql server 2000 by .net 2.0 program. but on the current running machine, there is not Osql.exe file. Do you guys know how to execute the sql file without the command? Is there any way provided in .net library ?
Thanks for you response!
This Should help.|||Hi Ken
thanks for your response.
if my script file is long with comments,translation. if I combine all text lines in the file into one string to execute on sql, an error will be thrown out. how do you think that situation?
|||Hi andi,
When you have installed a SQL Server instance, the osql.exe tool will always be installed. If you don't have SQL Server instance, the scripts cannot be applied to any SQL Server instance.
sql