logo
down
shadow

SQL-SERVER QUESTIONS

Dynamic SQL query Issue - SQL Server
Dynamic SQL query Issue - SQL Server
may help you . I'm writing a dynamic query for paging purpose. below is the last part of the executable query and when i print it and run in different window it works fine. but when i use exec it shows red squiggle for casting parts (CAST(@pint_Start
TAG : sql-server
Date : November 23 2020, 11:01 PM , By : pooja
How to send an email to multiple recipients ?
How to send an email to multiple recipients ?
I wish this help you You need to add ; (semicolon) between e-mail addresses using string concatenation:
TAG : sql-server
Date : November 23 2020, 11:01 PM , By : Maitri
Visual Studio 2015 cannot connect to SQL Server LocalDB
Visual Studio 2015 cannot connect to SQL Server LocalDB
it helps some times after i saw your project you just need change the app.config connectionStrings
TAG : sql-server
Date : November 22 2020, 11:00 PM , By : Nero.LB
SQL Server Management Studio, Beginner
SQL Server Management Studio, Beginner
I wish this helpful for you Are you looking for something like this?grator_principal_id will return all objects where these principal gave the grant and grantee_Prinicipal_id return all objects where Suzie and Jimmy were granted Details here
TAG : sql-server
Date : November 22 2020, 11:00 PM , By : Luke Brockton
Why do I get errors when I try to fire stored procedure?
Why do I get errors when I try to fire stored procedure?
may help you . Table valued types and parameters in TSQL are little different then you've conceived. Table valued parameters are basically tables, not arrays or lists. You cannot use comma seperated syntax to specify multiple values.
TAG : sql-server
Date : November 20 2020, 11:01 PM , By : Cen Dengji
How do I declare array of integers in a SQL Server stored procedure?
How do I declare array of integers in a SQL Server stored procedure?
around this issue SQL Server doesn't have any "array" type - if you need multiple values of something, there's really only one construct : a table. If you need to pass multiple values to a stored procedure, you should check out table-valued parameter
TAG : sql-server
Date : November 19 2020, 11:01 PM , By : Juliano Guimarães
Table structure in Asp.Net Identity
Table structure in Asp.Net Identity
wish of those help From the documentation IdentityUser.SecurityStamp Property
TAG : sql-server
Date : November 18 2020, 11:01 PM , By : Huyang Xu
Generating unique logon id failing when loop reaches 9 in sql 2012
Generating unique logon id failing when loop reaches 9 in sql 2012
it fixes the issue I am trying to generate unique logoid for each user in SQL 2012 but it fails when the loop reaches 9. The logonid takes the first letter of forename,surname and the trailer which is added one. It fails when end is 9 because all log
TAG : sql-server
Date : November 17 2020, 11:01 PM , By : Reham Khairy
How to open %AppData%\Nutshell.mdf in LINGPad
How to open %AppData%\Nutshell.mdf in LINGPad
may help you . I'm new to LINGPad 5. After installing it, I tried connecting to my SQL server. It was successful. Could anyone tell me how to open %AppData%\Nutshell.mdf in LINGPad? , After installing SQLExpress, the problem was solved.
TAG : sql-server
Date : November 15 2020, 11:01 PM , By : Isaiah T. Johnson
How to make SQL Server database backup and its contents?
How to make SQL Server database backup and its contents?
like below fixes the issue In SQL Server Management Studio, (version 2014 in my case) right click the database you want to back up, point the cursor to "Tasks", and when the menu expands, click "Back Up..."There are several options in here, but I wil
TAG : sql-server
Date : November 14 2020, 11:01 PM , By : kispal dezso
Execute dynamic sql "alter database" inside trigger
Execute dynamic sql "alter database" inside trigger
I hope this helps . Consider following quotes from documentation: ALTER DATABASE (Transact-SQL)
TAG : sql-server
Date : November 12 2020, 11:01 PM , By : aiwu sun
How to wrap or observe using SQL CLR types
How to wrap or observe using SQL CLR types
With these it helps No, SQLCLR does not provide any special means of doing this.The best, most appropriate, and only way to accomplish getting notifications of table modifications is through Triggers. That is what they are meant to do. You can captur
TAG : sql-server
Date : November 10 2020, 11:01 PM , By : Alex Macpherson
How to only keep the time portion of a datetime value (SQL Server)?
How to only keep the time portion of a datetime value (SQL Server)?
I hope this helps you . Here's what I use to get a HH:MM string:
TAG : sql-server
Date : November 10 2020, 11:01 PM , By : Micheal Mañago
Top five current month birthday candidates and greater than today's date using SQL
Top five current month birthday candidates and greater than today's date using SQL
I wish this helpful for you I need top five current month birthdays candidates and greater than today's date using SQL. , Here is one way to do it.
TAG : sql-server
Date : November 08 2020, 11:01 PM , By : A.Stepin
create and store large XML output in SQL
create and store large XML output in SQL
this will help I have a query that gives approximately four hundred thousand records [400000], up to 18mb. , After a while, I tried what @gofr1 referred in his comment.
TAG : sql-server
Date : November 08 2020, 11:01 PM , By : Alexander und Anasta
SSDT & TFS: compare SQL Server database not working
SSDT & TFS: compare SQL Server database not working
should help you out Finally I solved this problem by drop and recreate object in MSSQLServer:
TAG : sql-server
Date : November 07 2020, 11:01 PM , By : Stivën Korumi
Query for pattern separated by new lines
Query for pattern separated by new lines
I wish did fix the issue. You could try this. It relies on Sql Server adding the newline to the string when you break the line.
TAG : sql-server
Date : November 07 2020, 11:01 PM , By : HouHou
If condition isn't met, raise error, if not, run procedure
If condition isn't met, raise error, if not, run procedure
will help you I need to have an error display if the conditions aren't met. Both @variable1 and @variable2 can take only take few values. , Simpler and correct to use NOT IN:
TAG : sql-server
Date : November 04 2020, 04:05 PM , By : Avinash Yegi
In SQL, Trying to link 2 tables, adding missing lines for current month only
In SQL, Trying to link 2 tables, adding missing lines for current month only
will help you Yes, your WHERE clause is the cause of the problem. For warehouses that do not have a record at StorageUsageConesMonthly, sucm.COUNTYEAR and sucm.COUNTMONTH are also NULL. When you use them in WHERE clause they do not match with the cur
TAG : sql-server
Date : November 04 2020, 04:05 PM , By : Kareem Kumar
Database Normalization - Field depending on another non-key field
Database Normalization - Field depending on another non-key field
wish of those help From a pure normalization perspective, you don't want to have a field that is potentially taking up space with useless information, as you would in your example when the user doesn't eat fruit. Furthermore, you really don't want Fa
TAG : sql-server
Date : November 03 2020, 11:01 PM , By : Shweta Sharma
SQL Server: How to improve performance for queries with multiple CTEs and subqueries in the WHERE clause
SQL Server: How to improve performance for queries with multiple CTEs and subqueries in the WHERE clause
Any of those help I wanted to close on the loop on this question. What I needed to do here was create two non clustered indices. I used the following steps: Placed my query on the query window. Clicked on "Display Estimated Execution Plan" button on
TAG : sql-server
Date : November 02 2020, 11:01 PM , By : edi.pra.setyo
retrieve data from left table when condition is not met
retrieve data from left table when condition is not met
Any of those help You can use ISNULL
TAG : sql-server
Date : November 02 2020, 11:01 PM , By : hendi firmansyah
XPath fn:data in sql server causes Type conversion in expression may affect "CardinalityEstimate" in query pla
XPath fn:data in sql server causes Type conversion in expression may affect "CardinalityEstimate" in query pla
around this issue I do not think, that your approach is the best or fastest...Here are some approaches to compare them:
TAG : sql-server
Date : November 02 2020, 11:01 PM , By : jkinley
Connect Azure webapp to sqlserver in rackspace
Connect Azure webapp to sqlserver in rackspace
I wish did fix the issue. There isn't just one - check out this doc - basically Azure Web Apps run in a server farm that's managed by Microsoft. Unless you use an ASE (app service environment) you can't change this. There are a couple of ways you can
TAG : sql-server
Date : November 01 2020, 11:01 PM , By : Elvin
Where do I put the if statement?
Where do I put the if statement?
like below fixes the issue I wrote this to create a summary of invoices for the past 30 days. While checking the invoices I notice I pulled a lot of nulls because most of the customers are tax exempt. I would like to put a IF statement (IF t.TAXABL_2
TAG : sql-server
Date : November 01 2020, 01:04 PM , By : Raymondo93
SQL Customer orders list
SQL Customer orders list
I wish this helpful for you I am trying to get list of customers that have orders in January February,but not in March , Have a go with this:
TAG : sql-server
Date : November 01 2020, 12:01 AM , By : user6058200
Updating first available row with multiple conditions
Updating first available row with multiple conditions
like below fixes the issue I'm having trouble updating the first available row where a specific column is NULL and another column is 2. , add
TAG : sql-server
Date : November 01 2020, 12:01 AM , By : NMKS
What ssis design pattern is good for flat file to table load
What ssis design pattern is good for flat file to table load
will be helpful for those in need This might give you a starting point if you want to see what each file has for data, without opening every one of them. The DefaultDir will reside on your SQL Server that you are running from.
TAG : sql-server
Date : October 31 2020, 05:38 PM , By : Pratima Chetty
Update column in table based on another table field
Update column in table based on another table field
like below fixes the issue I have a prescription table that I want to set non active based upon a condition in the patient table. Will this work? , Use simple subquery:
TAG : sql-server
Date : October 31 2020, 05:38 PM , By : Malik Asif
Performing CRUD operation on each distinct value of a column
Performing CRUD operation on each distinct value of a column
fixed the issue. Will look into that further what i am trying to achieve is to select distinct values of a column which can be done by , Try this query with GROUP BY clause:
TAG : sql-server
Date : October 31 2020, 09:54 AM , By : eclick software
Archival stored procedures
Archival stored procedures
Hope this helps Here's a sample that contains most of what you'll need to do what you are after. Hopefully the comments are self explanatory as to what each step is doing. The below code is re-runnable, so you can view the output it generates and twe
TAG : sql-server
Date : October 31 2020, 05:55 AM , By : Mouhcine
How to create a trigger for insert and update data
How to create a trigger for insert and update data
it fixes the issue How to create a trigger for insert and update that will automatically transfer data from one (source)table to another (destionation)table (tables in different databases)? Trigger needs to transfer data after each change in the sour
TAG : sql-server
Date : October 31 2020, 05:55 AM , By : Rajesh Chouhan
Import large database from bacpac with SQL Server Management Studio
Import large database from bacpac with SQL Server Management Studio
I hope this helps you . I'm trying to import a large database to a Microsoft SQL Server 2016 (v13.0.2164.0) from a bacpac export with Microsoft SQL Server 2016 Management Studio. , Try this cmd:
TAG : sql-server
Date : October 30 2020, 12:01 AM , By : TABISH ALAM
Error in specify relationship in data source view of ssas
Error in specify relationship in data source view of ssas
may help you . The source column and the destination column have different data types
TAG : sql-server
Date : October 30 2020, 12:01 AM , By : Ibrahim Mudathir
I am having trouble using contains in sql server 2008 and doesn't show any output if my text has "for" or &quo
I am having trouble using contains in sql server 2008 and doesn't show any output if my text has "for" or &quo
To fix the issue you can do "for" is a stopword in English, so it won't be indexed into full-text index. If you want to search records contains specific string, use LIKE operator
TAG : sql-server
Date : October 29 2020, 12:01 AM , By : kgb
OSQL command to stop the services
OSQL command to stop the services
will help you I am trying to stop the services using net stop and it is through database. Connecting the database through OSQL and execute net stop command to stop the services. , Below Query will work
TAG : sql-server
Date : October 25 2020, 02:08 AM , By : Kim Yeulin
CLR Function publish.sql file
CLR Function publish.sql file
I wish this help you If you have already set up the perquisite stuff, then I am curious as to why you didn't just attempt to execute that file to see for yourself as that would have answered this question, right? ;-) But yes, those three steps are al
TAG : sql-server
Date : October 25 2020, 02:08 AM , By : Sarah M
Performance impact of Lookup in SSRS Report Builder
Performance impact of Lookup in SSRS Report Builder
hope this fix your issue There are a lot of things that could be causing the performance issues but here's a few simple things that might get the dataset back up to speed again with very little effort.1. Parameter sniffing
TAG : sql-server
Date : October 24 2020, 01:08 AM , By : Federico Sarmiento
Add character to the left of the String
Add character to the left of the String
may help you . Use string concatenation. You can also use the CONCAT() function in SQL Server 2012 onward
TAG : sql-server
Date : October 24 2020, 01:08 AM , By : Rajanish Singh
Log column constraint violations
Log column constraint violations
hop of those help? Your best bet is to put a BEFORE INSERT, UPDATE trigger on the table.In the trigger, check the inserted table to see if any rows would violate the constraint, and if so, write them to your Log table instead of the destination table
TAG : sql-server
Date : October 22 2020, 01:08 AM , By : Michal Růžička
Concatenate many rows into one
Concatenate many rows into one
To fix the issue you can do I have a relational table: , I usually made it like this:
TAG : sql-server
Date : October 22 2020, 01:08 AM , By : Nikhil Kapoor
Create #temp using SELECT INTO with desired data type
Create #temp using SELECT INTO with desired data type
should help you out For this simple statement: , Just CAST it.
TAG : sql-server
Date : October 22 2020, 01:08 AM , By : Amit Singh
SQL server concat SP output with multiple columns into one string in select query
SQL server concat SP output with multiple columns into one string in select query
To fix the issue you can do To call a stored procedure for each row, you will need to loop either with a WHILE loop or a CURSOR. Whether you wrap this in a TVF or not is up to you.To concatenate the fields returned by the SP, you should use variables
TAG : sql-server
Date : October 21 2020, 01:08 AM , By : vijay ragavan
Updating a date record and getting: Operand type clash: date is incompatible with int
Updating a date record and getting: Operand type clash: date is incompatible with int
I wish did fix the issue. I'm just trying to update a date and time record in my database. but it keeps giving me an error:
TAG : sql-server
Date : October 21 2020, 01:08 AM , By : Sophumer
Executing thousands of SQLServer queries at one time
Executing thousands of SQLServer queries at one time
I wish this helpful for you You can use this. You can delete 100000 rows every turn. This works faster than delete all rows in the same time.
TAG : sql-server
Date : October 20 2020, 01:08 AM , By : Vishal
Import data from Excel using SSIS without knowing the file name
Import data from Excel using SSIS without knowing the file name
may help you . I'm working on an SSIS package that will be used to import data from an Excel file into SQL Server. My current struggle is figuring out how to make the SSIS package bring in exactly one excel file without knowing the name of it beforeh
TAG : sql-server
Date : October 18 2020, 03:08 PM , By : Quintin Van Rooyen
SQL Best Practices for Identity value hard coding
SQL Best Practices for Identity value hard coding
To fix this issue Seems to me the strongest argument to your report writers is your second to last sentence "...those values can and are absolutely different [between environments]". That would be pretty much the gist of my response to them.Of course
TAG : sql-server
Date : October 18 2020, 03:08 PM , By : Maldo
How make sqlcmd hold file access rights on linux?
How make sqlcmd hold file access rights on linux?
hop of those help? I think your problem is the '~/test_data.txt' part of your bulk insert command. Specifically, that says "find a file called test_data.txt in the home directory". But whose home directory? Not yours! It's looking for the file in the
TAG : sql-server
Date : October 17 2020, 01:08 AM , By : Vid
How to insert new record in AdventureWorks2016 which uses BusinessIdentityId
How to insert new record in AdventureWorks2016 which uses BusinessIdentityId
I wish this help you In AdventureWorks2016 database there is a table with name Person.BusinessEntity, this table contains an identity column.Reviewing Sales.Store table, there is a foreign key for Person.BusinessEntity table.
TAG : sql-server
Date : October 16 2020, 03:08 PM , By : Maria Marsala
Conditional logic in T-SQL select statement
Conditional logic in T-SQL select statement
With these it helps Your query gives an impression that if cba.CustomerID is NULL for a row, every other field will be null for the row, and should be ignored. You can use COALESCE expression in this case.
TAG : sql-server
Date : October 15 2020, 01:08 AM , By : aj koot
Why does query return a line when using a date filter when it shouldn't?
Why does query return a line when using a date filter when it shouldn't?
hope this fix your issue I've got a query that's trying to filter information based on a date, but it's not quite working. , try this
TAG : sql-server
Date : October 14 2020, 09:34 AM , By : Xiaohui
Altering MSSQL table protected by RLS (SSDT)
Altering MSSQL table protected by RLS (SSDT)
Hope that helps There are 2 aspects to this scenario: Why is the addition of a column causing a data motion operation to occur? What is the danger introduced by Row Level Security?
TAG : sql-server
Date : October 14 2020, 09:34 AM , By : Backtalkers
Execute SQL stored procedure from QueriesTableAdapter in DataSet at view design
Execute SQL stored procedure from QueriesTableAdapter in DataSet at view design
this will help if you added a stored proc to the tableadapter through the designer, the dataset generates a method for the tableadapter when saved, including any parameters required for the stored procedure. e.g.
TAG : sql-server
Date : October 14 2020, 09:30 AM , By : Grant A. Coleman
DB changes doesn't reflect on Diagram
DB changes doesn't reflect on Diagram
like below fixes the issue Try this: Right click on diagram and choose remove table from diagram. Right click in the white space and choose Add Table.
TAG : sql-server
Date : October 14 2020, 09:27 AM , By : Ryuzaki
shadow
Privacy Policy - Terms - Contact Us © soohba.com