On my company's website, we have a quote of the day. I would like to be able to type a hundred or so quotes into a mdf file. Then, I would like to have code that randomly selects one of the quotes every day and posts it.
....What I want is very similar to the "Image Of the Day" section on many websites.
I attach my SQL Server Express data file to my host. I would like to copy all of my member information back to my local computer. How can I do this? My host won't allow my to physically copy the data file over. My host is discountasp.net. Thanks,Jeff
my problem is that: I do read informations (e.g. connectionString) from configuration file by one custom assembly. My environment is RS2005, VS.NET 2005 Prof.Edition, WIN2003 Server SP1, .NET Framework 2.0.50727 The scenario is that: A text box into my report require a function contained into MyCustom.dll. This code do read information from MyCustom.dll.config.
I'm importing comma-delimited text files into a SQL table. The data imports in a seemingly random order. One time I import and the lines appear one way and the next time I import they import another way.
Is there a way to force the text files to import in the same order the data is found in the file?
I have a text file that come from our client that is Column deliminated by ~ and row deliminated by {CR}{LF}. There is a comment field that appearently is not cleaned up and has {CR}{LF} within the comment field.
I am new to SSIS and I'm wondering if there is a way to detect and correct the bad rows?
example file formet:
ORDERID~DATE~Comment~Address 1~2/3/2007~Some Comment~1234 oak st 2~2/3/2007~Some messed up comment~345 oak st. 3~2/3/2007~Another comment~3214 asdf blvd.
guys, I'm trying to create a SSIS package to extract a file from a source database (OLEDB source) using a script component(VB or C#) or a variable.I have hundreds of files(datasets) sent to me daily by several clients in the format date/filename/client_name. the package will read the client_name at random and load its data to the corresponding client destination database (OLEDB destination) using a a conditional split:
if client_name is client1
OLEDB_destination1 <- client1 else if client client_name is client2
OLEDB_destination2 <- client2
if client_name is client3 OLEDB_destination3 <- client3
Hi,I need to extract randomly 5 records from the table "Questions". Now I useSELECT TOP 5 FROM Questions ORDERBY NEWID()And it works. The problem is that I need an additional thing: if SQLextracts record with ID=4, then it should not extract record with ID=9,because they are similar. I mean, I'd like something to tell SQL that if itextracts some questions, then it SHOULD NOT extract other ones.How can I do it?Thanks!Luke
Now i want to underlay the following DetailRows to the Group. There can be many DetailRows and the GroupTextBox1 is bigger than one line. If its possible i dont want to use subreports
Hello, I get errors during import process from flat files to sql table (random missing rows) when I have more files to load through a "for each loop" cycle. If one of the files is not present (because not yet generated by an other process) many of the rows present in the next file are skipped during import operation. This happens even if the "maximumErrorCount" is set to 10000. The error reported is Warning: 0x8020200F at Import File Bolle , Source_Bolle [1]: There is a partial row at the end of the file Sql 2005 has Service Pack 2 installed. Can some one help me? Thanks and regards
I have a package that processes a flat file, which is generated by a separate system each weekday around 3:30AM. I would like my package to store the timestamp of the input file and compare it to the timestamp of the next day's file. If they are the same, then the package can exit without reprocessing a particular file again.
So, my first question is whether a package variable can be updated so that its value will persist from one run to the next?
Second, what is the syntax to retrieve the file's timestamp, either directly from the file connection manager or within a script task?
Hi, I've got the query below which works as needed, but it performs the same inner select twice at present. What is the best way of eliminating the second evaluation of the inner select statement? SELECT TOP 1 condition FROM (SELECT condition, COUNT(condition) AS total FROM [JCM].[dbo].[jcmresults] GROUP BY condition) WHERE total = (SELECT MIN(total) FROM (SELECT condition, COUNT(condition) AS total FROM [JCM].[dbo].[jcmresults] GROUP BY condition))
Does anyone know of a neat and easy way to modify this section of hardcode:
SELECT CASE dbo.requestsbyyeartemp.themonth when '1' then 'January' when '2' then 'Febuary' when '3' then 'March' when '4' then 'April' when '5' then 'May' when '6' then 'June' when '7' then 'July' when '8' then 'August' when '9' then 'September' when '10' then 'October' when '11' then 'November' when '12' then 'December' end as 'themonth', etc...
Requestsbyyeartemp is a table where the numbers corresponding to the months are stored. This statement is used to make a new table where the months are stored with the proper names and not numbers.
I would sooner not have any hardcode at all if there is a simple way to do it.
I am learning how to parse XML data into SQL table. Below partial XML data contains multiple sections. I used OPENXML to parse one section but need to parse the remaining sections into a table. For example, below openxml code can only retrieve elements under "NewHires/Newhire/EmployeeInfo/PersonName" section. I also need to parse elements under "NewHires/Newhire/EmployeeInfo/ContactMethod" sections. Notice that there are three subsections underneath the ContactMethod section ("/Telephone", "/InternatEmailAddress", and "/PostalAddress") sections. Not to mention there are EmergencyContact section follow behind.
OpenXML can only extract one section at a time. Does it mean I have to write multiple OpenXML, store them into multiple temp tables then merge them into a single table? If that is the case, how to save all these data into a single table?
I'm new at Reporting Services. I need to know if the Reporting Services will meet my needs.
I need to create a report that looks much like a Word document with large sections of text. Is it possible to hide some sections of text based on boolean fields in a SQL table/query?
Alternatively.. will it handle rich text? I could then select the appropreate section to display by query.
I have lot of information to display on one report. I am trying to come up with a reasonable layout, that could include all the information on one page without over whelming the user. Essentially I would like to divide the report in three sections, ideally with a collapse/expand functionality. Is it possible with Reporting services. How?
Hi, I am new to Microsoft SQL Server Reporting Services. Please tell how to create sections and subsections in the report. Pls provide if any document is there ..
Dear All, I have some problems with the assignment from my professor.
Suppose there are two tables storing first names and last names, one table with column of first name and gender, the other with last name.
how to write stored procedures to get a random first name + random last name for Males or Female. like you got a list of all M & F first name and last name, then you try to match first name with any other last name (I believe this is random).
and the task is to write a script so each time when a female or male full name is need, it will return a random name for the requested gender.
I am totally struck and no idea how to deal with it, in fact I am just a beginning in SQL server, and I know there is a stored procedure to generate random number, however, I can't see the use of it here,,,,:eek:
Could anyone help me out ? thanks very much !!!:beer:
was just wondering if there was an easy way to include a files contents into a web page via a database field. A bit confusing i know.
Here goes:
I got a field called ContentPage stored in a database. (e.g Index.htm)
I want to retrieve this page and then include its contents in my middle div of the webpage like so: <!--#include file="<%=ContentPage%>"-->. Not allowing me to do this as you may have guessed. These pages will either be htm or aspx pages. This would make my life so much easier.
Is there any way of doing this or am i kidding myself.
I have three tables that are joined together to retrieve a piece of data.Table One has the columns pid1(PK), idTable Two has the columns pid1, qid1, idTable three has columns qid1, question, answerHere is my sql statement:SELECT Table1.pid1, Table2.qid1, Table3.Question FROM Table1 JOIN Table2 ON Table1.pid1=Table2.pid1 JOIN Table3 ON Table2.qid1=Table3.qid1 WHERE Table1.pid=...(N)I put an elipsis because I'm stuck on how to proceed from here. See I need to randomly select a value from column pid1 in table1 then use this value to replace N in the sql statement, then have the statement run and randomly return exactly one piece of data instead.Is this possible? How can you randomly get one piece of data from joining three table without a WHERE CLAUSE.
I wanted to check and see if anyone else has experienced an issue with querying sys.databases and not getting all the database rows returned?
I have a query that pulls back a list of databases so I can do backups on them. Randomly I will miss a row or two of databases. If I immediately (in code time) re-issue the same query, I'll get the missing databases. Oddly it seems a more prevalent problem on our Itanium servers, but all our 2005 servers seem to have the same symptom. Also odd, but the master database seems to be most likely to not be in the list (i.e. it happens the most frequently).
It's not a huge deal, but it's a pain to have to run the same query twice, compare the two lists and then double check that the adding or removing of a database should have happened.
I'm using ASP and SQL Serv 2000. What I need to get from 2 tables (company & customers) is random 10 customers from random 20 comp. Anyone got an idea how to do this??? I've spent 2 days trying to get stored proc. or T-SQL to work, but nothing good came out of it. I can get 1 comp and 10 cust, but not a grouped list of 20 comp. w/ 10 cust. each.
"I meant to delete just one assignment, doing which was giving me difficulty.
I deleted a whole category by accident which had most of my daily grades in it for a course with quite a few of them. I was negligent in backing them up, so I cannot restore them. I have an XLS file from the midterm, but am missing about 6 grades after that.
Is there any way to recover the grades I had in the deleted category. It has been a couple of days since I entered any new grades. HELP!"
My current backup strategy is to do a full backup 5 pm, differentials every 2 hours, logs every 30 min, all so they arenot simultaneous. Backing these all to same backup device via three different jobs.
Then the server is backed up to tape shortly after the 5 pm full backup.
Obviously, I can't restore from the backup for this situation because it would hurt other data.
But - is there a way I can take last night's backup from tape and restore it to a different database than our production database? (Such a database doesn't at this time exist. Would I detach, copy over the files, and then reattach on prod and attach on the devl side, and then restore from the backup device to the devl copy?)
I've never had to perform this kind of rescue and am wondering if my backup strategy is flawed since it isn't immediately evident how I can easily do this.
I needed a similar thing from our Oracle DBA yesterday, and he went to tape, copied out a table and put it on the Oracle database under a different owner, and I easily fixed the few records that I had botched.
That's exactly what I need to do now with MS SQL 2000.
I was hoping someone would be able to help me, I trying to go through several databases, 111 to be exact, and get the data out of a particular table which is present in all the databases on the same server.
I know how to get the names of the databases from the INFORMATION_SCHEMA, but how can use the name for it to cycle through all the databases and get data out of the one particular table.
Hi, I need some help. I have this query where i need to pull up students that have more than or equal to 3 absences in a row. Now I am getting all those students that are absent but not in a row. But i was wondering if there is a way to tell if a student was absent three days in a row . There is a date field that is being used to identify the day of the class and a status field that identifies if the student was absent or present. Please help someone.
Up to the moment I've got enough knowledge for read data stored into .LDF files by dbcc log and so on. It's very useful and interesting. Now, I wonder how to retrieve the same information but on MDF files.
At first, I want to make sure that is not possible by mean of traditional methods (dbcc or something like that) I suppose so but I'd like to hear opinions regarding that.
Thanks in advance for any idea, though or further information.
this is a simple problem but it's just driving me mad as it's not reading from my dB. basically, I've have reviews stored in my dB and want to display them in a textbox by clicking on a button called btnReviews. I think the problem might be that there is too much text stored per row of the table (as it is a review), but I have the datatype set as text in sql. here's the simple un-errorred code I have behind the button. any ideas where I went wrong. i've a feeling it's something small but it's just taken too long to figure out.protected void btnReviews_Click(object sender, EventArgs e) { String strConn = ConfigurationManager.ConnectionStrings["conLocalDatabase"].ConnectionString; SqlConnection dbConnection = new SqlConnection(strConn); SqlCommand dbCommand = new SqlCommand("Select [ReviewC] From [Review])", dbConnection); dbCommand.Parameters.AddWithValue("Review", txtReviewView.Text); try { dbConnection.Open(); dbCommand.ExecuteNonQuery(); } catch (SqlException ex) { Console.WriteLine(ex.ToString()); } finally { if (dbConnection != null) { dbConnection.Close(); } } }
Hi I ve a datagrid . And Two Database table in sqlServer2005. The name of the tables are 'Property' and 'userid'. My datagrid wants to retrive all records from Property table and one record from userid table. The Property table contains Propertycode, lastdate , departmentname. The userid table contains so many record along with 'id' record which my datagrid wants to retrieve. pl tel me how 2 write code for that?
I have four tables that need to be loaded into an ASP.NET application. They need to be loaded together into one result set and sorted. Is it possible to load four tables together and sort them using an SQL statement?
I am aware of and am using the SELECT ... ORDER BY feature of MSSQL in my present ASP.NET application to retrieve from single database tables. I'm using merged datasets and a sort method to solve the above problem at the moment.
I'm preparing a report that will display provider number, provider name, and a single field that will show all the counties that specific provider serves. I realize from researching the coalesce posts that this can be done. However, when I try to retrieve data in the same select statement as my coalesce, I get the error: "A SELECT statement that assigns a value to a variable must not be combined with data-retrieval operations."The listing of the counties must be specific to the provider, so my original code was:
DECLARE @Counties varchar(1000) SET @Counties = '' SELECT a.PROV_ID, a.PROV_NAME, @Counties=coalesce(@Counties,'') + b.COUNTY + ',' from ECBH.dbo.tbl_PROVIDERS a inner join ECBH.dbo.tbl_Provider_Serv_Regions c on a.PROV_ID = c.PROV_ID inner join ECBH.dbo.tbl_Regions b on b.REGION_ID = c.REGION_ID where c.PROV_ID = a.PROV_ID and a.MASTER = 1
I thought about creating a table to hold the coalesced values (need to coalesce two other fields as well), but wouldn't an insert to a table fail for the same reason?The counties table does not relate to the provider table, but does relate to a provider_county table (which in turn relates to the provider table).
Thank you for reading this. I am faced with a problem where there is no storage of deleted or updated information in an OLTP DB. I am mostly concerned about retrieving the deleted data from a table when an update occurs so as to make the deleted data show as an error. Is there a way to retrieve these kind of data from a DB, if so how? Can these data be retrieved by dates? Also how much time do you have before the data can no longer be retrieved? Assuming that the data can be retrieved.
I know the good stuff about datawarehousing but unfortunately we have no DW. Any help will be greatly appreciated.