sql-server-2008-r2

Auto Import many .txt files into sql server table

拈花ヽ惹草 提交于 2020-01-17 10:28:29
问题 I have many .txt files and I want to import them into SQL Server table. The file names are something like: hazem.20160922.txt hazem2.20160921.txt The table exists already so no need to create it again. This is a daily activity, so I will need to automate that. I read many articles online and I am unable to do it. 回答1: Since you said it is an automatic process that should happen every day, you can create an SSIS (ETL) Job to do this and you can schedule the job in such a away that it will run

Converting SQL date formats not ending up the same

╄→гoц情女王★ 提交于 2020-01-17 08:11:25
问题 I am trying to remove the timestamp from my date values so I end up with something like mm/dd/yy or mm/dd/yyyy. I referenced many technet, stackoverflow, and w3schools articles but still can't get the date to appear correctly. All of my columns in the table are defined as a datetime and they come from the same table. I am using convert statements like this: CONVERT(VARCHAR(10), E.PD_DT, 101) AS 'Paid Date' In place of 101 I have used 10 and 11, still have the same issue with the data (below).

Can I use an existing dataset in SSRS?

吃可爱长大的小学妹 提交于 2020-01-17 06:18:29
问题 Related to a question I've asked earlier regarding SSRS, could anyone please tell me - Is it possible to reuse an existing dataset in SSRS? I know we can have shared datasets and we can convert a dataset to a shared one too. Currently we are using Crystal Reports. We are trying to migrate to SSRS. So we were trying to reuse the existing dataset which we've used to create Crystal Reports. There is no option I could see to convert this dataset to a shared dataset so that I can reuse it. I could

Can I use an existing dataset in SSRS?

不想你离开。 提交于 2020-01-17 06:18:27
问题 Related to a question I've asked earlier regarding SSRS, could anyone please tell me - Is it possible to reuse an existing dataset in SSRS? I know we can have shared datasets and we can convert a dataset to a shared one too. Currently we are using Crystal Reports. We are trying to migrate to SSRS. So we were trying to reuse the existing dataset which we've used to create Crystal Reports. There is no option I could see to convert this dataset to a shared dataset so that I can reuse it. I could

nvarchar column result with question marks

拥有回忆 提交于 2020-01-16 09:59:08
问题 I'm trying to update the queue item and retrieve it's column text content. the problem is that special signs such as Hebrew chars resulted in question marks: ???? I can see the text perfectly fine by making direct SELECT clause (within the sql management studio ): Message's column ------- היי hey When i try to retrieve the data it get scrambled : היי ---> ??? (Not OK) hey ---> hey (OK) My table: CREATE TABLE [dbo].[MyQueue]( [Message] [nvarchar](1000) NOT NULL --some additional columns ) This

How to show the results for the last three months?

自闭症网瘾萝莉.ら 提交于 2020-01-16 09:48:33
问题 I am developing a training management web-based system which will show the management the training record for each division. My database design is like following: Employee Table: Username, Name, Job, DivisionID Division Table: DivisionID, DivisionName Quiz Table: QuizID, Title, Description UserQuiz Table: UserQuizID, Score, DateTimeComplete, QuizID, Username NOTE: The first attribute in each table is the primary key. The SQL Query that I am using for this task is: SELECT COUNT(DISTINCT dbo

SQL Server Convert text from english to other language via an sp or function

狂风中的少年 提交于 2020-01-16 05:21:08
问题 I have a table in sql server which stores some text in english (in nvarchar column). I have to create a stored procedure to which I will pass a language (Hindi,Gujarati,Arabic) as a parameter & it will return me data converted to that language from English. I understand that best way would be to store data in those languages in different columns but I cannot do it & want to rely on sql server. Is there some utility or function which will help me accomplish this. Looking For Starters or ideas.

sql Runtime reports

情到浓时终转凉″ 提交于 2020-01-15 12:31:17
问题 I have a query which displays information from a table like this. SELECT tag.label, inputs.input_raw, inputs.unix_timestamp, tag.inverted FROM inputs JOIN tag ON tag.tag_id = inputs.tag_id WHERE (inputs.tag_id = 92084) AND (inputs.date_time > dateadd(day,-1,getdate())) ORDER BY date_time DESC I would like to write a query which would do two things. I need a count of every time input_raw switches from '0' to '1'. I also need a total time of the pump running, using the unix_timestamp ie. when

sql Runtime reports

你。 提交于 2020-01-15 12:31:14
问题 I have a query which displays information from a table like this. SELECT tag.label, inputs.input_raw, inputs.unix_timestamp, tag.inverted FROM inputs JOIN tag ON tag.tag_id = inputs.tag_id WHERE (inputs.tag_id = 92084) AND (inputs.date_time > dateadd(day,-1,getdate())) ORDER BY date_time DESC I would like to write a query which would do two things. I need a count of every time input_raw switches from '0' to '1'. I also need a total time of the pump running, using the unix_timestamp ie. when

string into single column [duplicate]

蓝咒 提交于 2020-01-15 12:13:02
问题 This question already has answers here : T-SQL split string (26 answers) Closed 5 years ago . I have the comma separated string as shown below to convert into a column. Example : Given String: DECLARE @STR VARCHAR(MAX) = 'ABC,DEF,GHI,JKL,MNO' Have to convert into a single column: columnName ----------- ABC DEF GHI JKL MNO 回答1: Try this. Used LTRIM and RTRIM function to remove Leading and Trailing spaces. DECLARE @STR VARCHAR(MAX) = 'ABC,DEF,GHI,JKL,MNO' SELECT Rtrim(Ltrim(Split.a.value('.',