Skip to main content

All Questions

0 votes
1 answer
45 views

How to limit the results of a query and group them together,

I have the two tables pictured from a "city jail' DB, one is the sentences given to criminals and the other criminal information. I am trying to write a query the lists only the criminal_id, ...
dheeke's user avatar
  • 37
0 votes
0 answers
151 views

Which SQL server version supports varchar(MAX) data type

We should use varchar(max) when length of string varies and max limit is 2GB. Is it supported in older versions like SQL server 2005? If supports then still the MAX size limit is 2GB?
Ismail Asghar's user avatar
-1 votes
1 answer
27 views

SQL SERVER - GRAB RECORD FROM THE TABLE BASED ON COLUMN ID

I have a db with records like the following structure in the table; id,msg,date,fid 19 ,"hello","2012-02",0 20 ,"hello","2012-03",19 I have and entire db set up like this where the fid in some ...
dontay's user avatar
  • 63
0 votes
1 answer
70 views

Force CharIndex return only 0 if more than one instance is not found?

My Row_1 value is <FeeSize><XMLs><XML Character="1.11" MaxXML="249999.99" Fee="1.60" Cost="1.8" Size="1.8"/><XML Character="251111.11" MaxXML="499999.99" Fee="1.40" Cost="1.7" ...
Arun's user avatar
  • 75
0 votes
1 answer
37 views

How to save 2 student object getting values from form under one submit button in .net MVC application?

Here is the Code and the Controller code is also thereThis is the Model of Entity Relationship `public JsonResult Submit(Student_Information stu) { db.Student_Information.Add(stu);...
hasnaintahir's user avatar
2 votes
2 answers
439 views

SQL Server : Order By 2 Columns (get ColumnX > Null First and then Id > Order By DESC)

I want to retrieve records from MSSQL Server according to 2 column values: ColumnX and Id. First I want to retrieve null records of ColumnX (at the top) and then order by Id desc (I just need to ...
user avatar
0 votes
3 answers
611 views

he conversion of a char data type to a datetime data type resulted in an out-of-range datetime value

I am executing below query but getting below error. INSERT INTO [dbo].[Calendar] ([ID],[Year],[Quarter],[Week],[Stdate],[EdDate]) VALUES (680, 2020, 1, 1, convert(datetime,'30-06-2019 00:00:00 AM'),...
Ankit Mistri's user avatar
2 votes
4 answers
2k views

Remove the zeros using SQL Server

Hello I am using SQL Server and I have this column : data 6/19/2019 3:10:12 PM 12/23/2016 5:02:15 AM I wanted to extract only the time so I used the following query : select try_parse([data] as ...
Peter Harris's user avatar
0 votes
2 answers
72 views

How to show Sub Total value like this?

I have a table like this:- Branch SL Month Amount1 Amount2 Amount3 A 1 January 100 0 0 A 2 February 0 0 0 A ...
BlackCat's user avatar
  • 1,974
1 vote
1 answer
227 views

Check connection details to SQL Server 2000/2005

I want to migrate some DBs hosted on SQL 2000/2005 to SQL 2014, I don't have direct access to DBs and I want to know all applications connecting to it and connection details. Is there any best way to ...
Rahul's user avatar
  • 1,421
0 votes
0 answers
52 views

SQL Server 2005 - Copy differences in tables only

I've had an issue with a SQL Server database after an update from some horrible software. The software "updated" (in actuality, rolled-back) a bunch of encrypted stored procedures and user-defined ...
Dan Austin's user avatar
0 votes
2 answers
170 views

C# Game Server with SQL Server database error

I have a game server. It's written in C# with SQL Server 2005. The server is doing fine for about an hour or so, but then something happens, a database error. I am not too much into C#, so I am not ...
Bernard Danken's user avatar
2 votes
1 answer
68 views

Inserting primay key values to another table through cursor

I have a cursor inside a procedure which fetch the primary key of the table passed in the procedure parameter. i need to insert the values of the primary key into a another table CREATE PROCEDURE ...
SAI's user avatar
  • 35
0 votes
1 answer
3k views

SQL - Select by status

I need to do the following selection. I have a list of 100.000 user with different status (1 - 4). I need to choose an amount of 10.000 user out of this, first all with status 4 (but if there are ...
Christian's user avatar
2 votes
0 answers
1k views

How can I insert a row at the bottom of a table while in a query?

How can I delete the top row of a table and then add that same row (with updated information) to the bottom of the table? In other words, How can I insert a row at the bottom of a table while in a ...
SQLUser's user avatar
  • 97

15 30 50 per page
1
2 3 4 5
37