Questions tagged as 'sql-server'

3
answers

Save query in temporary table with stored procedures SQL SERVER

I have a stored procedure: CREATE PROCEDURE prueba @pal varchar(45) as CREATE TABLE #param(folio int,tit varchar(max),descr varchar(max)) SET NOCOUNT ON INSERT INTO #param SELECT * from post where titulo=@pal SELECT * FROM #param; go and s...
asked by 16.06.2017 / 19:29
1
answer

System.InvalidCastException: 'Operator' & 'is not defined for string "values (' 41611027," and type 'DataRowView'. '

conexion.Open() Dim cmd As New SqlCommand() cmd.Connection = conexion Dim Agregar As String Dim fec As Date = Fecha.Value.ToString("yyyy-MM-dd") Dim fac As Date = FechaC.Value.ToString("yyyy-MM-dd")...
asked by 15.06.2017 / 05:03
1
answer

Get date field by subquery

Dear, I am working in the construction of a stored procedure, I need to obtain a date field from a Table B depending on a particular state, by means of a subquery in a table A, I explain: Table A contains a product and table B stores the histor...
asked by 21.06.2017 / 18:17
2
answers

CASE WHEN FOR A SELECT

I have this table that is called SI_Consecutivo What I am trying to do is that if SI_Estado = 0 and SI_Num_Conteo = 2 Ask me this question SELECT SI_Articulo = COALESCE(t.SI_Articulo, c.SI_Num_Articulo), SI_Ubic...
asked by 28.07.2017 / 19:03
1
answer

Get rows that have a date greater or less than a certain date

I have an application in which I want to select from 2 timePickers the minor and major date, and then make a select * from using the dates as conditions. I have this: var select = "SELECT * from inventario where ifechaCompra > "+diarioFe...
asked by 28.07.2017 / 22:01
2
answers

How to consult data in MySQL and be able to save in SQL Server? (Python)

Good morning I have a doubt, I have a code generated in Python which what it does is to consult a MySQL table named INFORMATION_SCHEMA.PROCESSLIST in the following way: SELECT *, IF(time >= 10,"Bad","Good") AS Estado FROM INFORMATION...
asked by 08.06.2017 / 17:11
1
answer

Capitalize every word of a sentence? SQL Server 2008

Dear, I require the help of your wise minds. From a table name "Details" contains the column "Descripted", which may contain alphanumeric data and may have X number of words, example. [Descrip] 01. reMunerAcion feBrero 2017 02. enERO eMP 14...
asked by 09.06.2017 / 20:22
1
answer

Execute a User Defined Function (String_SPLIT) from a Stored Procedure. SQL SERVER

I have a table 'interviews' in SQL that stores, among others, NVARCHAR data in the column 'account_id', and data type NTEXT in the column 'answer' which is fed from a series of concatenated questions and answers divided by the symbol '|'. I...
asked by 22.05.2017 / 22:25
1
answer

SQL AUTO-INCREMENT in SSMS

I have exported a PhpMyAdmin database. When I open the document that I generated when exporting with Microsoft SQL Server Management Studio , it shows me the queries of all the tables and data in the database (so far). Since some of the instr...
asked by 18.05.2017 / 17:56
3
answers

I can not receive the value of a SELECT query

I need to extract a single value from the database to assign it to a variable int and then use it, but I can not get it. Try the syntax of the query and return the value I need, the problem is that I can not assign it, I return the fol...
asked by 15.05.2017 / 07:23