[Solved] WHat Can I do ? During Installing MSSQl server 2014 brings message . An error was encountered. The system cannot read from the specified device

WHat Can I do ? During Installing MSSQl server 2014 brings message . An error was encountered. The system cannot read from the specified device solved WHat Can I do ? During Installing MSSQl server 2014 brings message . An error was encountered. The system cannot read from the specified device

[Solved] There are more columns in the INSERT statement than values specified in the VALUES clause [closed]

Your problem is that you are attempting to insert 3 values: values(‘{0}’,'{1}’,N'{2}’) Into 4 columns: (nokar,modeledokht,tozihat,username) I believe you meant to do this: values(‘{0}’,'{1}’,N'{2}’,'{3}’) Side note: Always use Command.Parameters instead of parsing your command as string! When parsing the command as a string, you are subjected to SQL injections and errors like the one you … Read more

[Solved] SQL Join query to return matching and non-matching record

Your problem is coming from including columns in SELECT statement from table_2 that do not have values for rows that exists in table_1. You need to change SELECT Table_2.ScriptNumber to SELECT Table_1.ScriptNumber As future reference make sure you always select all relevant columns from LEFT tables and only columns you need from RIGHT table. Otherwise … Read more

[Solved] With a precision of two decimal places, determine the average number of guns for all battleships (including the ones in the Outcomes table)

With a precision of two decimal places, determine the average number of guns for all battleships (including the ones in the Outcomes table) solved With a precision of two decimal places, determine the average number of guns for all battleships (including the ones in the Outcomes table)

[Solved] Current month and last month data in single row

You can use an aggregate function with a CASE expression similar to this: select itemname, sum(case when month(date) = month(getdate()) -1 then amt else 0 end) LastMonthAmt, sum(case when month(date) = month(getdate()) then amt else 0 end) CurrentMonthAmt from yourtable group by itemname; See SQL Fiddle with Demo 0 solved Current month and last month … Read more

[Solved] How to insert a variable in a query in asp.net c#? [closed]

Your method is open to SQL Injection. You should try this: protected void Button1_Click(object sender, EventArgs e) { string email = Request.QueryString[“Email”]; cmd.Connection = cn; cmd.CommandType = CommandType.Text; cmd.CommandText = “INSERT INTO Job (Industry, JobPosition, ExactAddress, Region, Salary, JobDesc, EmployerID) VALUES (@industry, @jobPosition, @exactAddress, @region, @salary, @jobDesc, (Select employerid from employer where email = @email))”; … Read more

[Solved] Variable Declaration [closed]

Collect your error messages, if you get none return the result of your query, else return or raise the collected errormessages. Declare @a Table (a int,b int,c int) insert into @a Values(1,2,3),(4,4,4) Declare @va int=2 Declare @vb int=2 Declare @vc int=2 Declare @error Varchar(100)=” if not exists(select * from @a where a=@va) Select @Error=@Error + … Read more

[Solved] Stored procedure takes too much time in if statement when i pass @ip=” and takes 0 sec with some value to @IP

As I wrote in the comment the answer of your first question is: If I understand your PRC well, in case of @IP = ” it should returns a wieder set of members. I think it is possible that the Username, Email or Country is longer in the member table then the @Temp table’s definition. … Read more

[Solved] Separate a value from string in SQL Server 2012 [duplicate]

create the UFN_STRING_SPLIT function suggested by @Dave here link create FUNCTION [dbo].[UFN_STRING_SPLIT] ( @List NVARCHAR(MAX), @Delimiter NVARCHAR(255) ) RETURNS TABLE WITH SCHEMABINDING AS RETURN ( SELECT Item = y.i.value(‘(./text())[1]’, ‘nvarchar(max)’) FROM ( SELECT x = CONVERT(XML, ‘<i>’ + REPLACE(@List, @Delimiter, ‘</i><i>’) + ‘</i>’).query(‘.’) ) AS a CROSS APPLY x.nodes(‘i’) AS y(i) ); test your code: … Read more

[Solved] Show each row that is a duplicate

Final update After yet another goal post shifting, I’ve updated my CTE again. This is the final update since even if you are going to change your demands again I’ve had enough. Please take my advice for future questions: Defind the problem as well as you can. Provide the most accurate table structure and sample … Read more