logo
down
shadow

SQL-SERVER QUESTIONS

ALTER TABLE my_table ADD @column INT
ALTER TABLE my_table ADD @column INT
wish of those help This is possible using dynamic sql to build your DDL and using the EXEC command to execute the string.
TAG : sql-server
Date : November 27 2020, 07:01 PM , By : user3863902
sql server deadlock issue on a single table
sql server deadlock issue on a single table
To fix this issue Even if I had access to your system and all of your code, this is a very difficult issue to resolve. That said, you don't provide many details in your question.So apply the general rules of Reducing SQL Server Deadlocks:
TAG : sql-server
Date : November 26 2020, 07:01 PM , By : user3863327
Any tool to convert SQLite database to sql server?
Any tool to convert SQLite database to sql server?
wish of those help You could try the SQLite Manager for Firefox add-onIt's got the ability to export your SQLite db to a .sql file which you could then run in SQL Server. Might not be perfect, but it is free.
TAG : sql-server
Date : November 24 2020, 07:00 PM , By : user3862894
SQL Server Windows Authentication
SQL Server Windows Authentication
may help you . For Windows Authentication to work, the target machine has to be on a domain where your Windows credentials will be recognized. If the server is outside of your organization's control, it will not recognize your credentials and you wil
TAG : sql-server
Date : November 24 2020, 07:00 PM , By : user3857651
Msg 209, Level 16, State 1, Line 4 Ambiguous column name 'DonorID'. Msg 209, Level 16, State 1, Line 1 Ambiguous column
Msg 209, Level 16, State 1, Line 4 Ambiguous column name 'DonorID'. Msg 209, Level 16, State 1, Line 1 Ambiguous column
Hope that helps You are mixing implicit and explicit join syntax, and you should be using the latter:
TAG : sql-server
Date : November 22 2020, 07:01 PM , By : Anthony Somoano
Union and If Exists - not working together - Please help
Union and If Exists - not working together - Please help
may help you . You could add another union that returns the dummy row if test3 is empty:
TAG : sql-server
Date : November 22 2020, 07:01 PM , By : Kamil Najman
CASE WHEN Formula in SQL
CASE WHEN Formula in SQL
hope this fix your issue What is the datatype of your QtyOrdered column? If it's INT - then you're performing an integer division (QtyOrdered / 4) and if the QtyOrdered value is 1, 2, or 3, this would result in 0. If you want your results to be with
TAG : sql-server
Date : November 21 2020, 07:01 PM , By : pammirato
SQL Server Index cost
SQL Server Index cost
I hope this helps you . Nonclustered indexes also store the clustered keys.It does not have to do a full scan, since:
TAG : sql-server
Date : November 21 2020, 07:01 PM , By : user3861963
T-SQL Issue using lead or lag
T-SQL Issue using lead or lag
wish helps you I think you want to use f.TIMESTAMP as your ORDER BY for the LEAD(). I think your query should look something more like this:
TAG : sql-server
Date : November 20 2020, 07:00 PM , By : animate8
How can I connect to SQL Server using (local)\INSTANCE_NAME?
How can I connect to SQL Server using (local)\INSTANCE_NAME?
Does that help You can use .\HIS_SERVER_INSTANCE to get the same effect as using (local).
TAG : sql-server
Date : November 20 2020, 07:00 PM , By : user3861478
How do I filter SQL Server traffic between app and DB servers using Wireshark?
How do I filter SQL Server traffic between app and DB servers using Wireshark?
this will help Wireshark has display filters and capture filters. The capture filter captures only certain packets, resulting in a small capture file. Capture filters are set in Capture Options (ctrl-K). An example to capture SQL Server traffic would
TAG : sql-server
Date : November 19 2020, 07:01 PM , By : user3861226
How to protect my SQL Server database from unauthorized access, modification and distribution?
How to protect my SQL Server database from unauthorized access, modification and distribution?
I think the issue was by ths following , There is a lot of ways to do this, really depends on the type of protection you want, here is some of my ideas.Protecting unauthorized access, you can:
TAG : sql-server
Date : November 18 2020, 07:00 PM , By : alocin
SQL Server 2008 Dead lock issue
SQL Server 2008 Dead lock issue
should help you out The update transaction/lock will include things like: triggers foreign key validations (is col1 an fk?) check constraints (on col1 using udf) indexed views (that uses table.col1 or table.col2)
TAG : sql-server
Date : November 18 2020, 07:00 PM , By : user3860890
writing an Dynamic query in sqlserver
writing an Dynamic query in sqlserver
I wish this help you DECLARE @sqlCommand varchar(1000) DECLARE @columnList varchar(75) DECLARE @city varchar(75) DECLARE @region varchar(75) SET @columnList = 'first_name, last_name, city' SET @city = '''London''' SET @region = '''South''' SET @sqlCo
TAG : sql-server
Date : November 16 2020, 07:01 PM , By : SonOfSun
How to lock a table for inserting in sql?
How to lock a table for inserting in sql?
will help you Don't. Don't even think about it. You'll kill off any performance and concurrency you have.You need to find out why you're having duplicate PK values. If you leave that up to the database itself to handle, by using a INT IDENTITY column
TAG : sql-server
Date : November 16 2020, 07:01 PM , By : user3859109
Disable TSQL script check?
Disable TSQL script check?
will be helpful for those in need lets say I have a script like that: , Use dynamic SQL
TAG : sql-server
Date : November 15 2020, 07:01 PM , By : VEENA G
is there a way to update multiple row using one update query?
is there a way to update multiple row using one update query?
To fix this issue I want to update my table_1 data to data exist in table_2 with condition that table_2.date_modification is equal to today date , I would use this update join:
TAG : sql-server
Date : November 14 2020, 07:01 PM , By : Arun Kumar
Building Stored Procedure to group data into ranges with roughly equal results in each bucket
Building Stored Procedure to group data into ranges with roughly equal results in each bucket
wish helps you You can use the ranking function ntile to split a result set in equal parts. This example creates a table with values 1...100, and splits them in 5 ranges:
TAG : sql-server
Date : November 14 2020, 07:01 PM , By : user3859723
Update table with index is too slow
Update table with index is too slow
To fix the issue you can do Can someone explain why index2 is much heavier to update then index1?
TAG : sql-server
Date : November 13 2020, 07:01 PM , By : Abdullah Saeed
Atomic UPSERT in SQL Server 2005
Atomic UPSERT in SQL Server 2005
To fix this issue What is the correct pattern for doing an atomic "UPSERT" (UPDATE where exists, INSERT otherwise) in SQL Server 2005?
TAG : sql-server
Date : November 12 2020, 07:00 PM , By : DianaPineda
How to run a ssis package using a sql statement?
How to run a ssis package using a sql statement?
may help you . Im my experience one of the easiest way to control them from within SQL is not to try an xp_cmdshell etc but to add a job that executes the SSIS package as the first step and then from within the SQL msdb.dbo.sp_start_job 'yourjobname'
TAG : sql-server
Date : November 12 2020, 07:00 PM , By : user3858945
SQL Server substring(substring())
SQL Server substring(substring())
will be helpful for those in need You can't alias the inner substring. It's unclear what you would try to achieve by doing this, so I can't really suggest the correct way to do whatever it is.Take out as [sting] and at least you should have valid syn
TAG : sql-server
Date : November 11 2020, 07:00 PM , By : Seut Rasmussen
Database schema last updated date
Database schema last updated date
it helps some times Under SQL 2005/2008, you can use the modify_date in sys.objects to determine if the schema has been changed on a table. You can also use create_date/modify_date on other objects to determine if objects of concern have been created
TAG : sql-server
Date : November 10 2020, 07:00 PM , By : user3858516
Fully automated SQL Server Restore
Fully automated SQL Server Restore
will be helpful for those in need Here's the fully automated restore T-SQL stored proc. Accepts three(3) parameters. Target Database Source Database Fully Qualified backup file name location
TAG : sql-server
Date : November 10 2020, 07:00 PM , By : RazaAli10
How to get identities of inserted data records using SQL bulk copy
How to get identities of inserted data records using SQL bulk copy
it should still fix some issue I have an ADO.NET DataTable with about 100,000 records. In this table there is a column xyID which has no values in it, because the column is an auto-generated IDENTITY in my SQL Server database. , I'm currently doing s
TAG : sql-server
Date : November 10 2020, 07:00 PM , By : user3858346
How to determine whether a database has been changed or not?
How to determine whether a database has been changed or not?
it helps some times A possible solution for the scenario you described is to read the database transaction log (an LDF file). Any changes, both on schema or data level that were committed against the database are recorded in the database transaction
TAG : sql-server
Date : November 10 2020, 07:00 PM , By : user3858307
What does # after a column name mean in SQL Server
What does # after a column name mean in SQL Server
it helps some times It means nothing in SQL Server, it's simply part of the columns name. In some dialects a hash/pound () character means number, so perhaps it is an abbreviation for the name "Street number"? Otherwise no, it's just a suffix with no
TAG : sql-server
Date : November 09 2020, 07:01 PM , By : Chris Charehwa
Transaction Isolation Level of Serializable not working for me
Transaction Isolation Level of Serializable not working for me
I hope this helps . You have READUNCOMMITTED in the UDF. This will cause it to ignore any exclusive locks held by other transactions.SET TRANSACTION ISOLATION LEVEL SERIALIZABLE is not the same as an applock, it is not a "critical section" in the dat
TAG : sql-server
Date : November 09 2020, 07:01 PM , By : Naveed Ashraf
SQL Server Management Studio Express 2005 has no Configuration Manager
SQL Server Management Studio Express 2005 has no Configuration Manager
To fix the issue you can do This might be what you are looking for. I have used it with SQL Server Express 2005 although I am not sure if it configures the specific things you want to change and I just now verified that it does provide access to the
TAG : sql-server
Date : November 09 2020, 07:01 PM , By : user3858123
Can't connect to SQL Server 2008 - looks like Shared Memory problem
Can't connect to SQL Server 2008 - looks like Shared Memory problem
Does that help Had the same problem. Here is what solved it for me: Open SQL Management Studio Connected through the admin account I used to setup the instance Selected the server from Object Explorer Right mouse click properties Server properties op
TAG : sql-server
Date : November 09 2020, 07:01 PM , By : user3857974
SQL deadlock on delete then bulk insert
SQL deadlock on delete then bulk insert
hop of those help? Following on from Sam Saffron's answer: Consider READPAST hint to skip over any held locks if @ID7@SubID is distinc Consider SERIALIZABLE and remove XLOCK, HOLDLOCK Use a separate staging table for the bulk insert, then copy from t
TAG : sql-server
Date : November 08 2020, 07:01 PM , By : Stephen Newell
Join two tables in SQL Server
Join two tables in SQL Server
around this issue If you're looking for a distinct list of CustomerId from both tables, it'll be easiest to use UNION:
TAG : sql-server
Date : November 07 2020, 07:01 PM , By : 琥珀菜菜
Rebuilding indexes does not change the fragmentation % for nonclustered indexes
Rebuilding indexes does not change the fragmentation % for nonclustered indexes
To fix the issue you can do SQL Server will not rebuild indexes that are not large enough. Have a look a the fragment_count (that's one of the fields in the sys.dm_db_index_physical_stats view), it's probably quite low for those 27 indexes.
TAG : sql-server
Date : November 07 2020, 07:01 PM , By : Amal M
Identifying connections and active SQL in SQL Server
Identifying connections and active SQL in SQL Server
around this issue Profiler will log, and allow you to view, all activity on the server, if that's what you're looking for. http://msdn.microsoft.com/en-us/library/ms187929.aspx
TAG : sql-server
Date : November 07 2020, 07:01 PM , By : user3857274
How to pass a variable number of parameters to a SQL Server stored procedure?
How to pass a variable number of parameters to a SQL Server stored procedure?
hope this fix your issue You declare the procedure with default parameters and you invoke it with named parameters instead of positional parameters:
TAG : sql-server
Date : November 06 2020, 07:00 PM , By : user3857144
How do I remove database name from SQL Server generated script?
How do I remove database name from SQL Server generated script?
I wish this helpful for you Assuming that you are using Microsoft SQL Server Management Studio 2005 or higher you can goto the Tools -> Options menu. On the dialog select "Scripting" from the left hand side. On the right-side in the "General Scriptin
TAG : sql-server
Date : November 05 2020, 07:01 PM , By : a zombie
Which method is best method for speed? in SQL Server, stored procedure
Which method is best method for speed? in SQL Server, stored procedure
it should still fix some issue For ease of maintenance, I would go for separate procedures.Speed is not going to be an issue if the same code is in one proc or multiple procs - as long as the code is the same, it will behave in the same way in one pr
TAG : sql-server
Date : November 05 2020, 07:01 PM , By : user3856766
TSQL 'Invalid column name' error on value of sproc parameter
TSQL 'Invalid column name' error on value of sproc parameter
wish helps you That's a nice SQL injection vulnerability there.Start by rewriting it this way, using bind parameters:
TAG : sql-server
Date : November 04 2020, 07:01 PM , By : Judy Stewart
t-SQL grant permission for table drop and create
t-SQL grant permission for table drop and create
it should still fix some issue You cannot assign DROP or CREATE permissions on a single table, as those are schema and database level permissions:
TAG : sql-server
Date : November 03 2020, 07:01 PM , By : user3856010
Stored procedure from VBA Excel not running
Stored procedure from VBA Excel not running
I wish did fix the issue. Use proper parameterization, and treat dates as Date, not as strings.Instead of running that straight off ADODB.Recordset, use an ADODB.Command; set the command text to just the name of the stored procedure, and add an ADODB
TAG : sql-server
Date : November 02 2020, 07:01 PM , By : Tibo
Stored procedure with dynamic SQL and ORDER BY
Stored procedure with dynamic SQL and ORDER BY
it fixes the issue Like I said in the comments, injection is a huge problem here, and you need to consider it. Saying "Let's consider I don't mind about injection" is naïve and you need to change that attitude. Always make your SQL safe; then there a
TAG : sql-server
Date : November 02 2020, 07:01 PM , By : sindhu
Using SQL Server for WSS 3.0 instead of Windows Internal database
Using SQL Server for WSS 3.0 instead of Windows Internal database
hop of those help? Yes, when you create the site check the installation to be a "Web Front End" It will then prompt you to select a location for the SQL database. Just point it to which server you want. I would definitely recommend putting it on a no
TAG : sql-server
Date : November 01 2020, 07:01 PM , By : John
Why better isolation level means better performance in SQL Server
Why better isolation level means better performance in SQL Server
I wish did fix the issue. First of all, you need to run the query repeatedly under each isolation level and average the result, discarding the one with the maximum time. This will eliminate the buffer warm up impact: you want all runs to be on a warm
TAG : sql-server
Date : November 01 2020, 07:01 PM , By : Sabarimani Developer
How to we prevent SQL Injection by Regular Expression or any other way in asp.net
How to we prevent SQL Injection by Regular Expression or any other way in asp.net
should help you out I truly hope that the procedure you've posted is not one you are using in a production environment, because it is not safe at all. The fact that you are using parameters does not mean you are safe from SQL Injection - it's how you
TAG : sql-server
Date : October 31 2020, 08:00 PM , By : L Torres
Removing characters from a alphanumeric field SQL
Removing characters from a alphanumeric field SQL
I wish did fix the issue. I encourage you to read this:Extracting Data
TAG : sql-server
Date : October 31 2020, 08:00 PM , By : Redarmy Man
Using SSIS and T-SQL to convert date to dd.mm.yyyy
Using SSIS and T-SQL to convert date to dd.mm.yyyy
I think the issue was by ths following , It works for me.Using your query as a framework for driving the package
TAG : sql-server
Date : October 30 2020, 08:01 PM , By : gokul deshmukh
Is a SqlProfiler Scan Started bad?
Is a SqlProfiler Scan Started bad?
Does that help From the documentation:
TAG : sql-server
Date : October 30 2020, 08:01 PM , By : user3854803
Copy huge tables data from one database to another in SQL Server
Copy huge tables data from one database to another in SQL Server
Hope that helps The issue is how to handle your transaction logs. It has to write to both, but you should handle it in chunks.So... Try something like this:
TAG : sql-server
Date : October 29 2020, 08:01 PM , By : user3854406
Sample Employee SQL Server database with data
Sample Employee SQL Server database with data
To fix this issue The only tool I can think of is Red Gate Data Generator.Otherwise, you'd be looking at someone's actual data or expecting someone to provide such a tool free of charge.
TAG : sql-server
Date : October 29 2020, 08:01 PM , By : user3854369
Programmatically creating linked tables in access
Programmatically creating linked tables in access
wish of those help We need to find a way to programatically ****link all the tables in a SQL Server database to an access db. We will be invoking this access database from a program that uses .net/SQL Server 2008. , Here are some notes.
TAG : sql-server
Date : October 28 2020, 08:00 PM , By : naturegeek
Is there meta data I can read from SQL Server to know the last changed row/table?
Is there meta data I can read from SQL Server to know the last changed row/table?
I wish did fix the issue. In terms of finding out when a table last had a modification, there is a sneaky way that can work to access this information, but it will not tell you which row was altered, just when. SQL Server maintains index usage statis
TAG : sql-server
Date : October 28 2020, 04:55 PM , By : crabsmack
Combine two Column into One column with out union
Combine two Column into One column with out union
wish of those help Join the two strings together. You can use CONCAT() to achieve this. In this example, we add a whitespace between the two, this can be changed to your needs.
TAG : sql-server
Date : October 24 2020, 06:10 AM , By : albaaromero
Switch CASE in stored procedure in SQL
Switch CASE in stored procedure in SQL
Hope this helps You cannot execute queries in a CASE expression. A case expression is... well... just an expression that should produce a value.If you want to execute statements based on a variable/parameter value, use IF blocks
TAG : sql-server
Date : October 23 2020, 06:10 AM , By : Terrance Washington
VS 2019 SSIS package can't add SQL Server
VS 2019 SSIS package can't add SQL Server
Does that help Answer: You need the new Microsoft® OLE DB Driver 18 for SQL ServerContext:
TAG : sql-server
Date : October 23 2020, 06:10 AM , By : Priyanka
Partition or Index large table in SQL Server
Partition or Index large table in SQL Server
This might help you I have a large table consisting of 4 Billion+ rows and 50 columns, most of which are either datetime or numeric except a few which are varchar. , I understand that I need to partition or index the table
TAG : sql-server
Date : October 22 2020, 06:10 PM , By : cmore
How to remove only certain items within a column that has multiple words listed in cell
How to remove only certain items within a column that has multiple words listed in cell
Hope this helps Use the SELECT ... part of the query to manipulate values ("projection"). The WHERE part to filter rows, not values. (the logical evaluation order of a SELECT query is actually FROM, WHERE, GROUP BY, HAVING, SELECT, ORDER BY, so the S
TAG : sql-server
Date : October 19 2020, 06:10 PM , By : Manoj Pooleery
How to convert from DD/mm/yyyy in varchar(max) to yyyymmdd format in SQL Server
How to convert from DD/mm/yyyy in varchar(max) to yyyymmdd format in SQL Server
it helps some times Ideally, don't store dates as a varchar, store them as a date and worry about the format they are displayed in in your presentation layer. Therefore, you should just do:
TAG : sql-server
Date : October 19 2020, 06:10 AM , By : Blake Sanders
Need to calculate the sum of second using a function from a string variable using SQL
Need to calculate the sum of second using a function from a string variable using SQL
I wish did fix the issue. There is a column named as duration in a table called Adventurous.The column has values as below.In the column Suffix of 'H' is hours,Suffix of 'M' is minutes and Suffix of 'S' is seconds.How can we select the hours, minutes
TAG : sql-server
Date : October 18 2020, 06:10 PM , By : Zoey
Error copying SQL Server database from one server to another
Error copying SQL Server database from one server to another
To fix this issue Easiest way will be Backup the DB (with compression) Copy the .bak file to Destination server Restore it.
TAG : sql-server
Date : October 17 2020, 06:10 PM , By : Yahve
SQL Server: link DB2 table
SQL Server: link DB2 table
will be helpful for those in need I would like to query a DB2 table in SQL Server. Is it possible to link a DB2 table in SQL Server?
TAG : sql-server
Date : October 17 2020, 06:10 AM , By : Anand Kamthe

shadow
Privacy Policy - Terms - Contact Us © 35dp-dentalpractice.co.uk