sql-server's questions - English 1answer

0 sql-server questions.

I am writing a small windows tool to search a few SQL databases. I was able to connect and search the first database without issues but I keep getting the following login error when I try to search ...

I am trying to create a Query that will add 15% to items greater than or equal to $20.00 but I can't seem to figure it out. Here is what I have so far. Everything is working as it should EXCEPT I don'...

What is the best way (performance wise) to paginate results in SQL Server 2000, 2005, 2008, 2012 if you also want to get the total number of results (before paginating)?

I've created a CLR funtion for SQL Server 2014 that should calculate subtraction between the first and the last value in column [Value]. Here is the table: Date_Time Value ----...

Can anyone help with an expression to alternate the colors between records under 'Service'. The report is GROUPED BY 'Service'. I have tried =IIF(RowNumber(Nothing) Mod 2, "Silver", "White") ...

First of all, I know there are a few other questions with a similar issue but I really would appreciate a clear and working answer. My colleagues and I have tried opening the database from Access (...

I have a table that stores posts. I want to create a query to retrieve posts and if the current user liked this post. This is my query: select *,CAST(iif(exists(select 1 from Post.PostLike where ...

This is the database stored procedure: ALTER PROCEDURE [dbo].[getShift] @rfiddata VARCHAR(50) AS BEGIN SELECT pd.TP, s.s_name, dt.dt_type, dr.dr_date FROM ...

According to this article there is a serious bug in how the paging cookie is managed in Microsoft CRM. In short, the bug appears when trying to retrieve more than 5000 records in a one-to-many ...

Sample data below, I need to pivot this data and turn Num Column into, NUM1, NUM2, NUM3, NUM4, etc.. up to NUM12 and In ASCending order. This seemed easy at first. Data comes from a View generating ...

In T-SQL, if I wanted to reuse the same query but just update the value of the nested variable, how can I accomplish this? I have tried both examples below, however, instead of yielding an ID, both ...

Why only the else condition runs? Postalcode column is float, City column is nvarchar. I think the fail is the string may be mistake. private void txt_st_postalcode_Leave(object sender, EventArgs e) ...

I have two versions (2012, 2014) of SQL Server Express LocalDB installed in my system. How can I find all existing LocalDB instance names? I found a way to do that using command line as mentioned ...

I'm trying to use SQL Server Management Studio to transform some Insurance Policy data from Policy table to a Driver table. I need to create a new row for each additional driver on a policy but ...

I have several tables with a foreign key constraint that has the option ON DELETE CASCADE. Every table belongs to the same schema called datasets. I'm able to retrieve the complete list of tables ...

Here is a question I am having problems writing the proper query for and below the question is what I have so far.. List the company name, contact name, phone number, and country from the Customers ...

I have a temporal table Person with PersonHistory. Collumns: [Id], [Name], [DepartmentId], [ModifiedBy], [SysStartTime] and [SysEndTime]. When physically deleting a row I want to persist who ...

I am learning by doing - Python, Pandas, SQL & Deep Learning. I want to build a database with data for a deep learning experiment (with Keras and Tensorflow). The source data is ~10GB (total) of ...

I just started learning XML today. I was trying to create a 'sample' XSD and populate it but.. I made up my data and it looks fine, but I can't make this schema work.. CREATE XML SCHEMA COLLECTION ...

In my example, there are more than one of the same EMPID depending on how many PAY's is associated to to that variable. However, for each PAY and EMPID, there is only 1 DATE. What I am trying to ...

Amateur sql user, I'm looking for potential ways where I could be using the student and professor's data and manipulate for more trends.

I'm trying to append a dataframe to a sql server table using: DBI::dbWriteTable(con_poc, "DEP_EVENTS", data_up, overwrite=FALSE, append = TRUE, verbose = TRUE, rownames = FALSE) But I am getting an ...

I have a database with multiple schemas, tables, and views. What I would like to do is get a list of the table names under a specific schema, and exclude the views. I can get most of the way there ...

I have worked little bit with DBI in R and first question is more of best practice, as currently appending new data to DB is taking more time than I hoped. Second is error that I'm receiving when ...

I want to pass the contents of a data.frame as a table-valued parameter to an Microsoft-SQL-Server stored procedure using a DBI-compliant R package like odbc. How can I do this? I have a first ...

I have set simple cookies using classic asp e.g. <%response.cookies("user")="A"%>. As I read in this Q/A, such cookies just rely on domain name and nothing else. I have tested when I stop and ...

I continue to read the DBI/ODBC is faster than RODBC, so I tried as follows: require(DBI);require(odbc) con <- DBI::dbConnect(odbc::odbc(), dsn = 'SQLSERVER1', database = 'AcumaticaDB') I can ...

I am trying to update the data in an XML column, and add a new attribute if it doesn't already exist. Here is the most relevant portion of my script: UPDATE sp set [PolicyXML].modify ('insert ...

Using T-SQL, how would I extract the unique sets from a table using SQL. Here is a sample table: ID Value 1 A 1 B 1 C 2 A 2 B 2 C 3 D 3 E 4 D 4 E 5 X 5 Y 5 Z 6 Q 7 Q 8 ...

I need to bulk copy the below records from .csv file to 3 different tables based on first field . I need to use Bulk Insert in SQL server for doing it. Also I am not sure of final record as the count ...

I have a problem with my query (I am using the Northwind database). First I created a table called ShipperLevel: CREATE TABLE ShipperLevel ( ShipperLevelID int primary key identity, ...

I'm running a DTSX package to move data from SQL to Postgres using the PGOLEDB Native Postgres driver and I'm receiving an error (below). How do I read this error and determine what row/column is ...

I have a table in my database that looks like the this: I have written my R script to use rxSummary to calculate the mean and standard deviation. My intent is to group by Product Number and ...

I'm very new to SQL so any help on this would be greatly appreciated. I have the following table: I need to force NOT NULL on BusinessName and BusinessType, but only if CustomerType = 'Business'. I ...

I am working on project that has the below workflow model: There is stored procedure 1 and the output of that stored procedure will be in XML format as below: the second stored procedure is for the ...

I have an IIS 7.0 server connecting to an SQL 2012 Database. On the SQL database I have added a number of linked servers and created a distributed partitioned view to consolidate data from the ...

I have a SQL Server table with an IDENTITY column (bigint). Let's say that the table contains 100 records, then the IDENTITY column will have values from 1-100. If I delete some records in between, ...

I am querying using this SQL statement in SQL Server 2008: select sum(tax + debit) + (select isnull(sum(tax + credit), 0) from BILLTRANSACTION ...

Please assist if I should use a trigger or procedure. I am trying to update the ScaleRating in table GSelfAssessment from GRatingScale if the Score in GSelfAssessment falls between the minimum and ...

I would be glad to use something like Rethink database r.http command for accessing external APIs directly from the database. It's syntax is very intuitive: r.http('https://api.github.com/users/...

I would like to know, what is the correct way to bind data on a drop down list from a database using stored procedure and C#. I have a drop down list ddlEmployees and an Employee table which has a ...

I am trying to attach a SQL Server database file in Visual Studio but with no luck, I'm stuck with a message that says: Cannot open user default database. Login failed. I even try to take the ...

I've got an error that says "Must declare scalar variable" when I parametize my query. I am new in using SQL Server. And the version that I'm using is SQL Server 2012. Below is the code snippet: ...

I'm new to SQL Server, and I'm asking if can I create a database in other database like this: mydatabase1[database] -> mydatabase2[database] -> mytable[table]

I've created a data context class: public class DBContextZProdDomainSS : DataContext { public Table<ZTask> ZTasks { get; set; } public Table<ZProject> ZProjects { get; set;...

I am trying to run this query but I am getting this error: All queries combined using a UNION, INTERSECT or EXCEPT operator must have an equal number of expressions in their target lists. What am ...

How do I parameterize a query containing an IN clause with a variable number of arguments, like this one? SELECT * FROM Tags WHERE Name IN ('ruby','rails','scruffy','rubyonrails') ORDER BY Count ...

I have an ASP.NET Core 2.1 application which uses Entity Framework Core 2.1 and SQL Server 2017 (Web edition). I read a lot of how to solve problem with multiple tenants, but more or less the answer ...

I am trying to query a table based on comma separated values. If values are present, I need to use. If its empty I need to select all DECLARE @UserIdList VARCHAR(500) = '150, 112' // Not working when ...

I am pretty new to SQL. I am trying to join two tables, tblEmployeeHours and tblWages. However, the Wages table can contain duplicate rows. Here is a snippet of the EmployeeHours table: x------------...

Related tags

Hot questions

Language

Popular Tags