Friday, March 30, 2012
putting Word docs, etc in DB
want to look at Word documents, other text files, maybe
Excel spreadsheets.
Would it be best to put the location of the files in a
database and have our network mappings set up for anyone
in the company can see these files
or
Has anyone put the actual Word document in a SQL Server
(store the binary data in an Image data type) and then
tried using that to bring up the Word document? I think
storing the data from the file into an Image data type
should be fine, but I'm not sure how you'd get Word to
work with the data in the database and display the
contents.
The first option will work but there are some networking
issues. I'm just wondering if a database solution might
work and how you'd do that.
TIA,
Doughttp://www.aspfaq.com/show.asp?id=2149
"Doug" <anonymous@.discussions.microsoft.com> wrote in message
news:5a3e01c4009a$e6919280$a501280a@.phx.gbl...
> We have a project when multiple people in the company will
> want to look at Word documents, other text files, maybe
> Excel spreadsheets.
> Would it be best to put the location of the files in a
> database and have our network mappings set up for anyone
> in the company can see these files
> or
> Has anyone put the actual Word document in a SQL Server
> (store the binary data in an Image data type) and then
> tried using that to bring up the Word document? I think
> storing the data from the file into an Image data type
> should be fine, but I'm not sure how you'd get Word to
> work with the data in the database and display the
> contents.
> The first option will work but there are some networking
> issues. I'm just wondering if a database solution might
> work and how you'd do that.
> TIA,
> Dougsql
putting Word docs, etc in DB
want to look at Word documents, other text files, maybe
Excel spreadsheets.
Would it be best to put the location of the files in a
database and have our network mappings set up for anyone
in the company can see these files
or
Has anyone put the actual Word document in a SQL Server
(store the binary data in an Image data type) and then
tried using that to bring up the Word document? I think
storing the data from the file into an Image data type
should be fine, but I'm not sure how you'd get Word to
work with the data in the database and display the
contents.
The first option will work but there are some networking
issues. I'm just wondering if a database solution might
work and how you'd do that.
TIA,
Doughttp://www.aspfaq.com/show.asp?id=2149
"Doug" <anonymous@.discussions.microsoft.com> wrote in message
news:5a3e01c4009a$e6919280$a501280a@.phx.gbl...
> We have a project when multiple people in the company will
> want to look at Word documents, other text files, maybe
> Excel spreadsheets.
> Would it be best to put the location of the files in a
> database and have our network mappings set up for anyone
> in the company can see these files
> or
> Has anyone put the actual Word document in a SQL Server
> (store the binary data in an Image data type) and then
> tried using that to bring up the Word document? I think
> storing the data from the file into an Image data type
> should be fine, but I'm not sure how you'd get Word to
> work with the data in the database and display the
> contents.
> The first option will work but there are some networking
> issues. I'm just wondering if a database solution might
> work and how you'd do that.
> TIA,
> Doug
putting multiple xml files data into database in a single transaction
First of all i do not know whether this is the right form to ask the question
Let me describe the scenario iam using
Iam generating xml files at a particular place and sending them to a server
xml1|------->dataset1---------->adapter1.update(dataset1)
xml2|-------->dataset2---------->adapter2.update(dataset2)
xml3|-------->dataset3---------->adapter3.update(dataset3)
all thethree updates should happen in onlyone transaction if any one of the update fails then the transaction should rollback
can anyone tell me a way to do it
i am desperately in search of any ways to do it can anybody help please
If the 3 SqlDataAdapters are using the same connection, maybe you can try to embed the updates in a single transaction opened on the connection:
using (SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["myConn"].ToString()))
{
conn.open;
//build your SqlDataAdapters on the same conneciton
SqlTransaction st;
st=conn.BeginTransaction("tran1");
adapter1.update(dataset1);
adapter2.update(dataset2);
adapter3.update(dataset3);
st.Commit();
}
ExecuteReader requires the command to have a transaction when the connection assigned to the command is in a pending local transaction. The Transaction property of the command has not been initialized
This is the error iam getting bcoz iam using the command builder to update the table using dataset cant we use command builder and transaction at the same time
or we should use only sqlcommand to the method
can anybody tell me the solution cant we use transaction and adapter and commandbuilder at the same time
[:'(]
Putting Multiple Field data in a report table cell
I don't know how to seperate the values to get them to work in the same table cell. I've tried commas, semi colons, spaces, parens.
How would I do this?=Fields!Phone.Value & " " & Fields!Fax.Value should work.
|||Great that works!
One other question, if I put a symbol (comma, semicolon) in the between the ampersands, how do I get it to leave the cell blank if there is nothing stored in the fields?
For example, say I have =Fields!Phone.Value & ", " & Fields!Fax.Value in the cell but when there is no values for those fields the cell is ", ".|||=Fields!Phone.Value & ISNULL(Fields!Fax.Value,"",",") & Fields!Fax.Value should work?
Otherwise you can try using IIF.
|||I couldn't use IsNull because it says it is not decleared. I can use IIF, so the correct code is =Fields!Phone.Value & IIF(Fields!Fax.Value=nothing,"",",") & Fields!Fax.Value
Thanks for your help.
Wednesday, March 28, 2012
Putting Data In A Heading?
ways in which to put data in a heading so it will repeat on multiple pages.
I have used all sorts of report software in the past several decades and I
don't think I ever saw one where this was a problem. I can't believe that
this is an issue with a software product in 2004. Data should have been
alowed in headers before the product ever went beta.
But, since this is apparently, and sadly, the case with this product, has
anyone from the support staff thought of writing a clear and concise help
article on how to make this reliably work?I have spent too much time on this myself. If you ever see anything that
tells how please let me know.
T
"G D B" <gdb@.nospam.com> wrote in message
news:e90EAUhhEHA.3928@.TK2MSFTNGP11.phx.gbl...
> I have read all sorts of threads in this forum on various clumsy and
complex
> ways in which to put data in a heading so it will repeat on multiple
pages.
> I have used all sorts of report software in the past several decades and I
> don't think I ever saw one where this was a problem. I can't believe that
> this is an issue with a software product in 2004. Data should have been
> alowed in headers before the product ever went beta.
> But, since this is apparently, and sadly, the case with this product, has
> anyone from the support staff thought of writing a clear and concise help
> article on how to make this reliably work?
>sql
Put multiple results in one field
I need to put multiple results in one field, but not sure how. Here's
some sample code:
select a.name,
a.accountnum,
a.ordernum,
(select itemid from items where items_ordernum = a.ordernum) as
Items
>From clients a
There's multiple instances of 'itemid' in 'items' with the criteria I
gave, so this generates an error. I want to instead have the item
numbers listed as just a list seperated by commas, so the results might
be this:
Name AccountNum OrderNum Items
John Smith 12345 0000234 1233, 1333, 4322
Mike Jones 43223 0000023 4322, 543
And so forth. Is there someway to loop through this sub-query and make
the results become a list?
Thanks --
rlanglyHow do I concatenate strings from a column into a single row?
http://www.aspfaq.com/show.asp?id=2529
AMB
--
Message posted via http://www.sqlmonster.com|||Why do you wish to destroy First Normal Form? You are supposed to do
display formatting in the front end and never in the database.sql
Monday, March 26, 2012
Push replication to multihomed client fails
Hi
We're having problems with push replication to multihomed clients. if the DNS contains multiple IP's and one of those are not reachable from the sql server. the replication fails. no matter order of IP adresses. i wrote a DNS proxy which re-ordered the IP's so that the "working" IP would come first in the list but no success until i filtered out so that the DNS proxy only replied with one, the working, IP.
the replication is part of a commercial application which we have no control over. are there any settings on the server side that can help here? I really want to fix the source of the problem and not patch it with a proxy.
any ideas are welcome. the server is sql 2005 standard and the clients are running 2005 express
Rgds
just an update, if anyone has the same problem
i found out how it works by reading this thread.
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1526698&SiteID=1
this doesnt fix the problem. but it explains it very well. so we'll stick with the proxy.
Push replication to multihomed client fails
Hi
We're having problems with push replication to multihomed clients. if the DNS contains multiple IP's and one of those are not reachable from the sql server. the replication fails. no matter order of IP adresses. i wrote a DNS proxy which re-ordered the IP's so that the "working" IP would come first in the list but no success until i filtered out so that the DNS proxy only replied with one, the working, IP.
the replication is part of a commercial application which we have no control over. are there any settings on the server side that can help here? I really want to fix the source of the problem and not patch it with a proxy.
any ideas are welcome. the server is sql 2005 standard and the clients are running 2005 express
Rgds
just an update, if anyone has the same problem
i found out how it works by reading this thread.
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1526698&SiteID=1
this doesnt fix the problem. but it explains it very well. so we'll stick with the proxy.
sqlFriday, March 23, 2012
Purposely making mismatched SQL accounts on different databases
Tuesday, March 20, 2012
pulling multiple entry's with jscript
var sSql = "select nIndex,sDescription from StatisticalDiskIdentification " +
"JOIN PivotStatisticalMonitorTypeToDevice ON " +
"StatisticalDiskIdentification.nPivotStatisticalMonitorTypeToDeviceID = " +
"PivotStatisticalMonitorTypeToDevice.nPivotStatisticalMonitorTypeToDeviceID " +
"where (PivotStatisticalMonitorTypeToDevice.nStatisticalMonitorTypeID='2') and " +
"PivotStatisticalMonitorTypeToDevice.nDeviceID = " + nDeviceID;
while (oRs = oDb.Execute(sSql)){
if ( !oRs.EOF )
{
// Display various columns in the debug log (Event Viewer).
var sDisplay;
nIndex = "" + oRs("nIndex");
Context.LogMessage("nIndex=" + nIndex);
sDesc = "" + oRs("sDescription");
Context.LogMessage("Description =" + sDesc);
}
Context.SetResult( 0, " Ok");
oRs.MoveNext();
}
Thanks for any help
You should move Execute outside of the loop if your intention is to iterate through the recordset.
!oRs.EOF should be the loop condition instead.
Pulling data from 2 tables, 1 with possibly multiple records
CREATE TABLE PC (
PCName varchar(50) NOT NULL,
Make varchar(50),
Model varchar(50),
SerialNumber varchar(50)
PRIMARY KEY
(PCName)
)
INSERT INTO PC(PCName, Make, Model, SerialNumber) values ('TEST1', 'Dell',
'OptiPlex GX1', '12345')
INSERT INTO PC(PCName, Make, Model, SerialNumber) values ('TEST2', 'Dell',
'PowerEdge 6450', '23456')
CREATE TABLE CPU (
PCName varchar(50) NOT NULL REFERENCES PC(PCName),
Row int NOT NULL,
Type varchar(50),
Speed int
PRIMARY KEY
(PCName, Row)
)
INSERT INTO CPU (PCName, Row, Type, Speed) values ('TEST1', 1, 'Pentium
III', 1000)
INSERT INTO CPU (PCName, Row, Type, Speed) values ('TEST2', 1, 'Pentium III
Xeon', 700)
INSERT INTO CPU (PCName, Row, Type, Speed) values ('TEST2', 2, 'Pentium III
Xeon', 700)
INSERT INTO CPU (PCName, Row, Type, Speed) values ('TEST2', 3, 'Pentium III
Xeon', 700)
INSERT INTO CPU (PCName, Row, Type, Speed) values ('TEST2', 4, 'Pentium III
Xeon', 700)
The CPU table holds an entry for each CPU in the PC. Now I want the view to
retrieve 1 row per PC and look like this...
PCName Make Model SerialNumber Type
Speed NumberOfCPUs
========================================
==============================
TEST1 Dell OptiPlex GX1 12345 Pentium III
1000 1
TEST2 Dell PowerEdge 6450 23456 Pentium III
Xeon 1200 4
... where NumberOfCPUs is the max(Row) for each particular PC.
Any ideas? Unfortunately we are stuck with the table structure as is (from
a 3rd party).
ThanksJim
Thanks for posting DDL
See , if this helps you
SELECT PC.PCName,Make,Model,SerialNumber,
Type, Speed,NumberOfCPUs FROM PC JOIN
(
SELECT MAX(Row)NumberOfCPUs,PCName,Type,Speed FROM CPU
GROUP BY PCName,Type,Speed
) AS Der ON PC.PCName=Der.PCName
"Jim Coyne" <REcoyneMO_jimVE@.hoMEtmail.com> wrote in message
news:usUSwQlvFHA.2072@.TK2MSFTNGP14.phx.gbl...
> I'm trying to create a view which pulls data from the following 2 tables:
> CREATE TABLE PC (
> PCName varchar(50) NOT NULL,
> Make varchar(50),
> Model varchar(50),
> SerialNumber varchar(50)
> PRIMARY KEY
> (PCName)
> )
> INSERT INTO PC(PCName, Make, Model, SerialNumber) values ('TEST1', 'Dell',
> 'OptiPlex GX1', '12345')
> INSERT INTO PC(PCName, Make, Model, SerialNumber) values ('TEST2', 'Dell',
> 'PowerEdge 6450', '23456')
> CREATE TABLE CPU (
> PCName varchar(50) NOT NULL REFERENCES PC(PCName),
> Row int NOT NULL,
> Type varchar(50),
> Speed int
> PRIMARY KEY
> (PCName, Row)
> )
> INSERT INTO CPU (PCName, Row, Type, Speed) values ('TEST1', 1, 'Pentium
> III', 1000)
> INSERT INTO CPU (PCName, Row, Type, Speed) values ('TEST2', 1, 'Pentium
> III Xeon', 700)
> INSERT INTO CPU (PCName, Row, Type, Speed) values ('TEST2', 2, 'Pentium
> III Xeon', 700)
> INSERT INTO CPU (PCName, Row, Type, Speed) values ('TEST2', 3, 'Pentium
> III Xeon', 700)
> INSERT INTO CPU (PCName, Row, Type, Speed) values ('TEST2', 4, 'Pentium
> III Xeon', 700)
>
> The CPU table holds an entry for each CPU in the PC. Now I want the view
> to retrieve 1 row per PC and look like this...
> PCName Make Model SerialNumber Type Speed
> NumberOfCPUs
> ========================================
==============================
> TEST1 Dell OptiPlex GX1 12345 Pentium
> III 1000 1
> TEST2 Dell PowerEdge 6450 23456 Pentium III
> Xeon 1200 4
>
> ... where NumberOfCPUs is the max(Row) for each particular PC.
> Any ideas? Unfortunately we are stuck with the table structure as is
> (from a 3rd party).
> Thanks
>|||Yes, that certainly does. Thank you very much.
"Uri Dimant" <urid@.iscar.co.il> wrote in message
news:uMIH0gmvFHA.2312@.TK2MSFTNGP14.phx.gbl...
> Jim
> Thanks for posting DDL
> See , if this helps you
>
> SELECT PC.PCName,Make,Model,SerialNumber,
> Type, Speed,NumberOfCPUs FROM PC JOIN
> (
> SELECT MAX(Row)NumberOfCPUs,PCName,Type,Speed FROM CPU
> GROUP BY PCName,Type,Speed
> ) AS Der ON PC.PCName=Der.PCName
>
> "Jim Coyne" <REcoyneMO_jimVE@.hoMEtmail.com> wrote in message
> news:usUSwQlvFHA.2072@.TK2MSFTNGP14.phx.gbl...
>
Pulling data across multiple tables.
LEFT JOIN seems like a possible solution, however, if a user has more than one membership status record, it is returning multiple results for that user (when I only want 1 result for that user).
Here is the code that I have so far.
SELECT Users.UserID FROM Users LEFT JOIN Payment ON Users.UserID = Payment.UserID AND Users.Age > 30 AND Payment.PaymentExpirationDate > '3/28/2004' ORDER BY Payment.MembershipNumber DESC, Users.LastActive DESC
Payment.MembershipNumber - INT Field. This is the membership status for the user, if the user has any membership records.
Users.LastActive - Date/Time Field. This is the recent active for the user.
The data is being returned right now is:
UserID
=====
3
8
12
12
12
9
9
1
... and so on, when it should look like ...
UserID
=====
3
8
12
9
1
I hope this makes sense. Thanks for your time.
Jamesif a user has more than one membership status record, which one do you want?|||I need the first membership status record that has a PaymentExpirationDate closest to '3/28/2004'.|||select U.UserID
, U.lastActive
, P.PaymentExpirationDate
from Users U
left
join Payment P
on U.UserID
= P.UserID
and P.PaymentExpirationDate
> '3/28/2004'
where U.Age > 30
and P.PaymentExpirationDate
= ( select min(PaymentExpirationDate)
from Payment
where UserID = P.UserID
and PaymentExpirationDate
> '3/28/2004' )
order
by U.LastActive desc
Wednesday, March 7, 2012
Publish to Multiple folders
It seem like all of the reports must be sent to the same folder and then
moved, which is quite annoying. Am I missing something?
TIA
DeanI split the reports in the development environment to different projects.
Each project goes to a different folder.
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"Dean" <deanl144@.hotmail.com.nospam> wrote in message
news:OMxvOJpCIHA.748@.TK2MSFTNGP04.phx.gbl...
> Is it possible to publish reports in a project to different target
> folders? It seem like all of the reports must be sent to the same folder
> and then moved, which is quite annoying. Am I missing something?
> TIA
> Dean
>|||I agree that this is rather annoying.
If you have separate projects for each report how do you handle Shared
Data Sources? For instance, if you have 5 reports in 5 individual
projects all using the same shared data source, and that data source
changes, do you need to update all 5 projects, otherwise one will over
write the other?
On Oct 9, 10:33 am, "Bruce L-C [MVP]" <bruce_lcNOS...@.hotmail.com>
wrote:
> I split the reports in the development environment to different projects.
> Each project goes to a different folder.
> --
> Bruce Loehle-Conger
> MVP SQL Server Reporting Services
> "Dean" <deanl...@.hotmail.com.nospam> wrote in message
> news:OMxvOJpCIHA.748@.TK2MSFTNGP04.phx.gbl...
> > Is it possible to publish reports in a project to different target
> > folders? It seem like all of the reports must be sent to the same folder
> > and then moved, which is quite annoying. Am I missing something?
> > TIA
> > Dean|||I name the shared data source the same name in each project. Yes, I have to
update the data sources in each project but I only have to do it once on the
server. In RS 2005 you have the option of putting all your shared data
sources in one place which I have done. All the folders use the same shared
data sources.
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"Matt Penner" <mattpenner2007@.gmail.com> wrote in message
news:1191966220.593999.117590@.g4g2000hsf.googlegroups.com...
>I agree that this is rather annoying.
> If you have separate projects for each report how do you handle Shared
> Data Sources? For instance, if you have 5 reports in 5 individual
> projects all using the same shared data source, and that data source
> changes, do you need to update all 5 projects, otherwise one will over
> write the other?
> On Oct 9, 10:33 am, "Bruce L-C [MVP]" <bruce_lcNOS...@.hotmail.com>
> wrote:
>> I split the reports in the development environment to different projects.
>> Each project goes to a different folder.
>> --
>> Bruce Loehle-Conger
>> MVP SQL Server Reporting Services
>> "Dean" <deanl...@.hotmail.com.nospam> wrote in message
>> news:OMxvOJpCIHA.748@.TK2MSFTNGP04.phx.gbl...
>> > Is it possible to publish reports in a project to different target
>> > folders? It seem like all of the reports must be sent to the same
>> > folder
>> > and then moved, which is quite annoying. Am I missing something?
>> > TIA
>> > Dean
>|||Ah, thanks.
On Oct 10, 6:52 am, "Bruce L-C [MVP]" <bruce_lcNOS...@.hotmail.com>
wrote:
> I name the shared data source the same name in each project. Yes, I have to
> update the data sources in each project but I only have to do it once on the
> server. In RS 2005 you have the option of putting all your shared data
> sources in one place which I have done. All the folders use the same shared
> data sources.
> --
> Bruce Loehle-Conger
> MVP SQL Server Reporting Services
> "Matt Penner" <mattpenner2...@.gmail.com> wrote in message
> news:1191966220.593999.117590@.g4g2000hsf.googlegroups.com...
> >I agree that this is rather annoying.
> > If you have separate projects for each report how do you handle Shared
> > Data Sources? For instance, if you have 5 reports in 5 individual
> > projects all using the same shared data source, and that data source
> > changes, do you need to update all 5 projects, otherwise one will over
> > write the other?
> > On Oct 9, 10:33 am, "Bruce L-C [MVP]" <bruce_lcNOS...@.hotmail.com>
> > wrote:
> >> I split the reports in the development environment to different projects.
> >> Each project goes to a different folder.
> >> --
> >> Bruce Loehle-Conger
> >> MVP SQL Server Reporting Services
> >> "Dean" <deanl...@.hotmail.com.nospam> wrote in message
> >>news:OMxvOJpCIHA.748@.TK2MSFTNGP04.phx.gbl...
> >> > Is it possible to publish reports in a project to different target
> >> > folders? It seem like all of the reports must be sent to the same
> >> > folder
> >> > and then moved, which is quite annoying. Am I missing something?
> >> > TIA
> >> > Dean