Friday, March 30, 2012
Question about snapshot article defaults and indexes
tables and realized that indexes are not being replicated. The GLOBAL
(Applies to all) article defaults for the snapshot are set as follows:
Copy objects to destination
Indexes for primary keys are always copied
Include declared referential integrityCHECKED
Clustered indexesCHECKED
Nonclustered indexesCHECKED
User triggersNOT CHECKED
Extended propertiesNOT CHECKED
CollationNOT CHECKED
I these defaults should transfer the indexes correctly so I had to look
for another culprit. We have a script which creates three tables daily
so I decided to look at the article defaults for those tables and found
that only the 'Include declared referential integrity box is CHECKED.
QUESTION: What is the stored procedure where these variables can be
set? Is it sp_addarticle and if so what fields?
If we need to use the replicated db what would have been the
implication of not having the proper indexing. Performance?
to set them use the schemaoption parameter of sp_addarticle.
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
Friday, March 23, 2012
Question about locks
(my application). When this application is running nobody else will be
accessing the database.
If I do a table lock isnâ't it still releasing that lock after each statement?
I ask because each update I send to the database will be effecting only one
row at a time so I donâ't think I would get performance gains because I lock
the table for one record update then lock it again etc etc. The manager
itself could most likely do that faster anyway.What do you mean by 'doing a table lock'? Do you mean using a lock hint?
Which hint? What is the statement that is affecting the data?
Have you started an explicit transaction with BEGIN TRAN?
We need to see exactly what you are doing to lock the table to be able to
answer your questions, but in general, it is better to let SQL Server's lock
manager handle all the necessary locking automatically.
Why are you updating only one row at a time? If you are interested in
performance, you might consider figuring out a way to process all the rows
at once. That's what a relational database is good at.
--
HTH
Kalen Delaney, SQL Server MVP
"Sean" <Sean@.discussions.microsoft.com> wrote in message
news:5C5D6009-F702-4100-BCE1-F194E3695DAC@.microsoft.com...
> In short, we are sending several statements to the database from one
> source
> (my application). When this application is running nobody else will be
> accessing the database.
> If I do a table lock isn't it still releasing that lock after each
> statement?
> I ask because each update I send to the database will be effecting only
> one
> row at a time so I don't think I would get performance gains because I
> lock
> the table for one record update then lock it again etc etc. The manager
> itself could most likely do that faster anyway.
>sql
Tuesday, March 20, 2012
question about Gridview and sqlDataSource
i am now writing a web page which can allow users to edit the field(display in the gridview->gridview source is from sqldatasource), there is a problem(it seems that i have followed all steps in the book):
when the i edit the field and click update, in the web site, i can see those changes. however, i cant see any change in database table.
i cant find solution on this, could anyone help me to solve this problem? thx!
Hi, are you checking the right database's table? If you can see the records changed on your gridview, it is CHNAGED in your source table. Please check again.
|||it seems that i have made some mistake while configure data source...but now is ok...thx!!
Monday, March 12, 2012
Question about Excel source - how to modify columns?
Hi,
I have a package that uses an Excel file source. There appears to be no place to modify the column data types as you can with a flat file manager. As such, the source columns do not match the columns in the database.
I believe I must be overlooking something here.
Can someone please tell me how I can modify the Excel column datatypes?
Thanks
nevermind
found it under "advanced editor", "input and output" properties
|||Well, I'm having a difficult time changing the datatypes on my excel columns.
The "input and output properties" allow you to change the datatypes of the "output columns", but if I try to modify the "external columns", I get an error that the source column doesn't match or something to that effect. If I just try to change the length, it gives me other errors. So it seems I can't really change these?
So I left all the "external" columns as unicode strings with the original length, and changed the "output columns" to regular strings and the floats to numerics.
But in the end, this has solved nothing because I'm still getting truncation errors. So obviously changing the "output columns" isn't enough.
I really don't think I'm doing this right! Need help.
|||Sadie,Use a derived column or a data conversion component to change your data types. Let the Excel manager and Excel Source do their jobs. The output data type is dictated by the driver and the data in the Excel sheet.|||You need to use a derived column or data conversion transform to change the data types. Excel data is stored as unicode, and it is a conversion step to change it to ANSI. Same thing for the floats.|||
Ok, duh
makes sense... just never worked with an excel spreadsheet before
Friday, March 9, 2012
Question about data sources formats supported in SQL Server 2005 reporting services
Hi, all here,
I am new to reporting service, I have question about the data source formats which can be get accessed by SQL Server 2005 reporting services server. I mean what kind of data sources formats that can be imported into reporting service server?
Thanks a lot for any help and guidance in advance.
I suppose you mean which kind of data you can access in reports. An overview is available here: http://msdn2.microsoft.com/en-us/library/ms159219.aspx
Besides that, you can use OleDB and ODBC providers, managed .NET providers, and you can implement custom data extensions.
See also: http://msdn2.microsoft.com/en-us/library/ms160324.aspx
-- Robert
|||Hi, Robert, thanks a lot.Question about data import in MS-SQL server
I am performing a data import on the SQL server. Due to fact
that I use the excel file as a source. Some of cells in excel are
actually empty, they become NULL fields after importing into the SQL
server. Actually I want these fields are empty string instead of NULL.
Does SQL server has any approach to make these fields to be empty
string instead of NULL when importing?? Or is there any store
procedure exist for converting the fields to empty string?
Thanks for your kind attention.
BennyBenny (cs_benny@.hotmail.com) writes:
> I am performing a data import on the SQL server. Due to fact
> that I use the excel file as a source. Some of cells in excel are
> actually empty, they become NULL fields after importing into the SQL
> server. Actually I want these fields are empty string instead of NULL.
> Does SQL server has any approach to make these fields to be empty
> string instead of NULL when importing?? Or is there any store
> procedure exist for converting the fields to empty string?
Since I don't know how you import the data, I can't really say what
you could do in that end.
Once the data is in SQL Server, you can say:
UPDATE tbl
SET col = ''
WHERE col IS NULL
--
Erland Sommarskog, SQL Server MVP, sommar@.algonet.se
Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp|||I use DTS import/export wizard to import the data from the Excel file.
So is there any ways to replace the NULL fields with empty string
beside using query to update the fields to empty string?
Erland Sommarskog <sommar@.algonet.se> wrote in message news:<Xns93C0EFC135FA3Yazorman@.127.0.0.1>...
> Benny (cs_benny@.hotmail.com) writes:
> > I am performing a data import on the SQL server. Due to fact
> > that I use the excel file as a source. Some of cells in excel are
> > actually empty, they become NULL fields after importing into the SQL
> > server. Actually I want these fields are empty string instead of NULL.
> > Does SQL server has any approach to make these fields to be empty
> > string instead of NULL when importing?? Or is there any store
> > procedure exist for converting the fields to empty string?
> Since I don't know how you import the data, I can't really say what
> you could do in that end.
> Once the data is in SQL Server, you can say:
> UPDATE tbl
> SET col = ''
> WHERE col IS NULL|||Benny (cs_benny@.hotmail.com) writes:
> I use DTS import/export wizard to import the data from the Excel file.
> So is there any ways to replace the NULL fields with empty string
> beside using query to update the fields to empty string?
Sorry, I don't use DTS so I don't know. But I want to point out the
necessity of providing people full information about what you are
doing.
If you don't get any replies, consider asking in
microsoft.public.sqlserver.dts. (Available on msnews.microsoft.com if your
ISP does not have it.)
Also check out the FAQ on http://www.sqldts.com.
--
Erland Sommarskog, SQL Server MVP, sommar@.algonet.se
Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp|||With DTS, you can transform the data before it gets imported. That's the
'T' in 'DTS'. When moving an Excel spreadsheet to SQL Server, there is a
place in DTS where you select the worksheet from the Excel file. At this
location, there is a Transform button. You can do simple
transformations, or you can use VB code to do more complex
transformations.
HTH,
Brain
Benny wrote:
> I use DTS import/export wizard to import the data from the Excel file.
> So is there any ways to replace the NULL fields with empty string
> beside using query to update the fields to empty string?
> Erland Sommarskog <sommar@.algonet.se> wrote in message news:<Xns93C0EFC135FA3Yazorman@.127.0.0.1>...
> > Benny (cs_benny@.hotmail.com) writes:
> > > I am performing a data import on the SQL server. Due to fact
> > > that I use the excel file as a source. Some of cells in excel are
> > > actually empty, they become NULL fields after importing into the SQL
> > > server. Actually I want these fields are empty string instead of NULL.
> > > Does SQL server has any approach to make these fields to be empty
> > > string instead of NULL when importing?? Or is there any store
> > > procedure exist for converting the fields to empty string?
> > Since I don't know how you import the data, I can't really say what
> > you could do in that end.
> > Once the data is in SQL Server, you can say:
> > UPDATE tbl
> > SET col = ''
> > WHERE col IS NULL
--
================================================== =================
Brian Peasland
dba@.remove_spam.peasland.com
Remove the "remove_spam." from the email address to email me.
"I can give it to you cheap, quick, and good. Now pick two out of
the three"