Tag: sql-server

“Call to undefined function sqlsrv_connect()” in Wamp, drivers installed

This question already has an answer here: Call to undefined function sqlsrv_connect() with WAMP 3 answers

how to use other, previous, values to create a new value

This is my first post having found so much of what I have needed previously by searching this site. I can’t find an answer to this one, so here we go…I have a table containing the number of customers for around 40 organisations listed by month, sample as follows: Month OrgID Cust 201509 G85001 12731 […]

SQL with input condition

I have a customer table-firstname,lastname,gender,salary. I am creating a stored procedure with 5 input parameters: @FN, @LN, @GNDR, @SLRY and @TYPE. Now, if @type=0 and @FN=’SAM’ – then, it should insert a new record in the table, if ‘SAM’ is already existing in the table. if @type=1 and @FN=’SAM’ – then, it should delete a […]

Can the result of this 'from' be reused?

I saw this the following sql in my friend’s .sql scripts: from ( ….. ) a select col1,col2 from a select col3 from a where … My friend said the sql in the ‘from’ will be excuted only once and its result will be reused when ‘a’ is called. I just want to confirm is […]

how to get filename without extension using xp_dirtree

I have used xp_dirtree to get list of filenames from remote server path folder. the files are with extensions .bak I do not want the get the filename with extension .bak for eg: filename Sales_backup_2016_10_09_213002_7679353.bak needs to get Sales_backup_2016_10_09_213002_7679353. I did search many blags for this but no luck. please can anyone suggest me how […]

SQL Server and Hibernate – datetime2 vs varbinary

Hibernate saves the older Java Date objects as a datetime2(7) in SQL Server, and Hibernate saves the newer Java LocalDateTime objects as varbinary(255) in SQL Server. Are there any issues with performance, for instance searching greater than/equal to or less than/equal to datetimes using varbinary(255) vs datetime2(7)? I’m using Hibernate 5 through GORM in Grails […]

Use SQL Server to publish to rabbitmq via amqp

I am looking for specific help setting up message types/contracts/queues and EA to post notifications of SQL table update/inserts to an existing RabbitMQ system. The destination quese already exist. SQL-to-SQL documentation exists, but not going SQL-to-RabbitMQ.

TextWrangler SQL Formatter PHP Script

I am trying to format sql using Text Wrangler. I have saved a php file in the location ~/Library/Application Support/TextWrangler/Text Filters. However my formatter is working, but its converting the table names to uppercase. I don’t want to change the case of tables. Following is my php script: #!/usr/bin/php <?php /** * BBEdit SQL format […]

sp_executesql Parameters Values

I have a table that can be modified my the user, meaning the user can add columns, since i cant know how many columns does de table will have, I dont know how can i supply the sp_executesql values. My code so far: SET @sSQL = ( N’INSERT INTO dbo.MyTable VALUES(‘+@numParametros+’)’ ) –For Explaining purposes […]

Export the result of stored procedure into text file as my computer work as both client/server

I have a procedure which takes as argument the function name and then finds out the full body of that function and stores it in a local variable V_FullString. I need this output not to show in screen rather to put it in text file. Is it possible ? ALTER PROCEDURE [dbo].[SP_DictionaryFunction] @P_FunctionName VARCHAR(100) AS […]

MS SQL Server is a Microsoft SQL Database product, include sql server standard, sql server management studio, sql server express and so on.