I am trying to convert this query to using dynamic columns (from another table). In this example I want to replace the 2 areas where I have type='comm ...
I am trying to convert this query to using dynamic columns (from another table). In this example I want to replace the 2 areas where I have type='comm ...
I have a temp table #temproles with data like this: ID Dept RoleCode RoleName NameOf 123 ...
I need to monitor the ongoing flow of data using the latest created date for a set of tables. Basically, I need to batch run on a set of tables I r ...
I have the following code: I need to save the output as a table, I tried to add the following code, since the columns need to be dynamic to schedul ...
I have a simple Postgres function where I want to take table_name as a parameter and pass it into an argument and delete the data from table by condit ...
I need to create an update function for 'visitors' table with 3 arguments (id, column, value). Here is my code: But I get an error: column 'email' ...
I have a table1 line a b c d e f g h 1 18 2 2 22 ...
I often have to find out what is the latest date of a record count of multiple tables. Currently I'm trying to find out the maximum loaddate from a li ...
I have two tables. One is the raw table and another one is the table that I need to reference from. I am not sure how to join this two tables because ...
One of the SQL Queries use the same table name again and again - Example - You can see the same MYTABLE is used 3 times. The thing is, I have to ru ...
Suppose I have a hierarchical structure like this. Father ID Child ID 1 2 1 3 ...
I have this stored procedure that get a page of results based on the CreatedDate, this works really well, it seeks using the index on the CreatedDate ...
I am building a script that rolls all the dates in a Demo system to make them appear more up to date. The script takes the current max date in the sy ...
I want to create a SQL function that can perform the following task - It should check whether a schema exists and if it doesn't, the function should c ...
However this will return error. I have run successfully when I do execute prepare statement in the command line but when I do it in a function it w ...
Why I am getting this error? Msg 102, Level 15, State 1, Line 4 Incorrect syntax near '4' I am using SQL Server 2014 version I tried changin ...
The following code queries in-memory table t while keeping 2 decimal places for column “price”: I get an error message saying What is the correc ...
I have a table with more than 100 columns and I want to query all but the first and second columns. How do I do it quickly without enumerating 100 col ...
I have a many customer databases. I need to execute different type of SELECT queries on each customerDb: each SELECT will extract just one value. The ...